Search in sources :

Example 36 with TimeScale

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

the class OceanLoadingTest method testStableRates.

@Test
public void testStableRates() throws OrekitException {
    // this test checks that tides sort order is date-independent for a large time range
    // (almost 180000 years long)
    // tides sort-order is based on rate, but the rates varies slightly with dates
    // (because Delaunay nutation arguments are polynomials)
    // The variations are however small and we want to make sure
    // that if rate(tideA) < rate(tideB) at time t0, this order remains
    // the same for t1 a few millenia around t0
    final TimeScale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    final FundamentalNutationArguments fna = IERSConventions.IERS_2010.getNutationArguments(ut1);
    // initial sort at J2000.0
    final BodiesElements el2000 = fna.evaluateAll(AbsoluteDate.J2000_EPOCH);
    List<Tide> tides = getTides();
    Collections.sort(tides, (t1, t2) -> Double.compare(t1.getRate(el2000), t2.getRate(el2000)));
    for (double dt = -122000; dt < 54000; dt += 100) {
        final AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt * Constants.JULIAN_YEAR);
        final BodiesElements el = fna.evaluateAll(date);
        for (int i = 1; i < tides.size(); ++i) {
            final Tide t1 = tides.get(i - 1);
            final Tide t2 = tides.get(i);
            Assert.assertTrue(t1.getRate(el) < t2.getRate(el));
        }
    }
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) BodiesElements(org.orekit.data.BodiesElements) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 37 with TimeScale

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

the class OceanLoadingTest method doTestReykjavik.

private void doTestReykjavik(boolean patchEarthRotation, double tolerance) throws OrekitException {
    // the coordinates for Reykjavik are *known* to be wrong in this test file
    // these test data have been extracted from the HARDISP.F file in September 2017
    // and it seems longitude and latitude have been exchanged...
    // With the file coordinates, Reykjavik would be somewhere in the Indian Ocean, about 1800km East of Madagascar
    // The error has been reported to IERS conventions center.
    OceanLoadingCoefficientsBLQFactory factory = new OceanLoadingCoefficientsBLQFactory("^hardisp\\.blq$");
    OceanLoadingCoefficients coefficients = factory.getCoefficients("Reykjavik");
    Vector3D refPoint = earth.transform(coefficients.getSiteLocation());
    OceanLoading loading = new OceanLoading(earth, coefficients);
    TimeScale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    FundamentalNutationArguments fna = IERSConventions.IERS_2010.getNutationArguments(ut1);
    if (patchEarthRotation) {
        TideTest.patchEarthRotationModel(fna, ut1);
    }
    AbsoluteDate t0 = new AbsoluteDate("2009-06-25T01:10:45", ut1);
    double[][] ref = new double[][] { { -0.005940, -0.001245, -0.000278 }, { 0.013516, -0.001086, 0.003212 }, { 0.029599, -0.000353, 0.005483 }, { 0.038468, 0.000699, 0.005997 }, { 0.038098, 0.001721, 0.004690 }, { 0.028780, 0.002363, 0.001974 }, { 0.013016, 0.002371, -0.001369 }, { -0.005124, 0.001653, -0.004390 }, { -0.021047, 0.000310, -0.006225 }, { -0.030799, -0.001383, -0.006313 }, { -0.032056, -0.003048, -0.004549 }, { -0.024698, -0.004288, -0.001314 }, { -0.010814, -0.004794, 0.002623 }, { 0.005849, -0.004416, 0.006291 }, { 0.020857, -0.003208, 0.008766 }, { 0.030226, -0.001413, 0.009402 }, { 0.031437, 0.000594, 0.007996 }, { 0.024079, 0.002389, 0.004844 }, { 0.009945, 0.003606, 0.000663 }, { -0.007426, 0.004022, -0.003581 }, { -0.023652, 0.003601, -0.006911 }, { -0.034618, 0.002505, -0.008585 }, { -0.037515, 0.001044, -0.008270 }, { -0.031544, -0.000402, -0.006125 } };
    for (int i = 0; i < ref.length; ++i) {
        BodiesElements elements = fna.evaluateAll(t0.shiftedBy(i * 3600.0));
        final Vector3D d = loading.displacement(elements, earth.getBodyFrame(), refPoint);
        Assert.assertEquals(ref[i][0], Vector3D.dotProduct(d, coefficients.getSiteLocation().getZenith()), tolerance);
        Assert.assertEquals(ref[i][1], Vector3D.dotProduct(d, coefficients.getSiteLocation().getSouth()), tolerance);
        Assert.assertEquals(ref[i][2], Vector3D.dotProduct(d, coefficients.getSiteLocation().getWest()), tolerance);
    }
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) BodiesElements(org.orekit.data.BodiesElements) TimeScale(org.orekit.time.TimeScale) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 38 with TimeScale

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

