Search in sources :

Example 71 with TimeScale

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

the class TDMParserTest method validateTDMExample8.

/**
 * Validation function for example 8.
 * @param file Parsed TDMFile to validate
 * @throws OrekitException if UTC time scale cannot be retrieved
 */
public static void validateTDMExample8(TDMFile file) throws OrekitException {
    final TimeScale utc = TimeScalesFactory.getUTC();
    // Header
    Assert.assertEquals(1.0, file.getFormatVersion(), 0.0);
    Assert.assertEquals(new AbsoluteDate("2007-08-30T12:01:44.749", utc).durationFrom(file.getCreationDate()), 0.0, 0.0);
    Assert.assertEquals("GSOC", file.getOriginator());
    final List<String> headerComment = new ArrayList<String>();
    headerComment.add("GEOSCX_INP");
    Assert.assertEquals(headerComment, file.getHeaderComment());
    // Meta-Data 1
    final TDMFile.TDMMetaData metaData = file.getObservationsBlocks().get(0).getMetaData();
    Assert.assertEquals(CcsdsTimeScale.UTC, metaData.getTimeSystem());
    Assert.assertEquals(new AbsoluteDate("2007-08-29T07:00:02.000", utc).durationFrom(metaData.getStartTime()), 0.0, 0.0);
    Assert.assertEquals(new AbsoluteDate("2007-08-29T14:00:02.000", utc).durationFrom(metaData.getStopTime()), 0.0, 0.0);
    Assert.assertEquals("HBSTK", metaData.getParticipants().get(1));
    Assert.assertEquals("SAT", metaData.getParticipants().get(2));
    Assert.assertEquals("SEQUENTIAL", metaData.getMode());
    Assert.assertEquals("1,2,1", metaData.getPath());
    Assert.assertEquals(1.0, metaData.getIntegrationInterval(), 0.0);
    Assert.assertEquals("END", metaData.getIntegrationRef());
    Assert.assertEquals("XSYE", metaData.getAngleType());
    Assert.assertEquals("RAW", metaData.getDataQuality());
    final List<String> metaDataComment = new ArrayList<String>();
    metaDataComment.add("This is a meta-data comment");
    Assert.assertEquals(metaDataComment, metaData.getComment());
    // Data 1
    final List<TDMFile.Observation> observations = file.getObservationsBlocks().get(0).getObservations();
    // Reference data 1
    final String[] keywords = { "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2", "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2", "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2" };
    final String[] epochs = { "2007-08-29T07:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T08:00:02.000", "2007-08-29T08:00:02.000", "2007-08-29T08:00:02.000", "2007-08-29T14:00:02.000", "2007-08-29T14:00:02.000", "2007-08-29T14:00:02.000" };
    final double[] values = { -1.498776048, 67.01312389, 18.28395556, -2.201305217, 67.01982278, 21.19609167, 0.929545817, -89.35626083, 2.78791667 };
    // Check consistency
    for (int i = 0; i < keywords.length; i++) {
        Assert.assertEquals(keywords[i], observations.get(i).getKeyword());
        Assert.assertEquals(new AbsoluteDate(epochs[i], utc).durationFrom(observations.get(i).getEpoch()), 0.0, 0.0);
        Assert.assertEquals(values[i], observations.get(i).getMeasurement(), 0.0);
    }
    // Comment
    final List<String> dataComment = new ArrayList<String>();
    dataComment.add("This is a data comment");
    Assert.assertEquals(dataComment, file.getObservationsBlocks().get(0).getObservationsComment());
    // Meta-Data 2
    final TDMFile.TDMMetaData metaData2 = file.getObservationsBlocks().get(1).getMetaData();
    Assert.assertEquals(CcsdsTimeScale.UTC, metaData2.getTimeSystem());
    Assert.assertEquals("2007-08-29T06:00:02.000", metaData2.getStartTimeString());
    Assert.assertEquals(new AbsoluteDate("2007-08-29T06:00:02.000", utc).durationFrom(metaData2.getStartTime()), 0.0, 0.0);
    Assert.assertEquals("2007-08-29T13:00:02.000", metaData2.getStopTimeString());
    Assert.assertEquals(new AbsoluteDate("2007-08-29T13:00:02.000", utc).durationFrom(metaData2.getStopTime()), 0.0, 0.0);
    Assert.assertEquals("WHM1", metaData2.getParticipants().get(1));
    Assert.assertEquals("SAT", metaData2.getParticipants().get(2));
    Assert.assertEquals("SEQUENTIAL", metaData2.getMode());
    Assert.assertEquals("1,2,1", metaData2.getPath());
    Assert.assertEquals(1.0, metaData2.getIntegrationInterval(), 0.0);
    Assert.assertEquals("END", metaData2.getIntegrationRef());
    Assert.assertEquals("AZEL", metaData2.getAngleType());
    Assert.assertEquals("RAW", metaData2.getDataQuality());
    final List<String> metaDataComment2 = new ArrayList<String>();
    metaDataComment2.add("This is a meta-data comment");
    Assert.assertEquals(metaDataComment2, metaData2.getComment());
    // Data 2
    final List<TDMFile.Observation> observations2 = file.getObservationsBlocks().get(1).getObservations();
    // Reference data 2
    final String[] keywords2 = { "RANGE", "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2", "RANGE", "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2", "RANGE", "DOPPLER_INTEGRATED", "ANGLE_1", "ANGLE_2" };
    final String[] epochs2 = { "2007-08-29T06:00:02.000", "2007-08-29T06:00:02.000", "2007-08-29T06:00:02.000", "2007-08-29T06:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T07:00:02.000", "2007-08-29T13:00:02.000", "2007-08-29T13:00:02.000", "2007-08-29T13:00:02.000", "2007-08-29T13:00:02.000" };
    final double[] values2 = { 4.00165248953670E+04, -0.885640091, 99.53204250, 1.26724167, 3.57238793591890E+04, -1.510223139, 103.33061750, 4.77875278, 3.48156855860090E+04, 1.504082291, 243.73365222, 8.78254167 };
    // Check consistency
    for (int i = 0; i < keywords2.length; i++) {
        Assert.assertEquals(keywords2[i], observations2.get(i).getKeyword());
        Assert.assertEquals(new AbsoluteDate(epochs2[i], utc).durationFrom(observations2.get(i).getEpoch()), 0.0, 0.0);
        Assert.assertEquals(values2[i], observations2.get(i).getMeasurement(), 0.0);
    }
    // Comment
    final List<String> dataComment2 = new ArrayList<String>();
    dataComment2.add("This is a data comment");
    Assert.assertEquals(dataComment2, file.getObservationsBlocks().get(1).getObservationsComment());
}
Also used : ArrayList(java.util.ArrayList) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 72 with TimeScale

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

