Search in sources :

Example 1 with TTScale

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

the class ITRFEquinoxProviderTest method testSofaCookbook.

@Test
public void testSofaCookbook() throws OrekitException {
    // SOFA cookbook test case:
    // date       2007 April 05, 12h00m00s.0 UTC
    // xp         +0′′.0349282
    // yp         +0′′.4833163
    // UT1 − UTC  -0s.072073685
    // dψ 1980    -0′′.0550655
    // dε 1980    -0′′.0063580
    // dX 2000    +0′′.0001725
    // dY 2000    -0′′.0002650
    // dX 2006    +0′′.0001750
    // dY 2006    -0′′.0002259
    Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, ITRFVersion.ITRF_2008, new double[][] { { 54192, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54193, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54194, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54195, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54196, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54197, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54198, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN }, { 54199, -0.072073685, 1.4020, 0.0349282, 0.4833163, -0.0550666, -0.0063580, Double.NaN, Double.NaN } }));
    EOPHistory eopHistory = FramesFactory.getEOPHistory(IERSConventions.IERS_1996, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    TTScale tt = TimeScalesFactory.getTT();
    UT1Scale ut1 = TimeScalesFactory.getUT1(eopHistory);
    Frame gcrf = FramesFactory.getGCRF();
    Frame itrf = FramesFactory.getITRFEquinox(IERSConventions.IERS_1996, true);
    Frame gtod = itrf.getParent();
    Frame tod = gtod.getParent();
    // time scales checks
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2007, 4, 5), TimeComponents.H12, utc);
    Assert.assertEquals(0.50075444444444, date.getComponents(tt).getTime().getSecondsInUTCDay() / Constants.JULIAN_DAY, 5.0e-15);
    Assert.assertEquals(0.499999165813831, date.getComponents(ut1).getTime().getSecondsInUTCDay() / Constants.JULIAN_DAY, 1.0e-15);
    // sidereal time check
    double gast = IERSConventions.IERS_1996.getGASTFunction(ut1, eopHistory).value(date);
    Assert.assertEquals(13.412402380740 * 3600 * 1.0e6, radToMicroAS(MathUtils.normalizeAngle(gast, 0)), 25);
    // nutation/precession/bias matrix check
    Rotation refNPB = new Rotation(new double[][] { { +0.999998403176203, -0.001639032970562, -0.000712190961847 }, { +0.001639000942243, +0.999998655799521, -0.000045552846624 }, { +0.000712264667137, +0.000044385492226, +0.999999745354454 } }, 1.0e-13);
    Rotation npb = gcrf.getTransformTo(tod, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refNPB, npb)), 27.0);
    // celestial to terrestrial frames matrix, without polar motion
    Rotation refWithoutPolarMotion = new Rotation(new double[][] { { +0.973104317592265, +0.230363826166883, -0.000703332813776 }, { -0.230363798723533, +0.973104570754697, +0.000120888299841 }, { +0.000712264667137, +0.000044385492226, +0.999999745354454 } }, 1.0e-13);
    Rotation withoutPM = gcrf.getTransformTo(gtod, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refWithoutPolarMotion, withoutPM)), 9);
    // celestial to terrestrial frames matrix, with polar motion
    Rotation refWithPolarMotion = new Rotation(new double[][] { { +0.973104317712772, +0.230363826174782, -0.000703163477127 }, { -0.230363800391868, +0.973104570648022, +0.000118545116892 }, { +0.000711560100206, +0.000046626645796, +0.999999745754058 } }, 1.0e-13);
    Rotation withPM = gcrf.getTransformTo(itrf, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refWithPolarMotion, withPM)), 10);
}
Also used : UT1Scale(org.orekit.time.UT1Scale) TTScale(org.orekit.time.TTScale) DateComponents(org.orekit.time.DateComponents) TimeScale(org.orekit.time.TimeScale) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with TTScale

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

the class ITRFProviderTest method testSofaCookbook.

