Search in sources :

Example 11 with TimeScalarFunction

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

the class IERSConventionsTest method testGST06Sofa.

@Test
public void testGST06Sofa() throws OrekitException {
    // the reference value has been computed using the March 2012 version of the SOFA library
    // http://www.iausofa.org/2012_0301_C.html, with the following code
    // 
    // double utc1, utc2, tai1, tai2, tt1, tt2, ut11, ut12, gst;
    // 
    // // 2004-02-14:00:00:00Z, MJD = 53049, UT1-UTC = -0.4093509
    // utc1  = DJM0 + 53049.0;
    // utc2  = 0.0;
    // iauUtctai(utc1, utc2, &tai1, &tai2);
    // iauTaitt(tai1, tai2, &tt1, &tt2);
    // iauUtcut1(utc1, utc2, -0.4093509, &ut11, &ut12);
    // gst = iauGst06a(ut11, ut12, tt1, tt2);
    // printf("iaugst06a(%.20g, %.20g, %.20g, %.20g)\n  --> %.20g\n",
    // ut11, ut12, tt1, tt2, gst);
    // 
    // // 2004-02-29:00:00:00Z, MJD = 53064, UT1-UTC = -0.4175723
    // utc1 = DJM0 + 53064.0;
    // utc2 = 0.0;
    // iauUtctai(utc1, utc2, &tai1, &tai2);
    // iauTaitt(tai1, tai2, &tt1, &tt2);
    // iauUtcut1(utc1, utc2, -0.4175723, &ut11, &ut12);
    // gst = iauGst06a(ut11, ut12, tt1, tt2);
    // printf("iaugst06a(%.20g, %.20g, %.20g, %.20g)\n  --> %.20g\n",
    // ut11, ut12, tt1, tt2, gst);
    // 
    // the output of this test reads:
    // iaugst06a(2453049.5, -4.7378576388888813016e-06, 2453049.5, 0.00074287037037037029902)
    // --> 2.5021491022006503435
    // iaugst06a(2453064.5, -4.8330127314815448519e-06, 2453064.5, 0.00074287037037037029902)
    // --> 2.7601901613234058885
    Utils.setLoaders(IERSConventions.IERS_2010, Utils.buildEOPList(IERSConventions.IERS_2010, ITRFVersion.ITRF_2008, new double[][] { { 53047, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53048, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53049, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53050, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53051, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53052, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53053, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53054, -0.4093509, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, // ...
    { 53059, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53060, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53061, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53062, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53063, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53064, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53065, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, { 53066, -0.4175723, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 } }));
    EOPHistory eopHistory = FramesFactory.getEOPHistory(IERSConventions.IERS_2010, true);
    final TimeScalarFunction gst06 = IERSConventions.IERS_2010.getGASTFunction(TimeScalesFactory.getUT1(eopHistory), eopHistory);
    AbsoluteDate date = new AbsoluteDate(2004, 2, 14, TimeScalesFactory.getUTC());
    double gst = MathUtils.normalizeAngle(gst06.value(date), 0.0);
    Assert.assertEquals(2.5021491022006503435, gst, 1.3e-12);
    date = new AbsoluteDate(2004, 2, 29, TimeScalesFactory.getUTC());
    gst = MathUtils.normalizeAngle(gst06.value(date), 0.0);
    Assert.assertEquals(2.7601901613234058885, gst, 1.2e-12);
}
Also used : TimeScalarFunction(org.orekit.time.TimeScalarFunction) EOPHistory(org.orekit.frames.EOPHistory) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

TimeScalarFunction (org.orekit.time.TimeScalarFunction)11 Test (org.junit.Test)10 AbsoluteDate (org.orekit.time.AbsoluteDate)9 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)9 TimeScale (org.orekit.time.TimeScale)4 EOPHistory (org.orekit.frames.EOPHistory)3 Method (java.lang.reflect.Method)2 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)2 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)2 UT1Scale (org.orekit.time.UT1Scale)2 Field (java.lang.reflect.Field)1 RealFieldElement (org.hipparchus.RealFieldElement)1 BodiesElements (org.orekit.data.BodiesElements)1 FundamentalNutationArguments (org.orekit.data.FundamentalNutationArguments)1 PoissonSeries (org.orekit.data.PoissonSeries)1 PoissonSeriesParser (org.orekit.data.PoissonSeriesParser)1 OrekitInternalError (org.orekit.errors.OrekitInternalError)1 TimeVectorFunction (org.orekit.time.TimeVectorFunction)1 IERSConventions (org.orekit.utils.IERSConventions)1