使用天文坐标与地球卫星合作#

本文讨论双线元素星历和真赤道、平均春分框架。对于直接以地心ITRS坐标给出的卫星星历(例如 ILRS ephemeris format )请参见示例转换为 AltAz 下面从以地心为中心的ITRS坐标系开始。

卫星数据通常以两行元素(TLE)格式提供(参见 here 定义)。这些数据集被设计用于结合轨道传播模型理论来预测卫星的位置。

中详细讨论了此类模型的历史 Vallado et al (2006) 世卫组织还提供了SGP4轨道传播代码的参考实现,旨在与美国国防部提供的TLE集兼容,这些TLE集可从以下来源获得 Celestrak

SGP4模型的输出坐标系是真正的赤道平均分点坐标系(TEME),它是内置的框架之一 astropy.coordinates. TEME is an Earth-centered inertial frame (i.e., it does not rotate with respect to the stars). Several definitions exist; astropy uses the implementation described in Vallado et al (2006) .

从TLE数据中寻找TEME坐标#

中当前没有支持 astropy.coordinates for computing satellite orbits from TLE orbital element sets. Full support for handling TLE files is available in the Skyfield 类库,但是一些关于处理卫星数据的建议 astropy 在下面。

你需要一些外部的库来计算卫星的位置和速度。这个 SGP4 类库可以做到这一点。使用此库查找 TEME 卫星的坐标是:

>>> from sgp4.api import Satrec
>>> from sgp4.api import SGP4_ERRORS
>>> s = '1 25544U 98067A   19343.69339541  .00001764  00000-0  38792-4 0  9991'
>>> t = '2 25544  51.6439 211.2001 0007417  17.6667  85.6398 15.50103472202482'
>>> satellite = Satrec.twoline2rv(s, t)

这个 satellite 对象有一个方法, satellite.sgp4 ,它将尝试计算给定时间的TEME位置和速度:

>>> from astropy.time import Time
>>> t = Time(2458827.362605, format='jd')
>>> error_code, teme_p, teme_v = satellite.sgp4(t.jd1, t.jd2)  # in km and km/s
>>> if error_code != 0:
...     raise RuntimeError(SGP4_ERRORS[error_code])

现在我们有了位置和速度,以公里和每秒公里为单位,我们可以在 TEME 参考坐标系:

>>> from astropy.coordinates import TEME, CartesianDifferential, CartesianRepresentation
>>> from astropy import units as u
>>> teme_p = CartesianRepresentation(teme_p*u.km)
>>> teme_v = CartesianDifferential(teme_v*u.km/u.s)
>>> teme = TEME(teme_p.with_differentials(teme_v), obstime=t)

注意我们是如何小心地设置 TEME 到我们计算卫星位置的时间。

将TEME转换为其他坐标系#

一旦你有卫星定位 TEME 坐标可以转换成 astropy.coordinates 框架。

例如,要查找卫星头顶的纬度、经度和高度:

>>> from astropy.coordinates import ITRS
>>> itrs_geo = teme.transform_to(ITRS(obstime=t))
>>> location = itrs_geo.earth_location
>>> location.geodetic  
GeodeticLocation(lon=<Longitude 160.34199789 deg>, lat=<Latitude -24.6609379 deg>, height=<Quantity 420.17927591 km>)

或者,如果要从特定位置找到卫星的高度和方位角:

备注

在本例中,手动设置拓扑中心的中间步骤 ITRS 为了避免从地心坐标到地心坐标的直接转换时会发生的恒星像差的变化,必须使用框架 transform_to 被利用了。请参阅 ITRS 有关更多细节,请参见框架。

>>> from astropy.coordinates import EarthLocation, AltAz
>>> siding_spring = EarthLocation.of_site('aao')  
>>> topo_itrs_repr = itrs_geo.cartesian.without_differentials() - siding_spring.get_itrs(t).cartesian
>>> itrs_topo = ITRS(topo_itrs_repr, obstime = t, location=siding_spring)
>>> aa = itrs_topo.transform_to(AltAz(obstime=t, location=siding_spring))
>>> aa.alt  
<Latitude 10.94799670 deg>
>>> aa.az  
<Longitude 59.28803392 deg>

对于静止的观测者, ITRS 与位置无关,因此,如果要将速度携带到地心框架,可以执行以下操作:

>>> itrs_geo_p = itrs_geo.cartesian.without_differentials()
>>> itrs_geo_v = itrs_geo.cartesian.differentials['s']
>>> topo_itrs_p = itrs_geo_p - siding_spring.get_itrs(t).cartesian
>>> topo_itrs_repr = topo_itrs_p.with_differentials(itrs_geo_v)
>>> itrs_topo = ITRS(topo_itrs_repr, obstime = t, location=siding_spring)