Search in sources :

Example 31 with DateComponents

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

the class TEMEProviderTest method testValladoTEMEofDate.

@Test
public void testValladoTEMEofDate() throws OrekitException {
    // this reference test has been extracted from Vallado's book:
    // Fundamentals of Astrodynamics and Applications
    // David A. Vallado, Space Technology Library, 2007
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2000, 182), new TimeComponents(0.78495062 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC());
    // TEME
    PVCoordinates pvTEME = new PVCoordinates(new Vector3D(-9060473.73569, 4658709.52502, 813686.73153), new Vector3D(-2232.832783, -4110.453490, -3157.345433));
    // reference position in EME2000
    // note that Valado's book gives
    // PVCoordinates pvEME2000Ref =
    // new PVCoordinates(new Vector3D(-9059941.3786, 4659697.2000, 813958.8875),
    // new Vector3D(-2233.348094, -4110.136162, -3157.394074));
    // the values we use here are slightly different, they were computed using
    // Vallado's C++ companion code to the book, using the teme_j2k function with
    // all 106 nutation terms and the 2 corrections elements of the equation of the equinoxes
    PVCoordinates pvEME2000Ref = new PVCoordinates(new Vector3D(-9059941.5224999374914, 4659697.1225837596648, 813957.72947647583351), new Vector3D(-2233.3476939179299769, -4110.1362849403413335, -3157.3941963060194738));
    Transform t = FramesFactory.getTEME().getTransformTo(FramesFactory.getEME2000(), t0);
    PVCoordinates pvEME2000Computed = t.transformPVCoordinates(pvTEME);
    PVCoordinates delta = new PVCoordinates(pvEME2000Computed, pvEME2000Ref);
    Assert.assertEquals(0.0, delta.getPosition().getNorm(), 0.025);
    Assert.assertEquals(0.0, delta.getVelocity().getNorm(), 1.0e-4);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 32 with DateComponents

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

the class TODProviderTest method testAASReferenceLEO.

@Test
public void testAASReferenceLEO() throws OrekitException {
    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, ITRFVersion.ITRF_2008, new double[][] { { 53098, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53099, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53100, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53101, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53102, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53103, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53104, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53105, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN } }));
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009), TimeScalesFactory.getUTC());
    Transform tt = FramesFactory.getMOD(IERSConventions.IERS_1996).getTransformTo(FramesFactory.getTOD(IERSConventions.IERS_1996, true), t0);
    Transform ff = FramesFactory.getMOD(false).getTransformTo(FramesFactory.getTOD(false), t0);
    // TOD iau76
    PVCoordinates pvTODiau76 = new PVCoordinates(new Vector3D(5094514.7804, 6127366.4612, 6380344.5328), new Vector3D(-4746.088567, 786.077222, 5531.931288));
    // MOD iau76
    PVCoordinates pvMODiau76WithoutNutCorr = new PVCoordinates(new Vector3D(5094029.0167, 6127870.9363, 6380247.8885), new Vector3D(-4746.262495, 786.014149, 5531.791025));
    // MOD iau76
    PVCoordinates pvMODiau76 = new PVCoordinates(new Vector3D(5094028.3745, 6127870.8164, 6380248.5164), new Vector3D(-4746.263052, 786.014045, 5531.790562));
    // it seems the induced effect of pole nutation correction δΔψ on the equation of the equinoxes
    // was not taken into account in the reference paper, so we fix it here for the test
    final double dDeltaPsi = FramesFactory.getEOPHistory(IERSConventions.IERS_1996, true).getEquinoxNutationCorrection(t0)[0];
    final double epsilonA = IERSConventions.IERS_1996.getMeanObliquityFunction().value(t0);
    final Transform fix = new Transform(t0, new Rotation(Vector3D.PLUS_K, dDeltaPsi * FastMath.cos(epsilonA), RotationConvention.FRAME_TRANSFORM));
    checkPV(pvTODiau76, fix.transformPVCoordinates(tt.transformPVCoordinates(pvMODiau76)), 1.13e-3, 5.3e-5);
    checkPV(pvTODiau76, ff.transformPVCoordinates(pvMODiau76WithoutNutCorr), 1.07e-3, 5.3e-5);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 33 with DateComponents

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

the class VEISFrameTest method testRefLEO.

