Search in sources :

Example 1 with SP3Coordinate

use of org.orekit.files.sp3.SP3File.SP3Coordinate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3c2.

@Test
public void testParseSP3c2() throws OrekitException, IOException {
    // simple test for version sp3-c, contains p/v entries and correlations
    final String ex = "/sp3/example-c-2.sp3";
    final SP3Parser parser = new SP3Parser();
    final InputStream inEntry = getClass().getResourceAsStream(ex);
    final SP3File file = parser.parse(inEntry);
    Assert.assertEquals(SP3OrbitType.HLM, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertEquals(26, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("G01").getCoordinates();
    Assert.assertEquals(2, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 2001  8  8  0  0  0.00000000
    Assert.assertEquals(new AbsoluteDate(2001, 8, 8, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // PG01 -11044.805800 -10475.672350  21929.418200    189.163300 18 18 18 219
    // VG01  20298.880364 -18462.044804   1381.387685     -4.534317 14 14 14 191
    checkPVEntry(new PVCoordinates(new Vector3D(-11044805.8, -10475672.35, 21929418.2), new Vector3D(2029.8880364, -1846.2044804, 138.1387685)), coord);
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InputStream(java.io.InputStream) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with SP3Coordinate

use of org.orekit.files.sp3.SP3File.SP3Coordinate 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)

Example 3 with SP3Coordinate

use of org.orekit.files.sp3.SP3File.SP3Coordinate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3a1.

@Test
public void testParseSP3a1() throws OrekitException, IOException, URISyntaxException {
    // simple test for version sp3-a, only contains position entries
    final String ex = "/sp3/example-a-1.sp3";
    final SP3Parser parser = new SP3Parser();
    final String fileName = Paths.get(getClass().getResource(ex).toURI()).toString();
    final SP3File file = (SP3File) parser.parse(fileName);
    Assert.assertEquals(SP3OrbitType.FIT, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertSame(Predefined.ITRF_CIO_CONV_2010_ACCURATE_EOP, ((FactoryManagedFrame) file.getSatellites().get("1").getFrame()).getFactoryKey());
    Assert.assertEquals(25, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("1").getCoordinates();
    Assert.assertEquals(3, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 1994 12 17 0 0 0.00000000
    Assert.assertEquals(new AbsoluteDate(1994, 12, 17, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // P 1 16258.524750 -3529.015750 -20611.427050 -62.540600
    checkPVEntry(new PVCoordinates(new Vector3D(16258524.75, -3529015.75, -20611427.049), Vector3D.ZERO), coord);
    Assert.assertEquals("NGS", file.getAgency());
    Assert.assertEquals("ITR92", file.getCoordinateSystem());
    Assert.assertEquals("d", file.getDataUsed());
    Assert.assertEquals(0.0, file.getDayFraction(), 1.0e-15);
    Assert.assertEquals("1994-12-16T23:59:50.000", file.getEpoch().toString(TimeScalesFactory.getUTC()));
    Assert.assertEquals(49703, file.getJulianDay());
    Assert.assertEquals(3, file.getNumberOfEpochs());
    Assert.assertEquals(900.0, file.getEpochInterval(), 1.0e-15);
    Assert.assertEquals(779, file.getGpsWeek());
    Assert.assertEquals(518400.0, file.getSecondsOfWeek(), 1.0e-10);
    Assert.assertEquals(25, file.getSatellites().size());
    Assert.assertEquals(SP3File.SP3FileType.UNDEFINED, file.getType());
    Assert.assertNull(file.getSatellites().get(null));
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 4 with SP3Coordinate

use of org.orekit.files.sp3.SP3File.SP3Coordinate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3c1.

@Test
public void testParseSP3c1() throws OrekitException, IOException {
    // simple test for version sp3-c, contains p entries
    final String ex = "/sp3/example-c-1.sp3";
    final SP3Parser parser = new SP3Parser();
    final InputStream inEntry = getClass().getResourceAsStream(ex);
    final SP3File file = parser.parse(inEntry);
    Assert.assertEquals(SP3OrbitType.HLM, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertEquals(26, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("G01").getCoordinates();
    Assert.assertEquals(2, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 2001  8  8  0  0  0.00000000
    Assert.assertEquals(new AbsoluteDate(2001, 8, 8, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // PG01 -11044.805800 -10475.672350  21929.418200    189.163300 18 18 18 219
    checkPVEntry(new PVCoordinates(new Vector3D(-11044805.8, -10475672.35, 21929418.2), Vector3D.ZERO), coord);
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InputStream(java.io.InputStream) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 5 with SP3Coordinate

use of org.orekit.files.sp3.SP3File.SP3Coordinate in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3d1.

@Test
public void testParseSP3d1() throws OrekitException, IOException {
    // simple test for version sp3-d, contains p entries
    final String ex = "/sp3/example-d-1.sp3";
    final SP3Parser parser = new SP3Parser();
    final InputStream inEntry = getClass().getResourceAsStream(ex);
    final SP3File file = parser.parse(inEntry);
    Assert.assertEquals(SP3OrbitType.BCT, file.getOrbitType());
    Assert.assertEquals(TimeSystem.GPS, file.getTimeSystem());
    Assert.assertEquals(140, file.getSatelliteCount());
    final List<SP3Coordinate> coords = file.getSatellites().get("S37").getCoordinates();
    Assert.assertEquals(2, coords.size());
    final SP3Coordinate coord = coords.get(0);
    // 2013  4  3  0  0  0.00000000
    Assert.assertEquals(new AbsoluteDate(2013, 4, 3, 0, 0, 0, TimeScalesFactory.getGPS()), coord.getDate());
    // PS37 -34534.904566  24164.610955     29.812840      0.299420
    checkPVEntry(new PVCoordinates(new Vector3D(-34534904.566, 24164610.955, 29812.840), Vector3D.ZERO), coord);
}
Also used : SP3Coordinate(org.orekit.files.sp3.SP3File.SP3Coordinate) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) InputStream(java.io.InputStream) PVCoordinates(org.orekit.utils.PVCoordinates) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)8 SP3Coordinate (org.orekit.files.sp3.SP3File.SP3Coordinate)8 AbsoluteDate (org.orekit.time.AbsoluteDate)8 InputStream (java.io.InputStream)7 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)7 PVCoordinates (org.orekit.utils.PVCoordinates)7 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 TimeScale (org.orekit.time.TimeScale)1