如何在 Astropy 中将 AltAz 坐标转换为赤道坐标

Posted

技术标签:

【中文标题】如何在 Astropy 中将 AltAz 坐标转换为赤道坐标【英文标题】:How do you convert from AltAz coordinates to equatorial coordinates in Astropy 【发布时间】:2015-07-06 16:40:13 【问题描述】:

我一直在试图弄清楚如何将一组 AltAz 坐标转换为赤道坐标,到目前为止,我所能找到的只是如何使用以下方法将赤道转换为 AltAz(但不是相反):

c = SkyCoord('22h50m0.19315s', '+24d36m05.6984s', frame='icrs')
loc = EarthLocation(lat = 31.7581*u.deg, lon = -95.6386*u.deg, height = 147*u.m)
time = Time('1991-06-06 12:00:00')
cAltAz = c.transform_to(AltAz(obstime = time, location = loc))

但是现在我想将 mpAltAz 的方位角旋转一些增量,并找出新点的相应赤道坐标。

即我想要这样的东西:

newAltAzcoordiantes = SkyCoord(alt = cAltAz.alt.deg, az = cAltAz.az.deg + x*u.deg, obstime = time, frame = 'altaz')
newAltAzcoordiantes.transform_to(ICRS)

我遇到的问题是我似乎无法在 AltAz 坐标系中构建 SkyCoord 对象

我希望够清楚,这是我第一次在***上发帖。

【问题讨论】:

【参考方案1】:

我对天文学不太了解,但似乎有很多文档:

transforming between coordinates full API docs for coordinates

对我来说,cAltAz.icrs 有效并返回原始的c。我需要调整一堆东西以使其在newAltAzcoordiantes 上工作(需要定义x,停止在已经有单位的属性上调用deg,添加location):

>>> x = 5 # why not?
>>> newAltAzcoordiantes = SkyCoord(alt = cAltAz.alt, az = cAltAz.az + x*u.deg, obstime = time, frame = 'altaz', location = loc)
>>> newAltAzcoordiantes.icrs
<SkyCoord (ICRS): (ra, dec) in deg
    (341.79674062, 24.35770826)>

【讨论】:

该死的我已经很接近了,我真的应该能够弄清楚这一点。这正是我所需要的,谢谢。 只想提一下(至少对于 astopy 1.3 版)您需要致电newAltAzcoordiantes.transform_to('icrs')

以上是关于如何在 Astropy 中将 AltAz 坐标转换为赤道坐标的主要内容,如果未能解决你的问题,请参考以下文章