我在Python中将像素坐标拟合文件转换为世界坐标。标题显示此拟合文件位于RA-Dec坐标系中。我想将其转换为银河坐标。这是我尝试过的。
from astropy import coordinates as coord
from astropy import units as u
c=coord.icrscoord(ra=wx,dec=wy,unit=(u.degree,u.degree))
c.galactic
AttributeError: 'module' object has no attribute 'icrscoord'
这不起作用。有什么建议吗?
答案 0 :(得分:3)
根据Astropy documentation,语法为:
from astropy import units as u
from astropy.coordinates import SkyCoord
c = SkyCoord(ra=wx*u.degree, dec=wy*u.degree, frame='icrs')
c.galactic