the class OceanTidesTest method doTestTideEffect.

private void doTestTideEffect(IERSConventions conventions, double delta1, double delta2) throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    AstronomicalAmplitudeReader aaReader = new AstronomicalAmplitudeReader("hf-fes2004.dat", 5, 2, 3, 1.0);
    DataProvidersManager.getInstance().feed(aaReader.getSupportedNames(), aaReader);
    Map<Integer, Double> map = aaReader.getAstronomicalAmplitudesMap();
    GravityFieldFactory.addOceanTidesReader(new FESCHatEpsilonReader("fes2004-7x7.dat", 0.01, FastMath.toRadians(1.0), OceanLoadDeformationCoefficients.IERS_2010, map));
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(2003, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState noTides = propagate(orbit, target, hf);
    SpacecraftState oceanTidesNoPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    SpacecraftState oceanTidesPoleTide = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), true, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, 6, 6, conventions, ut1));
    Assert.assertEquals(delta1, Vector3D.distance(noTides.getPVCoordinates().getPosition(), oceanTidesNoPoleTide.getPVCoordinates().getPosition()), 0.01);
    Assert.assertEquals(delta2, Vector3D.distance(oceanTidesNoPoleTide.getPVCoordinates().getPosition(), oceanTidesPoleTide.getPVCoordinates().getPosition()), 0.01);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) SpacecraftState(org.orekit.propagation.SpacecraftState) UT1Scale(org.orekit.time.UT1Scale) FESCHatEpsilonReader(org.orekit.forces.gravity.potential.FESCHatEpsilonReader) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) AstronomicalAmplitudeReader(org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)

Example 73 with TimeScale

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

the class OceanTidesFieldTest method testDeltaCnmSnm.

