Hello,
I am new to Orekit and I am trying to convert coordinates from the GCRF frame to ITRF. I followed the tutorial for converting the position coordinates, but am encountering issues when it comes to velocity.
I’ve tried two different methods:
target_frame = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
inertialFrame = FramesFactory.getGCRF()
for time, tmp_s in zip(t,s):
trans = inertialFrame.getTransformTo(target_frame, time)
pos = StaticTransform.cast_(trans).transformPosition(tmp_s.getPVCoordinates().getPosition())
x_itrf.append(pos.getX()/1000)
y_itrf.append(pos.getY()/1000)
z_itrf.append(pos.getZ()/1000)
vel = StaticTransform.cast_(trans).transformPosition(tmp_s.getPVCoordinates().getVelocity())
vx_itrf.append(vel.getX()/1000)
vy_itrf.append(vel.getY()/1000)
vz_itrf.append(vel.getZ()/1000)
but from what I can tell from looking through the forum/documentation, using StaticTransform for velocity transformations is incorrect (?)
I have also tried transforming the PVCoordinates and extracting the position and velocity from these:
for time, tmp_s in zip(t,s):
trans = inertialFrame.getTransformTo(target_frame, time)
pv_coords = inertialFrame.getTransformTo(target_frame, time).transformPVCoordinates(tmp_s.getPVCoordinates())
pv_itrf.append(pv_coords)
x_itrf.append(pv_coords.getPosition().getX()/1000)
y_itrf.append(pv_coords.getPosition().getY()/1000)
z_itrf.append(pv_coords.getPosition().getZ()/1000)
vx_itrf.append(pv_coords.getVelocity().getX()/1000)
vy_itrf.append(pv_coords.getVelocity().getY()/1000)
vz_itrf.append(pv_coords.getVelocity().getZ()/1000)
but when I compare the position coordinates using this method to the ones I previously generated using StaticTransform.cast_ they differ greatly so I am not sure that my implementation of the transformation is correct, for either position or velocity.
Are either of these methods correct for transforming the velocity coordinates?
This is just for a Keplerian Orbit generated by the following code for a set of initial orbital elements:
cart_orbit = OrbitType.CARTESIAN.convertType(initialOrbit)
propagator = KeplerianPropagator(initialOrbit)
el = []
pv = []
t = []
s = []
while (extrapDate.compareTo(finalDate) <= 0.0):
s.append(propagator.propagate(extrapDate))
t.append(extrapDate)
extrapDate = extrapDate.shiftedBy(10.0)
Thank you for any help and apologies for anything that isn’t clear!
Amelia