@Test
public void testSofaCookbook() throws OrekitException {
    // SOFA cookbook test case:
    // date       2007 April 05, 12h00m00s.0 UTC
    // xp         +0′′.0349282
    // yp         +0′′.4833163
    // UT1 − UTC  -0s.072073685
    // dψ 1980    -0′′.0550655
    // dε 1980    -0′′.0063580
    // dX 2000    +0′′.0001725
    // dY 2000    -0′′.0002650
    // dX 2006    +0′′.0001750
    // dY 2006    -0′′.0002259
    Utils.setLoaders(IERSConventions.IERS_2010, Utils.buildEOPList(IERSConventions.IERS_2010, ITRFVersion.ITRF_2008, new double[][] { { 54192, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54193, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54194, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54195, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54196, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54197, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54198, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 }, { 54199, -0.072073685, 1.4020, 0.0349282, 0.4833163, -Double.NaN, Double.NaN, 0.0001750, -0.0002259 } }));
    EOPHistory eopHistory = FramesFactory.getEOPHistory(IERSConventions.IERS_2010, true);
    TimeScale utc = TimeScalesFactory.getUTC();
    TTScale tt = TimeScalesFactory.getTT();
    UT1Scale ut1 = TimeScalesFactory.getUT1(eopHistory);
    Frame gcrf = FramesFactory.getGCRF();
    Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    Frame gtod = itrf.getParent();
    Frame tod = gtod.getParent();
    // time scales checks
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2007, 4, 5), TimeComponents.H12, utc);
    Assert.assertEquals(0.50075444444444, date.getComponents(tt).getTime().getSecondsInUTCDay() / Constants.JULIAN_DAY, 5.0e-15);
    Assert.assertEquals(0.499999165813831, date.getComponents(ut1).getTime().getSecondsInUTCDay() / Constants.JULIAN_DAY, 1.0e-15);
    // sidereal time check
    double era = IERSConventions.IERS_2010.getEarthOrientationAngleFunction(ut1).value(date);
    Assert.assertEquals(13.318492966097 * 3600 * 1.0e6, radToMicroAS(MathUtils.normalizeAngle(era, 0)), 0.0022);
    // nutation/precession/bias matrix check
    Rotation refNPB = new Rotation(new double[][] { { +0.999999746339445, -0.000000005138721, -0.000712264730182 }, { -0.000000026475329, +0.999999999014975, -0.000044385242666 }, { +0.000712264729708, +0.000044385250265, +0.999999745354420 } }, 1.0e-13);
    Rotation npb = gcrf.getTransformTo(tod, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refNPB, npb)), 0.31);
    // celestial to terrestrial frames matrix, without polar motion
    Rotation refWithoutPolarMotion = new Rotation(new double[][] { { +0.973104317573104, +0.230363826247808, -0.000703332818915 }, { -0.230363798804281, +0.973104570735550, +0.000120888549767 }, { +0.000712264729708, +0.000044385250265, +0.999999745354420 } }, 1.0e-13);
    Rotation withoutPM = gcrf.getTransformTo(gtod, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refWithoutPolarMotion, withoutPM)), 0.31);
    // celestial to terrestrial frames matrix, with polar motion
    Rotation refWithPolarMotion = new Rotation(new double[][] { { +0.973104317697512, +0.230363826239227, -0.000703163482268 }, { -0.230363800456136, +0.973104570632777, +0.000118545366806 }, { +0.000711560162777, +0.000046626403835, +0.999999745754024 } }, 1.0e-13);
    Rotation withPM = gcrf.getTransformTo(itrf, date).getRotation();
    Assert.assertEquals(0.0, radToMicroAS(Rotation.distance(refWithPolarMotion, withPM)), 0.31);
}
Also used : UT1Scale(org.orekit.time.UT1Scale) TTScale(org.orekit.time.TTScale) DateComponents(org.orekit.time.DateComponents) TimeScale(org.orekit.time.TimeScale) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)2 Test (org.junit.Test)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 DateComponents (org.orekit.time.DateComponents)2 TTScale (org.orekit.time.TTScale)2 TimeScale (org.orekit.time.TimeScale)2 UT1Scale (org.orekit.time.UT1Scale)2