天文坐标系的转换 时角坐标和赤道坐标系的转化

from astropy import units as u
from astropy.coordinates import SkyCoord, Distance
from astropy.coordinates import FK5

#度转时角
c = SkyCoord(ra=4.1580*u.deg, dec=-5.7402*u.deg)
print(c.to_string('hmsdms'))

#时角转度
coords = ["00:16:37.9 -05:44:25"]
c = SkyCoord(coords, frame=FK5, unit=(u.hourangle, u.deg))

print(c)

你可能感兴趣的:(python)