Hello,
I apologise if I am just missing something simple here. All I want to do is load a TLE and then check that the Keplerian orbital parameters match those in the TLE.
I have made a minimal working example below:
#!/usr/bin/env python3
import orekit
from org.orekit.orbits import OrbitType
from orekit.pyhelpers import setup_orekit_curdir
from org.orekit.propagation.analytical.tle import TLE, TLEPropagator
orekit.initVM()
setup_orekit_curdir()
tle_line_1 = '1 41999U 17008BD 21322.49427166 .00005929 00000-0 19476-3 0 9992'
tle_line_2 = '2 41999 97.3103 30.0492 0005406 261.3283 98.7346 15.31932939264278'
tle_object = TLE(tle_line_1, tle_line_2)
tle_propagator = TLEPropagator.selectExtrapolator(tle_object)
tle_orbit_cart = tle_propagator.getInitialState().getOrbit()
tle_orbit_kep = OrbitType.KEPLERIAN.convertType(tle_orbit_cart)
print(tle_line_1)
print(tle_line_2)
print(tle_orbit_kep)
And this gives me the following output:
1 41999U 17008BD 21322.49427166 .00005929 00000-0 19476-3 0 9992
2 41999 97.3103 30.0492 0005406 261.3283 98.7346 15.31932939264278
Keplerian parameters: {a: 6854622.438115723; e: 6.816873331539523E-4; i: 97.30520232499347; pa: 53.73262282796879; raan: 30.04920000880782; v: -53.7326719339718;}
You can see slight differences in the eccentricity and the inclination with the argument of perigee being completely wrong (even taking into account some wrapping).
Am I making any oversights here with my code?
I tried converting from a Keplerian orbit to a cartesian orbit and back to a Keplerian orbit to see if there were any issues with the conversion (there weren’t) and I also tried propagating the TLE propagator from the epoch of the TLE instead which gave the same result (tle_orbit_cart = tle_propagator.propagate(tle_object.getDate()).getOrbit())
Any suggestions of where I could be going wrong?
Also thanks for your continued support on these forums you have answered many of my other questions through other posts, I appreciate your time.
Thanks