the class TideTest method doTestTable.

private void doTestTable(final double[][] table) throws OrekitException {
    TimeScale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    FundamentalNutationArguments fna = IERSConventions.IERS_2010.getNutationArguments(ut1);
    BodiesElements elements = fna.evaluateAll(AbsoluteDate.J2000_EPOCH);
    for (double[] r : table) {
        int doodsonNumber = (int) r[1];
        int[] dooodsonMultipliers = new int[] { (int) r[2], (int) r[3], (int) r[4], (int) r[5], (int) r[6], (int) r[7] };
        int[] delaunayMultipliers = new int[] { (int) r[8], (int) r[9], (int) r[10], (int) r[11], (int) r[12] };
        final Tide tdN = new Tide(doodsonNumber);
        final Tide tdM = new Tide((int) r[2], (int) r[3], (int) r[4], (int) r[5], (int) r[6], (int) r[7]);
        Assert.assertEquals(r[0], FastMath.toDegrees(tdN.getRate(elements)) * 3600, 7.2e-5);
        Assert.assertEquals(doodsonNumber, tdM.getDoodsonNumber());
        Assert.assertArrayEquals(dooodsonMultipliers, tdN.getDoodsonMultipliers());
        Assert.assertArrayEquals(delaunayMultipliers, tdN.getDelaunayMultipliers());
        Assert.assertArrayEquals(delaunayMultipliers, tdM.getDelaunayMultipliers());
    }
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) BodiesElements(org.orekit.data.BodiesElements) TimeScale(org.orekit.time.TimeScale)

Example 39 with TimeScale

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

the class TideTest method doTestTDFRPH.

private void doTestTDFRPH(boolean patchEarthRotation, int year, int month, int day, int hour, int minute, double second, Tide tide, double refRate, double refPhase, double toleranceRate, double tolerancePhase) throws OrekitException {
    TimeScale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    FundamentalNutationArguments fna = IERSConventions.IERS_2010.getNutationArguments(ut1);
    if (patchEarthRotation) {
        patchEarthRotationModel(fna, ut1);
    }
    AbsoluteDate date = new AbsoluteDate(year, month, day, hour, minute, second, ut1);
    BodiesElements elements = fna.evaluateAll(date);
    Assert.assertEquals(refRate, tide.getRate(elements) * Constants.JULIAN_DAY / (2 * FastMath.PI), toleranceRate);
    Assert.assertEquals(refPhase, FastMath.toDegrees(MathUtils.normalizeAngle(tide.getPhase(elements), FastMath.PI)), tolerancePhase);
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) BodiesElements(org.orekit.data.BodiesElements) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate)

Example 40 with TimeScale

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

the class TideTest method testPhase.

@Test
public void testPhase() throws OrekitException {
    TimeScale ut1 = TimeScalesFactory.getUT1(IERSConventions.IERS_2010, true);
    FundamentalNutationArguments fna = IERSConventions.IERS_2010.getNutationArguments(ut1);
    BodiesElements elements = fna.evaluateAll(new AbsoluteDate("2003-05-17T13:41:54", TimeScalesFactory.getUTC()));
    Assert.assertEquals(-514.950946, Tide.M2.getPhase(elements), 1.0e-6);
    Assert.assertEquals(19.738518, Tide.S2.getPhase(elements), 1.0e-6);
    Assert.assertEquals(-798.252248, Tide.N2.getPhase(elements), 1.0e-6);
    Assert.assertEquals(59.352413, Tide.K2.getPhase(elements), 1.0e-6);
    Assert.assertEquals(29.676206, Tide.K1.getPhase(elements), 1.0e-6);
    Assert.assertEquals(-544.627152, Tide.O1.getPhase(elements), 1.0e-6);
    Assert.assertEquals(-9.937688, Tide.P1.getPhase(elements), 1.0e-6);
    Assert.assertEquals(-827.928455, Tide.Q1.getPhase(elements), 1.0e-6);
    Assert.assertEquals(574.303358, Tide.MF.getPhase(elements), 1.0e-6);
    Assert.assertEquals(283.301303, Tide.MM.getPhase(elements), 1.0e-6);
    Assert.assertEquals(39.613894, Tide.SSA.getPhase(elements), 1.0e-6);
}
Also used : FundamentalNutationArguments(org.orekit.data.FundamentalNutationArguments) BodiesElements(org.orekit.data.BodiesElements) TimeScale(org.orekit.time.TimeScale) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) 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