Search in sources :

Example 6 with UT1Scale

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

the class SolidTidesFieldTest method testDeltaCnmSnm.

@Test
public void testDeltaCnmSnm() throws OrekitException {
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(8, 8);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2003, 5, 6, 13, 43, 32.125, utc);
    SolidTidesField tidesField = new SolidTidesField(IERSConventions.IERS_2010.getLoveNumbers(), IERSConventions.IERS_2010.getTideFrequencyDependenceFunction(ut1), IERSConventions.IERS_2010.getPermanentTide(), null, FramesFactory.getITRF(IERSConventions.IERS_2010, true), gravityField.getAe(), gravityField.getMu(), TideSystem.TIDE_FREE, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    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 }, { -2.6732289327355114E-9, 4.9078992447259636E-9, 3.5894110538262888E-9, 0.0, 0.0 }, // { -2.6598001259383122E-9,   4.907899244804072E-9,   3.5894110542365972E-9,         0.0 ,                 0.0  },
    { -1.290639603871307E-11, -9.287425756410472E-14, 8.356574033404024E-12, -2.2644465207860626E-12, 0.0 }, { 7.888138856951149E-12, -1.4422209452877158E-11, -6.815519349970944E-12, 0.0, 0.0 } };
    double[][] refDeltaSnm = new double[][] { { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 1.599927449004677E-9, 2.1815888169727694E-9, 0.0, 0.0 }, { 0.0, -4.6129961143785774E-14, 1.8097527720906976E-11, 1.633889224766215E-11, 0.0 }, { 0.0, -4.897228975221076E-12, -4.1034042689652575E-12, 0.0, 0.0 } };
    for (int n = 0; n < refDeltaCnm.length; ++n) {
        double threshold = (n == 2) ? 1.3e-17 : 1.0e-24;
        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) NormalizedSphericalHarmonics(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider.NormalizedSphericalHarmonics) 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)

Example 7 with UT1Scale

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

the class SolidTidesFieldTest method testConventions2010.

@Test
public void testConventions2010() throws OrekitException, NoSuchFieldException, IllegalAccessException {
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    SolidTidesField tidesField = new SolidTidesField(IERSConventions.IERS_2010.getLoveNumbers(), IERSConventions.IERS_2010.getTideFrequencyDependenceFunction(ut1), IERSConventions.IERS_2010.getPermanentTide(), IERSConventions.IERS_2010.getSolidPoleTide(ut1.getEOPHistory()), FramesFactory.getITRF(IERSConventions.IERS_2010, false), Constants.WGS84_EARTH_EQUATORIAL_RADIUS, Constants.WGS84_EARTH_MU, TideSystem.ZERO_TIDE, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    Field fieldReal = tidesField.getClass().getDeclaredField("love");
    fieldReal.setAccessible(true);
    LoveNumbers love = (LoveNumbers) fieldReal.get(tidesField);
    Assert.assertEquals(-0.00000, love.getImaginary(2, 0), 1.0e-10);
    Assert.assertEquals(-0.00144, love.getImaginary(2, 1), 1.0e-10);
    Assert.assertEquals(-0.00130, love.getImaginary(2, 2), 1.0e-10);
    Assert.assertEquals(0.0, love.getImaginary(3, 0), 1.0e-10);
    Assert.assertEquals(0.0, love.getImaginary(3, 1), 1.0e-10);
    Assert.assertEquals(0.0, love.getImaginary(3, 2), 1.0e-10);
    Assert.assertEquals(0.0, love.getImaginary(3, 3), 1.0e-10);
    Assert.assertEquals(-0.00089, love.getPlus(2, 0), 1.0e-10);
    Assert.assertEquals(-0.00080, love.getPlus(2, 1), 1.0e-10);
    Assert.assertEquals(-0.00057, love.getPlus(2, 2), 1.0e-10);
    Assert.assertEquals(0.0, love.getPlus(3, 0), 1.0e-10);
    Assert.assertEquals(0.0, love.getPlus(3, 1), 1.0e-10);
    Assert.assertEquals(0.0, love.getPlus(3, 2), 1.0e-10);
    Assert.assertEquals(0.0, love.getPlus(3, 3), 1.0e-10);
}
Also used : Field(java.lang.reflect.Field) LoveNumbers(org.orekit.utils.LoveNumbers) UT1Scale(org.orekit.time.UT1Scale) Test(org.junit.Test)

Example 8 with UT1Scale

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

the class SolidTidesFieldTest method testK1Example.

@Test
public void testK1Example() throws OrekitException, NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    // the reference for this test is the example at the bottom of page 86, IERS conventions 2010 section 6.2.1
    final PoissonSeriesParser k21Parser = new PoissonSeriesParser(18).withOptionalColumn(1).withDoodson(4, 3).withFirstDelaunay(10);
    final String name = "/tides/tab6.5a-only-K1.txt";
    final double pico = 1.0e-12;
    final PoissonSeries c21Series = k21Parser.withSinCos(0, 17, pico, 18, pico).parse(getClass().getResourceAsStream(name), name);
    final PoissonSeries s21Series = k21Parser.withSinCos(0, 18, -pico, 17, pico).parse(getClass().getResourceAsStream(name), name);
    final UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, false);
    final TimeScalarFunction gmstFunction = IERSConventions.IERS_2010.getGMSTFunction(ut1);
    Method getNA = IERSConventions.class.getDeclaredMethod("getNutationArguments", TimeScale.class);
    getNA.setAccessible(true);
    final FundamentalNutationArguments arguments = (FundamentalNutationArguments) getNA.invoke(IERSConventions.IERS_2010, ut1);
    TimeVectorFunction deltaCSFunction = new TimeVectorFunction() {

        public double[] value(final AbsoluteDate date) {
            final BodiesElements elements = arguments.evaluateAll(date);
            return new double[] { 0.0, c21Series.value(elements), s21Series.value(elements), 0.0, 0.0 };
        }

        public <T extends RealFieldElement<T>> T[] value(final FieldAbsoluteDate<T> date) {
            // never called in this test
            throw new OrekitInternalError(null);
        }
    };
    SolidTidesField tf = new SolidTidesField(IERSConventions.IERS_2010.getLoveNumbers(), deltaCSFunction, IERSConventions.IERS_2010.getPermanentTide(), IERSConventions.IERS_2010.getSolidPoleTide(ut1.getEOPHistory()), FramesFactory.getITRF(IERSConventions.IERS_2010, false), Constants.EIGEN5C_EARTH_EQUATORIAL_RADIUS, Constants.EIGEN5C_EARTH_MU, TideSystem.ZERO_TIDE, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    Method frequencyDependentPart = SolidTidesField.class.getDeclaredMethod("frequencyDependentPart", AbsoluteDate.class, double[][].class, double[][].class);
    frequencyDependentPart.setAccessible(true);
    double[][] cachedCNM = new double[5][5];
    double[][] cachedSNM = new double[5][5];
    AbsoluteDate t0 = new AbsoluteDate(2003, 5, 6, 13, 43, 32.125, TimeScalesFactory.getUTC());
    for (double dt = 0; dt < Constants.JULIAN_DAY; dt += 300) {
        AbsoluteDate date = t0.shiftedBy(dt);
        for (int i = 0; i < cachedCNM.length; ++i) {
            Arrays.fill(cachedCNM[i], 0.0);
            Arrays.fill(cachedSNM[i], 0.0);
        }
        frequencyDependentPart.invoke(tf, date, cachedCNM, cachedSNM);
        double thetaPlusPi = gmstFunction.value(date) + FastMath.PI;
        Assert.assertEquals(470.9e-12 * FastMath.sin(thetaPlusPi) - 30.2e-12 * FastMath.cos(thetaPlusPi), cachedCNM[2][1], 2.0e-25);
        Assert.assertEquals(470.9e-12 * FastMath.cos(thetaPlusPi) + 30.2e-12 * FastMath.sin(thetaPlusPi), cachedSNM[2][1], 2.0e-25);
    }
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) OrekitInternalError(org.orekit.errors.OrekitInternalError) RealFieldElement(org.hipparchus.RealFieldElement) Method(java.lang.reflect.Method) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) TimeVectorFunction(org.orekit.time.TimeVectorFunction) UT1Scale(org.orekit.time.UT1Scale) BodiesElements(org.orekit.data.BodiesElements) PoissonSeries(org.orekit.data.PoissonSeries) PoissonSeriesParser(org.orekit.data.PoissonSeriesParser) TimeScalarFunction(org.orekit.time.TimeScalarFunction) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) Test(org.junit.Test)

