Hello,
I am trying to get PVcordinates for a specific TLE and then validate with the results from research paper, but it is not getting the same, i have also looked into the frame . everyhtin seems to be correct. can someone help me in this??
here is the code:
def propagate_tle_orekit(tle_line1, tle_line2, days, step=6): # Using 60-sec step for accuracy
“”"
Propagates the TLE using Orekit’s SGP4 propagator and converts to TEME of Date.
:param tle_line1: First line of TLE
:param tle_line2: Second line of TLE
:param days: Number of days to propagate
:param step: Time step in seconds (default: 60 seconds)
:return: List of propagated state vectors (time, x, y, z, vx, vy, vz)
“”"
tle = TLE(tle_line1, tle_line2)
propagator = TLEPropagator.selectExtrapolator(tle) # Uses SGP4 or SDP4 based on orbital period
epoch = tle.getDate()
target_date = epoch.shiftedBy(float(days*86400))
print(f"Epoch from TLE: {epoch}") # Debugging step
propagated_data = []
for t in range(0, days * 86400, step):
propagation_time = epoch.shiftedBy(float(t))
state = propagator.propagate(propagation_time)
pv = state.getPVCoordinates(FramesFactory.getTEME()) # State vector in TEME frame
position = pv.getPosition()
velocity = pv.getVelocity()
propagated_data.append((
propagation_time.toString(),
position.getX() / 1000.0, position.getY() / 1000.0, position.getZ() / 1000.0, # Convert meters to km
velocity.getX() / 1000.0, velocity.getY() / 1000.0, velocity.getZ() / 1000.0 # Convert m/s to km/s
))
return propagated_data
Example usage
if name == “main”:
tle_line1 = “1 00005U 58002B 00179.78495062 +.00000023 +00000-0 +28098-4 0 9994”
tle_line2 = “2 00005 034.2682 348.7242 1859667 331.7664 019.3264 10.82419157413667”
days = int(input("Enter the number of days to propagate: "))
results = propagate_tle_orekit(tle_line1, tle_line2, days)
print("Time (UTC), X (km), Y (km), Z (km), VX (km/s), VY (km/s), VZ (km/s)")
for entry in results:
print(entry)
My answer for 3 days is : (‘2000-06-30T18:50:13.733568Z’, -7916.898691774212, 3773.2206830023106, 585.5920667066741, -2.5886222539053194, -4.889439484896841, -3.734013243397058)
according to paper using orekit should be :
3 days -9060.473736 4658.709525 813.686732 -2.232833 -4.110453 -3.157345