I have the latitude, longitude, and height for a satellite and for a ground observer. I am trying to calculate the satellite zenith angle and satellite azimuth angle, for the satellite, as seen from the ground.
I'm currently trying to solve this using astropy
. The documentation describes how to calculate the zenith and azimuth angle for the Sun.
I tried to place the satellite straight above the observer, so that the zenith angle should be 0° (or the elevation angle 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)
However, clearly .transform_to(AltAz(...))
does not mean what I think it means, for the answer is not what I want:
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)>
I expected the elevation angle to be close 90°, not 63°.
There's also some routines in pyorbital but it doesn't seem to contain what I'm looking for.
I believe it should also be possible using pyephem
, except that this seems to expect I get satellite information from a catalogue. I already have the lat, lon, altitude.
I've also looked at pyproj
but I think this is only for objects at the geoid.
How can I calculate the altitude and azimuth for the satellite as observed from the ground?