Example 9 with UT1Scale

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

the class SolidTidesTest method testStateJacobianVs80ImplementationNoPoleTide.

@Test
public void testStateJacobianVs80ImplementationNoPoleTide() throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2964, 8, 12, 11, 30, 00.000, 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);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    ForceModel forceModel = new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, IERSConventions.IERS_2010, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    Assert.assertTrue(forceModel.dependsOnPositionOnly());
    checkStateJacobianVs80Implementation(new SpacecraftState(orbit), forceModel, new LofOffset(orbit.getFrame(), LOFType.VVLH), 2.0e-15, false);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) UT1Scale(org.orekit.time.UT1Scale) ForceModel(org.orekit.forces.ForceModel) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) NormalizedSphericalHarmonicsProvider(org.orekit.forces.gravity.potential.NormalizedSphericalHarmonicsProvider) TimeScale(org.orekit.time.TimeScale) LofOffset(org.orekit.attitudes.LofOffset) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) AbstractLegacyForceModelTest(org.orekit.forces.AbstractLegacyForceModelTest) Test(org.junit.Test)

Example 10 with UT1Scale

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

the class SolidTidesTest method testStateJacobianVsFiniteDifferencesNoPoleTide.

@Test
public void testStateJacobianVsFiniteDifferencesNoPoleTide() throws OrekitException {
    Frame eme2000 = FramesFactory.getEME2000();
    TimeScale utc = TimeScalesFactory.getUTC();
    AbsoluteDate date = new AbsoluteDate(2964, 8, 12, 11, 30, 00.000, 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);
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    UT1Scale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    NormalizedSphericalHarmonicsProvider gravityField = GravityFieldFactory.getConstantNormalizedProvider(5, 5);
    ForceModel forceModel = new SolidTides(itrf, gravityField.getAe(), gravityField.getMu(), gravityField.getTideSystem(), false, SolidTides.DEFAULT_STEP, SolidTides.DEFAULT_POINTS, IERSConventions.IERS_2010, ut1, CelestialBodyFactory.getSun(), CelestialBodyFactory.getMoon());
    checkStateJacobianVsFiniteDifferences(new SpacecraftState(orbit), forceModel, Propagator.DEFAULT_LAW, 10.0, 2.0e-10, false);
}
Also used : FieldSpacecraftState(org.orekit.propagation.FieldSpacecraftState) SpacecraftState(org.orekit.propagation.SpacecraftState) Frame(org.orekit.frames.Frame) Orbit(org.orekit.orbits.Orbit) FieldCartesianOrbit(org.orekit.orbits.FieldCartesianOrbit) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) UT1Scale(org.orekit.time.UT1Scale) ForceModel(org.orekit.forces.ForceModel) 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)

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