计算从地面看到的卫星的天顶角和仰角

Calculating zenith and elevation angles for satellite as seen from the ground

我有卫星和地面观察员的纬度、经度和高度。我正在尝试计算从地面看到的卫星的卫星天顶角和卫星方位角。

我目前正在尝试使用 astropy 解决此问题。文档 describes 如何计算太阳的天顶角和方位角。

我试着把卫星放在观察者正上方,这样天顶角应该是0°(或者仰角90°)。

In [41]: ground = astropy.coordinates.EarthLocation(lat=3*u.deg, lon=5*u.deg)

In [42]: sat = astropy.coordinates.EarthLocation.from_geodetic(3*u.deg, 5*u.deg, 700*u.km)

但是,显然.transform_to(AltAz(...))并不是我想的意思,因为答案不是我想要的:

In [43]: print(sat.get_itrs().transform_to(AltAz(location=ground)))
<AltAz Coordinate (obstime=None, location=(6345216.684243768, 555134.5274868822, 331574.3153428908) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0, obswl=1.0 micron): (az, alt, distance) in (deg, deg, m)
    (314.96287134, 63.2970069, 773970.24385554)>

我预计仰角接近 90°,而不是 63°。

pyorbital里面也有一些套路,不过好像没有我要找的

我相信使用 pyephem 也应该是可能的,只是这似乎要求我从目录中获取卫星信息。我已经有了纬度、经度、高度。

我也看过 pyproj 但我认为这仅适用于大地水准面的物体。

如何计算从地面观察到的卫星高度和方位角?

您可以从 pyorbital 获取此信息。相关函数是get_observer_look。出于某种原因,它需要时间,而且它显然要求所有输入都是 ndarray 对象。它会在方位角定义不明确时发出警告(例如当天顶角为零时)。但它确实有效:

In [50]: import pyorbital.orbital

In [51]: print(pyorbital.orbital.get_observer_look(atleast_1d(1), atleast_1d(1), atleast_1d(700), datetime.datetime.now(), atleast_1d(1), atleast_1d(1), atleast_1d(1)))
(array([261.11934085]), array([89.99999915]))

In [53]: print(pyorbital.orbital.get_observer_look(atleast_1d(10), atleast_1d(0), atleast_1d(700), datetime.datetime.now(), atleast_1d(0), atleast_1d(0), atleast_1d(0.1)))
/home/zmaw/u237009/.conda/envs/FCDR37a/lib/python3.7/site-packages/pyorbital/orbital.py:112: RuntimeWarning: divide by zero encountered in true_divide
  az_ = np.arctan(-top_e / top_s)
(array([270.]), array([25.73173269]))

In [54]: print(pyorbital.orbital.get_observer_look(atleast_1d(10), atleast_1d(0), atleast_1d(700), datetime.datetime.now(), atleast_1d(0.1), atleast_1d(0.1), atleast_1d(0.1)))
(array([90.56944651]), array([26.03504444]))

稍微清理一下您的输入:

from astropy import units as u
from astropy.coordinates import AltAz, EarthLocation

ground = EarthLocation.from_geodetic(lat=3*u.deg, lon=5*u.deg, height=0*u.km)
sat    = EarthLocation.from_geodetic(lat=3*u.deg, lon=5*u.deg, height=700*u.km)

result = sat.get_itrs().transform_to(AltAz(location=ground))
print(result)

产生预期的 90 度:

<AltAz Coordinate (obstime=None, location=(6345.21668424, 555.13452749, 331.57431534) km, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron): (az, alt, distance) in (deg, deg, km)
    (89.99999672, 89.99991123, 700.)>