Search in sources :

Example 1 with UT1Scale

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

the class OceanTidesTest 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);
    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(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 OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), true, Double.NaN, -1, 6, 6, conventions, ut1));
    SpacecraftState interpolated = propagate(orbit, target, hf, new OceanTides(itrf, gravityField.getAe(), gravityField.getMu(), 6, 6, IERSConventions.IERS_2010, ut1));
    Assert.assertEquals(0.0, Vector3D.distance(raw.getPVCoordinates().getPosition(), interpolated.getPVCoordinates().getPosition()), // threshold would be 3.4e-5 for 30 days propagation
    9.9e-6);
}
Also used : Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) ForceModel(org.orekit.forces.ForceModel) IERSConventions(org.orekit.utils.IERSConventions) 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) Test(org.junit.Test)

Example 2 with UT1Scale

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

the class IERSConventionsTest method testFieldGMSTRate2010.

@Test
public void testFieldGMSTRate2010() throws OrekitException {
    final UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    checkFieldGMSTRate(IERSConventions.IERS_2010.getGMSTFunction(ut1), IERSConventions.IERS_2010.getGMSTRateFunction(ut1), AbsoluteDate.J2000_EPOCH.shiftedBy(-0.4 * Constants.JULIAN_DAY), 0.8 * Constants.JULIAN_DAY, 600.0, 10.0, Double.MIN_VALUE);
}
Also used : UT1Scale(org.orekit.time.UT1Scale) Test(org.junit.Test)

Example 3 with UT1Scale

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

the class IERSConventionsTest method testFieldGMSTRate1996.

@Test
public void testFieldGMSTRate1996() throws OrekitException {
    final UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_1996, true);
    checkFieldGMSTRate(IERSConventions.IERS_1996.getGMSTFunction(ut1), IERSConventions.IERS_1996.getGMSTRateFunction(ut1), AbsoluteDate.J2000_EPOCH.shiftedBy(-0.4 * Constants.JULIAN_DAY), 0.8 * Constants.JULIAN_DAY, 600.0, 10.0, Double.MIN_VALUE);
}
Also used : UT1Scale(org.orekit.time.UT1Scale) Test(org.junit.Test)

Example 4 with UT1Scale

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

the class IERSConventionsTest method testFieldGMSTRate2003.

@Test
public void testFieldGMSTRate2003() throws OrekitException {
    final UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2003, true);
    checkFieldGMSTRate(IERSConventions.IERS_2003.getGMSTFunction(ut1), IERSConventions.IERS_2003.getGMSTRateFunction(ut1), AbsoluteDate.J2000_EPOCH.shiftedBy(-0.4 * Constants.JULIAN_DAY), 0.8 * Constants.JULIAN_DAY, 600.0, 10.0, Double.MIN_VALUE);
}
Also used : UT1Scale(org.orekit.time.UT1Scale) Test(org.junit.Test)

Example 5 with UT1Scale

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

the class SolidTidesFieldTest method testInterpolationAccuracy.

@Test
public void testInterpolationAccuracy() throws OrekitException {
    // The shortest periods are slightly below one half day for the tidal waves
    // considered here. This implies the sampling rate should be fast enough.
    // The tuning parameters we have finally settled correspond to a two hours
    // sample containing 12 points (i.e. one new point is computed every 10 minutes).
    // The observed relative interpolation error with these settings are essentially
    // due to Runge phenomenon at points sampling rate. Plotting the errors shows
    // singular peaks pointing out of merely numerical noise.
    final IERSConventions conventions = IERSConventions.IERS_2010;
    Frame itrf = FramesFactory.getITRF(conventions, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    UT1Scale ut1 = TimeScalesFactory.getUT1(conventions, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    SolidTidesField raw = new SolidTidesField(conventions.getLoveNumbers(), conventions.getTideFrequencyDependenceFunction(ut1), conventions.getPermanentTide(), conventions.getSolidPoleTide(ut1.getEOPHistory()), itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    int step = 600;
    int nbPoints = 12;
    CachedNormalizedSphericalHarmonicsProvider interpolated = new CachedNormalizedSphericalHarmonicsProvider(raw, step, nbPoints, OrekitConfiguration.getCacheSlotsNumber(), 7 * Constants.JULIAN_DAY, 0.5 * Constants.JULIAN_DAY);
    // the following time range is located around the maximal observed error
    AbsoluteDate start = new AbsoluteDate(2003, 6, 12, utc);
    AbsoluteDate end = start.shiftedBy(3 * Constants.JULIAN_DAY);
    StreamingStatistics stat = new StreamingStatistics();
    for (AbsoluteDate date = start; date.compareTo(end) < 0; date = date.shiftedBy(60)) {
        NormalizedSphericalHarmonics rawHarmonics = raw.onDate(date);
        NormalizedSphericalHarmonics interpolatedHarmonics = interpolated.onDate(date);
        for (int n = 2; n < 5; ++n) {
            for (int m = 0; m <= n; ++m) {
                if (n < 4 || m < 3) {
                    double cnmRaw = rawHarmonics.getNormalizedCnm(n, m);
                    double cnmInterp = interpolatedHarmonics.getNormalizedCnm(n, m);
                    double errorC = (cnmInterp - cnmRaw) / FastMath.abs(cnmRaw);
                    stat.addValue(errorC);
                    if (m > 0) {
                        double snmRaw = rawHarmonics.getNormalizedSnm(n, m);
                        double snmInterp = interpolatedHarmonics.getNormalizedSnm(n, m);
                        double errorS = (snmInterp - snmRaw) / FastMath.abs(snmRaw);
                        stat.addValue(errorS);
                    }
                }
            }
        }
    }
    Assert.assertEquals(0.0, stat.getMean(), 2.0e-12);
    Assert.assertTrue(stat.getStandardDeviation() < 2.0e-9);
    Assert.assertTrue(stat.getMin() > -9.0e-8);
    Assert.assertTrue(stat.getMax() < 2.2e-7);
}
Also used : Frame(org.orekit.frames.Frame) UT1Scale(org.orekit.time.UT1Scale) StreamingStatistics(org.hipparchus.stat.descriptive.StreamingStatistics) IERSConventions(org.orekit.utils.IERSConventions) NormalizedSphericalHarmonics(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics) CachedNormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.CachedNormalizedSphericalHarmonicsProvider) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) CachedNormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.CachedNormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

UT1Scale (org.orekit.time.UT1Scale)26 Test (org.junit.Test)24 AbsoluteDate (org.orekit.time.AbsoluteDate)14 TimeScale (org.orekit.time.TimeScale)12 NormalizedSphericalHarmonicsProvider (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider)10 Frame (org.orekit.frames.Frame)9 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 ForceModel (org.orekit.forces.ForceModel)8 SpacecraftState (org.orekit.propagation.SpacecraftState)8 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)7 Orbit (org.orekit.orbits.Orbit)7 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)6 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)5 FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)5 NormalizedSphericalHarmonics (org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics)3 IERSConventions (org.orekit.utils.IERSConventions)3 Field (java.lang.reflect.Field)2 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)2 LofOffset (org.orekit.attitudes.LofOffset)2 AstronomicalAmplitudeReader (org.orekit.forces.gravity.potential.AstronomicalAmplitudeReader)2