Search in sources :

Example 56 with AbsoluteDate

use of org.orekit.time.AbsoluteDate in project Orekit by CS-SI.

the class TDMParserTest method validateTDMExampleAllKeywords.

/**
 * Validation function for example displaying all keywords.
 * @param file Parsed TDMFile to validate
 * @throws OrekitException if UTC time scale cannot be retrieved
 */
public static void validateTDMExampleAllKeywords(TDMFile file) throws OrekitException {
    final TimeScale utc = TimeScalesFactory.getUTC();
    // Header
    Assert.assertEquals(1.0, file.getFormatVersion(), 0.0);
    Assert.assertEquals(new AbsoluteDate("2017-06-14T10:53:00.000", utc).durationFrom(file.getCreationDate()), 0.0, 0.0);
    Assert.assertEquals("CSSI", file.getOriginator());
    final List<String> headerComment = new ArrayList<String>();
    headerComment.add("TDM example created by CSSI");
    headerComment.add("Testing all TDM known meta-data and data keywords");
    Assert.assertEquals(headerComment, file.getHeaderComment());
    // Meta-Data
    final TDMFile.TDMMetaData metaData = file.getObservationsBlocks().get(0).getMetaData();
    Assert.assertEquals(CcsdsTimeScale.UTC, metaData.getTimeSystem());
    Assert.assertEquals(new AbsoluteDate("2017-06-14T10:53:00.000", utc).durationFrom(metaData.getStartTime()), 0.0, 0.0);
    Assert.assertEquals("2017-06-14T10:53:00.000", metaData.getStartTimeString());
    Assert.assertEquals(new AbsoluteDate("2017-06-15T10:53:00.000", utc).durationFrom(metaData.getStopTime()), 0.0, 0.0);
    Assert.assertEquals("2017-06-15T10:53:00.000", metaData.getStopTimeString());
    Assert.assertEquals("DSS-25", metaData.getParticipants().get(1));
    Assert.assertEquals("YYYY-NNNA", metaData.getParticipants().get(2));
    Assert.assertEquals("P3", metaData.getParticipants().get(3));
    Assert.assertEquals("P4", metaData.getParticipants().get(4));
    Assert.assertEquals("P5", metaData.getParticipants().get(5));
    Assert.assertEquals("SEQUENTIAL", metaData.getMode());
    Assert.assertEquals("2,1", metaData.getPath());
    Assert.assertEquals("4,5", metaData.getPath1());
    Assert.assertEquals("3,2", metaData.getPath2());
    Assert.assertEquals("S", metaData.getTransmitBand());
    Assert.assertEquals("L", metaData.getReceiveBand());
    Assert.assertEquals(240, metaData.getTurnaroundNumerator(), 0);
    Assert.assertEquals(221, metaData.getTurnaroundDenominator(), 0);
    Assert.assertEquals("TRANSMIT", metaData.getTimetagRef());
    Assert.assertEquals(1.0, metaData.getIntegrationInterval(), 0.0);
    Assert.assertEquals("MIDDLE", metaData.getIntegrationRef());
    Assert.assertEquals(32021035200.0, metaData.getFreqOffset(), 0.0);
    Assert.assertEquals("COHERENT", metaData.getRangeMode());
    Assert.assertEquals(32768.0, metaData.getRangeModulus(), 0.0);
    Assert.assertEquals("RU", metaData.getRangeUnits());
    Assert.assertEquals("RADEC", metaData.getAngleType());
    Assert.assertEquals("EME2000", metaData.getReferenceFrameString());
    Assert.assertEquals(true, FramesFactory.getEME2000().equals(metaData.getReferenceFrame()));
    Assert.assertEquals(0.000077, metaData.getTransmitDelays().get(1), 0.0);
    Assert.assertEquals(0.000077, metaData.getTransmitDelays().get(2), 0.0);
    Assert.assertEquals(0.000077, metaData.getTransmitDelays().get(3), 0.0);
    Assert.assertEquals(0.000077, metaData.getTransmitDelays().get(4), 0.0);
    Assert.assertEquals(0.000077, metaData.getTransmitDelays().get(5), 0.0);
    Assert.assertEquals(0.000077, metaData.getReceiveDelays().get(1), 0.0);
    Assert.assertEquals(0.000077, metaData.getReceiveDelays().get(2), 0.0);
    Assert.assertEquals(0.000077, metaData.getReceiveDelays().get(3), 0.0);
    Assert.assertEquals(0.000077, metaData.getReceiveDelays().get(4), 0.0);
    Assert.assertEquals(0.000077, metaData.getReceiveDelays().get(5), 0.0);
    Assert.assertEquals("RAW", metaData.getDataQuality());
    Assert.assertEquals(1.0, metaData.getCorrectionAngle1(), 0.0);
    Assert.assertEquals(2.0, metaData.getCorrectionAngle2(), 0.0);
    Assert.assertEquals(3.0, metaData.getCorrectionDoppler(), 0.0);
    Assert.assertEquals(4.0, metaData.getCorrectionRange(), 0.0);
    Assert.assertEquals(5.0, metaData.getCorrectionReceive(), 0.0);
    Assert.assertEquals(6.0, metaData.getCorrectionTransmit(), 0.0);
    Assert.assertEquals("YES", metaData.getCorrectionsApplied());
    final List<String> metaDataComment = new ArrayList<String>();
    metaDataComment.add("All known meta-data keywords displayed");
    Assert.assertEquals(metaDataComment, metaData.getComment());
    // Data
    final List<TDMFile.Observation> observations = file.getObservationsBlocks().get(0).getObservations();
    // Reference data
    final String[] keywords = { "CARRIER_POWER", "DOPPLER_INSTANTANEOUS", "DOPPLER_INTEGRATED", "PC_N0", "PR_N0", "RANGE", "RECEIVE_FREQ_1", "RECEIVE_FREQ_2", "RECEIVE_FREQ_3", "RECEIVE_FREQ_4", "RECEIVE_FREQ_5", "RECEIVE_FREQ", "TRANSMIT_FREQ_1", "TRANSMIT_FREQ_2", "TRANSMIT_FREQ_3", "TRANSMIT_FREQ_4", "TRANSMIT_FREQ_5", "TRANSMIT_FREQ_RATE_1", "TRANSMIT_FREQ_RATE_2", "TRANSMIT_FREQ_RATE_3", "TRANSMIT_FREQ_RATE_4", "TRANSMIT_FREQ_RATE_5", "DOR", "VLBI_DELAY", "ANGLE_1", "ANGLE_2", "CLOCK_BIAS", "CLOCK_DRIFT", "STEC", "TROPO_DRY", "TROPO_WET", "PRESSURE", "RHUMIDITY", "TEMPERATURE" };
    final AbsoluteDate epoch = new AbsoluteDate("2017-06-14T10:53:00.000", utc);
    // Check consistency
    for (int i = 0; i < keywords.length; i++) {
        Assert.assertEquals(keywords[i], observations.get(i).getKeyword());
        Assert.assertEquals(epoch.shiftedBy((double) (i + 1)).durationFrom(observations.get(i).getEpoch()), 0.0, 0.0);
        Assert.assertEquals((double) (i + 1), observations.get(i).getMeasurement(), 0.0);
    }
    // Comment
    final List<String> dataComment = new ArrayList<String>();
    dataComment.add("Signal related Keywords");
    dataComment.add("VLBI/Delta-DOR Related Keywords");
    dataComment.add("Angle Related Keywords");
    dataComment.add("Time Related Keywords");
    dataComment.add("Media Related Keywords");
    dataComment.add("Meteorological Related Keywords");
    Assert.assertEquals(dataComment, file.getObservationsBlocks().get(0).getObservationsComment());
}
Also used : ArrayList(java.util.ArrayList) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 57 with AbsoluteDate

use of org.orekit.time.AbsoluteDate 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 58 with AbsoluteDate

use of org.orekit.time.AbsoluteDate 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 59 with AbsoluteDate

use of org.orekit.time.AbsoluteDate 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 60 with AbsoluteDate

use of org.orekit.time.AbsoluteDate 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)

Aggregations

AbsoluteDate (org.orekit.time.AbsoluteDate)840 Test (org.junit.Test)632 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)321 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)283 SpacecraftState (org.orekit.propagation.SpacecraftState)279 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)204 PVCoordinates (org.orekit.utils.PVCoordinates)193 Orbit (org.orekit.orbits.Orbit)157 Frame (org.orekit.frames.Frame)152 OrekitException (org.orekit.errors.OrekitException)141 DateComponents (org.orekit.time.DateComponents)134 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)106 CartesianOrbit (org.orekit.orbits.CartesianOrbit)104 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)97 ArrayList (java.util.ArrayList)96 Propagator (org.orekit.propagation.Propagator)90 TimeScale (org.orekit.time.TimeScale)90 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)88 TimeComponents (org.orekit.time.TimeComponents)88 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)87