在python中如何将RADec坐标转换为银河系坐标

2024-10-01 04:44:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Python中将像素坐标fits文件转换为世界坐标。标题显示此fits文件位于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'

这不起作用。有什么建议吗?在


Tags: 文件fromimport标题as像素中将dec
1条回答
网友
1楼 · 发布于 2024-10-01 04:44:13

根据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

相关问题 更多 >