I am new user in the Orekit. I am trying to compare different propagators with CPF files. But i have problem to obtain velocity vectors from position vectors using CPF files. Is there any easy way to obtain these data by using Orekit?
Thanks in advance
Welcome to the Orekit forum!
After reading the file, you obtain a
CPF object. Then you can obtain the satellite ephemeris using
Now, I recommend you to access the BoundedPropagator related to the ephemeris using ephemeris.getPropagator() method. Thanks to that, you will have an orbit propagator (interpolator in this case) built from the ephemeris that will give you position and velocity data for the epochs you want (i.e. using getPVCoordinates(epoch) method).
Thanks for the quick reply @bcazabonne
Prior to your reply, I wasn’t aware of this CPF reader method; instead I was manually reading position data from a txt file (recieved from CPF file). Just to be on the same page, you are proposing to use this aforementioned method together with
ephemeris.getPropagator() and with
getPVCoordinates(epoch) to obtain velocity vectors, right? Isn’t this interpolator basically something like finite difference method?
Aside from the CPF reader method, can i find velocity vectors from position vectors only?
Yes, the actions can be done on the following order:
- Read the file using the
CPFParser class. You will obtain a
- Using the
CPF object, obtain the satellite ephemeris using
- Using the ephemeris, obtain the related
BoundedPropagator will give you position and velocity based on the data contained in the file. Please find below a Java example:
final CPFParser parser = new CPFParser();
final CPF file = (CPF) parser.parse(new DataSource(fileName));
final CPFEphemeris ephemeris = file.getSatellites().get(satelliteId);
final BoundedPropagator propagator = ephemeris.getPropagator();
final TimeStampedPVCoordinates pv = propagator.getPVCoordinates(date, frame);
final Vector3D pos = pv.getPosition();
final Vector3D vel = pv.getVelocity();
It’s an Hermite interpolator. You can find more details in the JavaDoc of the method
interpolate of the
Knowing the time between two position entries you can compute the time derivatives by yourself.
However, I strongly recommend to use the methodology describe above because it will give you a more accurate computation of the velocity.