I'm trying to calculate the perigee and apogee of a given satellite based on its TLE
from skyfield.api import Topos, EarthSatellite
ts = load.timescale()
# latest TLE as of this morning, epoch is epoch=2020-08-24T12:30:01Z
line=['0 ISS (ZARYA)',
'1 25544U 98067A 20237.52084486 .00016717 00000-0 10270-3 0 9031',
'2 25544 51.6430 10.2947 0001353 63.6269 296.5020 15.49179055 2606']
satellite = EarthSatellite(line[1], line[2], line[0], ts)
t = ts.utc(2020, 8, 24, 12, range(30,123)) #epoch + a full orbit
geocentric = satellite.at(t)
subpoint = geocentric.subpoint()
print(f"max {max(subpoint.elevation.km)}")
print(f"min {min(subpoint.elevation.km)}")
This produces an apogee of 437.7 and perigee of 418.5. The perigee looks right, but apogee looks about 17km too high.
Thinking I was reading the docs wrong, I've also tried calculating the topocentric distance along the way and got identical results (to 7 places)
difference = satellite - bluffton
topocentric = difference.at(t)
alt, az, distance = topocentric.altaz()
print(f"max {max(distance.km)}")
print(f"min {min(distance.km)}")
Which produces identical results within 7 decimals.
Doing this more by hand, at the the TLE's epoch:
revs_per_day = 15.49179055
eccentricity = 0.0001353
earth_equatorial_radius = 6378.14
period_hrs = 24.0 / revs_per_day
range = (6028.9 * (period_hrs * 60))** (2 / 3)
perigee = range * (1 + eccentricity) - earth_equatorial_radius
produces an apogee of 420.02 km and perigee of 418.18 km, which is more in line with what I expected.
What am I doing wrong? Am I not understanding what Skyfield's distances represent?