@Test
public void testDeltaCnmSnm() throws OrekitException {
    // this is an arbitrarily truncated model, limited to 4x4 and with only a few waves
    List<OceanTidesWave> waves = getWaves(4, 4, 55565, 56554, 85455, 135655, 273555);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2003, 5, 6, 13, 43, 32.125, utc);
    OceanTidesField tidesField = new OceanTidesField(Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, waves, IERSConventions.IERS_2010.getNutationArguments(ut1), null);
    NormalizedSphericalHarmonics harmonics = tidesField.onDate(date);
    double[][] refDeltaCnm = new double[][] { { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 }, { -4.812565797928061E-11, -4.1748378190052583E-11, 7.013273986245356E-11, 0.0, 0.0 }, { -2.5341227608443308E-11, 9.76515813742254E-11, -1.21931214469994E-10, 1.3179722429471184E-10, 0.0 }, { -2.7496974839179478E-11, 8.419627031293907E-11, 6.56546217101275E-11, -3.375298928713117E-11, -7.588006744166988E-11 } };
    double[][] refDeltaSnm = new double[][] { { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 }, { -1.168129177701461E-10, 5.646187590518608E-12, 1.742233297668071E-10, 0.0, 0.0 }, { -6.586546350227345E-11, -8.032186864783105E-11, -3.118910148495339E-11, 1.0566857199592183E-10, 0.0 }, { 7.665313525684617E-11, 7.37884528812169E-11, -1.3085142873419844E-10, -1.5813709543115768E-10, 1.770903634801541E-10 } };
    for (int n = 0; n < refDeltaCnm.length; ++n) {
        double threshold = 4.0e-17;
        for (int m = 0; m <= n; ++m) {
            Assert.assertEquals(refDeltaCnm[n][m], harmonics.getNormalizedCnm(n, m), threshold);
            Assert.assertEquals(refDeltaSnm[n][m], harmonics.getNormalizedSnm(n, m), threshold);
        }
    }
}
Also used : UT1Scale(org.orekit.time.UT1Scale) OceanTidesWave(org.orekit.forces.gravity.potential.OceanTidesWave) NormalizedSphericalHarmonics(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 74 with TimeScale

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

the class SolidTidesTest method testDefaultInterpolation.

@Test
public void testDefaultInterpolation() throws OrekitException {
    IERSConventions conventions = IERSConventions.IERS_2010;
    Frame eme2000 = FramesFactory.getEME2000();
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    // initialization
    AbsoluteDate date = new AbsoluteDate(1970, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, gravityField.getMu());
    AbsoluteDate target = date.shiftedBy(7 * Constants.JULIAN_DAY);
    ForceModel hf = new HolmesFeatherstoneAttractionModel(itrf, gravityField);
    SpacecraftState raw = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), true, Double.NaN, -1, conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    SpacecraftState interpolated = propagate(orbit, target, hf, new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), conventions, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon()));
    Assert.assertEquals(0.0, Vector3D.distance(raw.getPVCoordinates().getPosition(), interpolated.getPVCoordinates().getPosition()), // threshold would be 1.2e-3 for 30 days propagation
    2.0e-5);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) UT1Scale(org.orekit.time.UT1Scale) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) IERSConventions(org.orekit.utils.IERSConventions) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 75 with TimeScale

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

the class SolidTidesTest method testTideEffect2003AfterAnnualPoleRange.

@Test
public void testTideEffect2003AfterAnnualPoleRange() throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2003, 07, 01, 13, 59, 27.816, utc);
    Orbit orbit = new KeplerianOrbit(7201009.7124401, 1e-3, FastMath.toRadians(98.7), FastMath.toRadians(93.0), FastMath.toRadians(15.0 * 22.5), 0, PositionAngle.MEAN, eme2000, date, Constants.EIGEN5C_EARTH_MU);
    doTestTideEffect(orbit, IERSConventions.IERS_2003, 44.24999, 0.61752);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Aggregations

TimeScale (org.orekit.time.TimeScale)116 AbsoluteDate (org.orekit.time.AbsoluteDate)89 Test (org.junit.Test)75 Frame (org.orekit.frames.Frame)44 Orbit (org.orekit.orbits.Orbit)38 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)38 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)35 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)32 SpacecraftState (org.orekit.propagation.SpacecraftState)30 PVCoordinates (org.orekit.utils.PVCoordinates)28 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)25 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)17 OrekitException (org.orekit.errors.OrekitException)17 Propagator (org.orekit.propagation.Propagator)17 EcksteinHechlerPropagator (org.orekit.propagation.analytical.EcksteinHechlerPropagator)15 BodiesElements (org.orekit.data.BodiesElements)14 FundamentalNutationArguments (org.orekit.data.FundamentalNutationArguments)14 CartesianOrbit (org.orekit.orbits.CartesianOrbit)14 FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)14 KeplerianPropagator (org.orekit.propagation.analytical.KeplerianPropagator)13