aburrell / apexpy

A Python wrapper for Apex coordinates
MIT License
34 stars 25 forks source link

ENH: add apex height example #67

Closed aburrell closed 3 years ago

aburrell commented 3 years ago

Is your feature request related to a problem? Please describe. I recently had a question asking how to determine L-shells seen by the ISS during its orbit. This is a basic thing that apexpy is good at doing, but we don't have an example showing how.

Describe the solution you'd like Add an example to the documentation.

Describe alternatives you've considered Just explaining it to people when they ask

Additional context

import apexpy
import datetime as dt

stime = dt.datetime(2021, 3, 15, 15, 6)
iss_lat = 9.8
iss_lon = 142.2
iss_alt = 419.0

# Get apex lat
alat, alon = apex_iss.geo2apex(iss_lat, iss_lon, iss_alt)

# Get apex altitude
aalt = apex_iss.get_apex(alat, iss_alt)
L_iss = 1.0 + aalt / apex_iss.RE
print("apex height={:.3f} km, L={:.2f}".format(aalt, L_iss))
apex height=875.155 km, L=1.14

Reminders This is a volunteer-driven project. Code contributions are welcome, as is help testing new code.