@Test
public void testRefLEO() throws OrekitException {
    AbsoluteDate date0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009), TimeScalesFactory.getUTC());
    Transform t0 = FramesFactory.getEME2000().getTransformTo(FramesFactory.getVeis1950(), date0);
    // J2000
    PVCoordinates pvJ2000 = new PVCoordinates(new Vector3D(5102509.6000, 6123011.5200, 6378136.3000), new Vector3D(-4743.219600, 790.536600, 5533.756190));
    // the following result were obtained using this code in mslib Fortran library
    // model         =  pm_lieske_wahr
    // jul1950%jour  =  19819                ! 2004-04-06
    // jul1950%sec   =  28288.386009_pm_reel ! 07:51:28.386009
    // delta_tu1     =  0.0_pm_reel          ! 0.0 dtu1 as here we don't use EOP corrections
    // delta_tai     =  32.0_pm_reel         ! TAI - UTC
    // pos_J2000(1)  = 5102509.6000_pm_reel
    // pos_J2000(2)  = 6123011.5200_pm_reel
    // pos_J2000(3)  = 6378136.3000_pm_reel
    // vit_J2000(1)  = -4743.219600_pm_reel
    // vit_J2000(2)  =   790.536600_pm_reel
    // vit_J2000(3)  =  5533.756190_pm_reel
    // call mr_J2000_veis (model, jul1950, delta_tu1, delta_tai, pos_J2000, pos_veis, code_retour, &
    // vit_J2000, vit_veis, jacob )
    PVCoordinates pvVEIS = new PVCoordinates(new Vector3D(5168161.5980523797, 6065377.6711138152, 6380344.5327578690), new Vector3D(-4736.2464648667, 843.3525998501, 5531.9312750395));
    PVCoordinates delta0 = new PVCoordinates(t0.transformPVCoordinates(pvJ2000), pvVEIS);
    Assert.assertEquals(0.0, delta0.getPosition().getNorm(), 7.0e-4);
    Assert.assertEquals(0.0, delta0.getVelocity().getNorm(), 8.0e-5);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 34 with DateComponents

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

the class BulletinAFilesLoaderTest method testEndDate.

@Test
public void testEndDate() throws OrekitException {
    setRoot("bulletinA");
    SortedSet<EOPEntry> history = new TreeSet<EOPEntry>(new ChronologicalComparator());
    new BulletinAFilesLoader("bulletina-xxvi-\\d\\d\\d\\.txt").fillHistory(null, history);
    Assert.assertTrue(getMaxGap(history) < 2);
    Assert.assertEquals(new AbsoluteDate(new DateComponents(DateComponents.MODIFIED_JULIAN_EPOCH, 56968), TimeScalesFactory.getUTC()), new EOPHistory(IERSConventions.IERS_2010, history, false).getEndDate());
}
Also used : TreeSet(java.util.TreeSet) DateComponents(org.orekit.time.DateComponents) ChronologicalComparator(org.orekit.time.ChronologicalComparator) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test) AbstractFilesLoaderTest(org.orekit.data.AbstractFilesLoaderTest)

Example 35 with DateComponents

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

the class EME2000ProviderTest method testAASReferenceGEO.

@Test
public void testAASReferenceGEO() throws OrekitException {
    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 06, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
    Transform t = FramesFactory.getGCRF().getTransformTo(FramesFactory.getEME2000(), t0);
    PVCoordinates pvGCRFiau2000A = new PVCoordinates(new Vector3D(-40588150.3617, -11462167.0397, 27143.1974), new Vector3D(834.787458, -2958.305691, -1.172993));
    PVCoordinates pvEME2000EqA = new PVCoordinates(new Vector3D(-40588149.5482, -11462169.9118, 27146.8462), new Vector3D(834.787667, -2958.305632, -1.172963));
    checkPV(pvEME2000EqA, t.transformPVCoordinates(pvGCRFiau2000A), 5.8e-5, 6.4e-7);
    PVCoordinates pvGCRFiau2000B = new PVCoordinates(new Vector3D(-40588150.3617, -11462167.0397, 27143.2125), new Vector3D(834.787458, -2958.305691, -1.172999));
    PVCoordinates pvEME2000EqB = new PVCoordinates(new Vector3D(-40588149.5481, -11462169.9118, 27146.8613), new Vector3D(834.787667, -2958.305632, -1.172968));
    checkPV(pvEME2000EqB, t.transformPVCoordinates(pvGCRFiau2000B), 1.1e-4, 5.5e-7);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

DateComponents (org.orekit.time.DateComponents)148 AbsoluteDate (org.orekit.time.AbsoluteDate)129 Test (org.junit.Test)98 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)87 TimeComponents (org.orekit.time.TimeComponents)87 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)64 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)62 Orbit (org.orekit.orbits.Orbit)47 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)46 SpacecraftState (org.orekit.propagation.SpacecraftState)45 PVCoordinates (org.orekit.utils.PVCoordinates)40 CartesianOrbit (org.orekit.orbits.CartesianOrbit)37 OrekitException (org.orekit.errors.OrekitException)34 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)33 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)28 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)28 CircularOrbit (org.orekit.orbits.CircularOrbit)25 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)25 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)23 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)22