Hello @Vincent and @Serrof,
Sorry for the late answer I was out of the office.
Thank you for both of your messages! I tried reducing the number of points to 8 and it worked without any issues! I didn’t need to use the HermiteInterpolator—just the ephemeris, as shown below:
itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
eme2000 = FramesFactory.getEME2000()
for point in trajectory.keys():
point_date = initial_date.shiftedBy(trajectory[point]["t"])
# 1) PV in ITRF
pv = PVCoordinates(
Vector3D(trajectory[point]["X"],
trajectory[point]["Y"],
trajectory[point]["Z"]),
Vector3D(float(trajectory[point]["Vx"]),
float(trajectory[point]["Vy"]),
float(trajectory[point]["Vz"])),
Vector3D(float(trajectory[point]["Ax"]),
float(trajectory[point]["Ay"]),
float(trajectory[point]["Az"]))
)
# 2) Transform → EME2000
transform = itrf.getTransformTo(eme2000, point_date)
pv_eme = transform.transformPVCoordinates(pv)
# 3) Create the state list in order to create the ephemeris
abs_pv = AbsolutePVCoordinates(eme2000, point_date, pv_eme)
state = SpacecraftState(abs_pv)
aircraft_states.add(state)
ephemeris = Ephemeris(aircraft_states, len(traj))
I’m getting back the position with the following code :
def Handler_For_OEM():
class HandlerForDate(PythonOrekitFixedStepHandler):
def init(self, so, t, step):
super().__init__()
self.data = {
"dates": [],
"absdates": [],
"dt": [],
"Pos_X": [],
"Pos_Y": [],
"Pos_Z": [],
}
self.print_counter = 0
def handleStep(self, state):
date = state.getDate()
pv_coordinates = state.getPVCoordinates(FramesFactory.getEME2000())
x = pv_coordinates.getPosition().getX()
y = pv_coordinates.getPosition().getY()
z = pv_coordinates.getPosition().getZ()
mjd = date.getMJD()
mjd_day = int(mjd)
mjd_sec = (mjd - mjd_day) * 86400
self.data["absdates"].append(absolute_to_datetime(date))
self.data["dates"].append(mjd_day)
self.data["dt"].append(round(mjd_sec))
self.data["Pos_X"].append(x / 1000.0)
self.data["Pos_Y"].append(y / 1000.0)
self.data["Pos_Z"].append(z / 1000.0)
self.print_counter += 1
def finish(self, finalState):
pass
def to_dataframe(self):
return pd.DataFrame(self.data)
return HandlerForDate()
This code allows propagation without any issues. However, I was wondering whether my frame transformation from ITRF to EME2000 is correct. This conversion is necessary to propagate the ephemeris.
I was also wondering whether a rotation-related correction might be missing here—specifically to account for Earth’s rotation—particularly when transforming velocity and acceleration in the PV list. This concern arises from the unusual ground track I’m seeing between the created points (only between, meaning there could be an issue with the velocity/acceleration transform) . I’m referring to the kind of correction discussed in Frames conversion .
Thanks for the help !
EM