Search in sources :

Example 1 with SP3Ephemeris

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);
}
Also used : Frame(org.orekit.frames.Frame) FactoryManagedFrame(org.orekit.frames.FactoryManagedFrame) SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) InputStream(java.io.InputStream) TimeScale(org.orekit.time.TimeScale) BoundedPropagator(org.orekit.propagation.BoundedPropagator) SP3Ephemeris(org.orekit.files.sp3.SP3File.SP3Ephemeris) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

InputStream (java.io.InputStream)1 Test (org.junit.Test)1 SP3Coordinate (org.orekit.files.sp3.SP3File.SP3Coordinate)1 SP3Ephemeris (org.orekit.files.sp3.SP3File.SP3Ephemeris)1 FactoryManagedFrame (org.orekit.frames.FactoryManagedFrame)1 Frame (org.orekit.frames.Frame)1 BoundedPropagator (org.orekit.propagation.BoundedPropagator)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1 TimeScale (org.orekit.time.TimeScale)1