use of org.orekit.files.sp3.SP3File.SP3Ephemeris in project Orekit by CS-SI.
the class SP3ParserTest method testSP3Propagator.
@Test
public void testSP3Propagator() throws Exception {
// setup
final String ex = "/sp3/example-a-2.sp3";
final Frame frame = FramesFactory.getITRF(IERSConventions.IERS_2003, true);
final SP3Parser parser = new SP3Parser(Constants.EIGEN5C_EARTH_MU, 3, s -> frame);
final InputStream inEntry = getClass().getResourceAsStream(ex);
TimeScale gps = TimeScalesFactory.getGPS();
// action
final SP3File file = parser.parse(inEntry);
// verify
SP3Ephemeris ephemeris = file.getSatellites().get("1");
BoundedPropagator propagator = ephemeris.getPropagator();
Assert.assertEquals(propagator.getMinDate(), new AbsoluteDate(1994, 12, 17, gps));
Assert.assertEquals(propagator.getMaxDate(), new AbsoluteDate(1994, 12, 17, 23, 45, 0, gps));
SP3Coordinate expected = ephemeris.getCoordinates().get(0);
checkPVEntry(propagator.getPVCoordinates(propagator.getMinDate(), frame), expected);
expected = ephemeris.getCoordinates().get(1);
checkPVEntry(propagator.getPVCoordinates(expected.getDate(), frame), expected);
expected = ephemeris.getCoordinates().get(2);
checkPVEntry(propagator.getPVCoordinates(propagator.getMaxDate(), frame), expected);
ephemeris = file.getSatellites().get("31");
propagator = ephemeris.getPropagator();
Assert.assertEquals(propagator.getMinDate(), new AbsoluteDate(1994, 12, 17, gps));
Assert.assertEquals(propagator.getMaxDate(), new AbsoluteDate(1994, 12, 17, 23, 45, 0, gps));
expected = ephemeris.getCoordinates().get(0);
checkPVEntry(propagator.propagate(propagator.getMinDate()).getPVCoordinates(frame), expected);
expected = ephemeris.getCoordinates().get(1);
checkPVEntry(propagator.propagate(expected.getDate()).getPVCoordinates(frame), expected);
expected = ephemeris.getCoordinates().get(2);
checkPVEntry(propagator.propagate(propagator.getMaxDate()).getPVCoordinates(frame), expected);
}
Aggregations