Search in sources :

Example 41 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D 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 42 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D 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 43 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D 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)

Example 44 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class SP3ParserTest method testParseSP3d2.

@Test
public void testParseSP3d2() throws OrekitException, IOException {
    // simple test for version sp3-c, contains p/v entries and correlations
    final String ex = "/sp3/example-d-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 45 with Vector3D

use of org.hipparchus.geometry.euclidean.threed.Vector3D in project Orekit by CS-SI.

the class AbstractForceModelTest method toDS.

protected FieldSpacecraftState<DerivativeStructure> toDS(final SpacecraftState state, final AttitudeProvider attitudeProvider) throws OrekitException {
    final Vector3D p = state.getPVCoordinates().getPosition();
    final Vector3D v = state.getPVCoordinates().getVelocity();
    final Vector3D a = state.getPVCoordinates().getAcceleration();
    DSFactory factory = new DSFactory(6, 1);
    Field<DerivativeStructure> field = factory.getDerivativeField();
    final FieldAbsoluteDate<DerivativeStructure> fDate = new FieldAbsoluteDate<>(field, state.getDate());
    final TimeStampedFieldPVCoordinates<DerivativeStructure> fPVA = new TimeStampedFieldPVCoordinates<>(fDate, new FieldVector3D<>(factory.variable(0, p.getX()), factory.variable(1, p.getY()), factory.variable(2, p.getZ())), new FieldVector3D<>(factory.variable(3, v.getX()), factory.variable(4, v.getY()), factory.variable(5, v.getZ())), new FieldVector3D<>(factory.constant(a.getX()), factory.constant(a.getY()), factory.constant(a.getZ())));
    final FieldCartesianOrbit<DerivativeStructure> orbit = new FieldCartesianOrbit<>(fPVA, state.getFrame(), state.getMu());
    final FieldAttitude<DerivativeStructure> attitude = attitudeProvider.getAttitude(orbit, orbit.getDate(), orbit.getFrame());
    return new FieldSpacecraftState<>(orbit, attitude, field.getZero().add(state.getMass()));
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) DSFactory(org.hipparchus.analysis.differentiation.DSFactory) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)750 Test (org.junit.Test)466 AbsoluteDate (org.orekit.time.AbsoluteDate)323 PVCoordinates (org.orekit.utils.PVCoordinates)280 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)259 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)187 SpacecraftState (org.orekit.propagation.SpacecraftState)152 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)124 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)119 Frame (org.orekit.frames.Frame)115 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)105 Orbit (org.orekit.orbits.Orbit)100 GeodeticPoint (org.orekit.bodies.GeodeticPoint)84 OrekitException (org.orekit.errors.OrekitException)83 CartesianOrbit (org.orekit.orbits.CartesianOrbit)75 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)68 DateComponents (org.orekit.time.DateComponents)67 Transform (org.orekit.frames.Transform)61 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)59 CircularOrbit (org.orekit.orbits.CircularOrbit)59