Search in sources :

Example 26 with TimeComponents

use of org.orekit.time.TimeComponents 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 27 with TimeComponents

use of org.orekit.time.TimeComponents 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 28 with TimeComponents

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

the class GTODProviderTest 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());
    // PEF iau76
    PVCoordinates pvPEF = new PVCoordinates(new Vector3D(-1033475.0313, 7901305.5856, 6380344.5328), new Vector3D(-3225.632747, -2872.442511, 5531.931288));
    // 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));
    // TOD iau76
    PVCoordinates pvTOD = new PVCoordinates(new Vector3D(5094514.7804, 6127366.4612, 6380344.5328), new Vector3D(-4746.088567, 786.077222, 5531.931288));
    Transform t = FramesFactory.getTOD(IERSConventions.IERS_1996, true).getTransformTo(FramesFactory.getGTOD(IERSConventions.IERS_1996, true), t0);
    checkPV(fix.transformPVCoordinates(pvPEF), t.transformPVCoordinates(pvTOD), 0.00942, 3.12e-5);
    // if we forget to apply nutation corrections, results are much worse, which is expected
    t = FramesFactory.getTOD(false).getTransformTo(FramesFactory.getGTOD(false), t0);
    checkPV(fix.transformPVCoordinates(pvPEF), t.transformPVCoordinates(pvTOD), 257.49, 0.13955);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) FieldRotation(org.hipparchus.geometry.euclidean.threed.FieldRotation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 29 with TimeComponents

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

the class ITRFProviderWithoutTidalEffectsTest method testMSLIBTransformJ2000_TerVrai.

@Test
public void testMSLIBTransformJ2000_TerVrai() throws OrekitException {
    AbsoluteDate date = new AbsoluteDate(new DateComponents(2003, 10, 14), new TimeComponents(02, 00, 00), TimeScalesFactory.getUTC());
    Transform trans = FramesFactory.getEME2000().getTransformTo(FramesFactory.getTIRF(IERSConventions.IERS_2010), date);
    // Positions
    Vector3D posTIRF = trans.transformPosition(new Vector3D(6500000.0, -1234567.0, 4000000.0));
    Assert.assertEquals(0, 3011109.361 - posTIRF.getX(), 0.38);
    Assert.assertEquals(0, -5889822.669 - posTIRF.getY(), 0.38);
    Assert.assertEquals(0, 4002170.039 - posTIRF.getZ(), 0.27);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 30 with TimeComponents

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

the class TLETest method testBug77TooLargeSatelliteNumber1.

@Test
public void testBug77TooLargeSatelliteNumber1() throws OrekitException {
    try {
        TLE tle = new TLE(1000000, 'U', 1971, 86, "J", 0, 908, new AbsoluteDate(new DateComponents(2012, 26), new TimeComponents(0.96078249 * Constants.JULIAN_DAY), TimeScalesFactory.getUTC()), taylorConvert(12.26882470, 1), taylorConvert(-0.00000004, 2), taylorConvert(0.00001e-9, 3), 0.0075476, FastMath.toRadians(74.0161), FastMath.toRadians(328.9888), FastMath.toRadians(228.9750), FastMath.toRadians(30.6709), 80454, 0.01234e-9);
        tle.getLine1();
        Assert.fail("an exception should have been thrown");
    } catch (OrekitException oe) {
        Assert.assertEquals(OrekitMessages.TLE_INVALID_PARAMETER, oe.getSpecifier());
        Assert.assertEquals(1000000, ((Integer) oe.getParts()[0]).intValue());
        Assert.assertEquals("satelliteNumber-1", oe.getParts()[1]);
    }
}
Also used : DateComponents(org.orekit.time.DateComponents) OrekitException(org.orekit.errors.OrekitException) TimeComponents(org.orekit.time.TimeComponents) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

TimeComponents (org.orekit.time.TimeComponents)88 DateComponents (org.orekit.time.DateComponents)87 AbsoluteDate (org.orekit.time.AbsoluteDate)84 Test (org.junit.Test)72 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)55 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)55 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)47 Orbit (org.orekit.orbits.Orbit)44 SpacecraftState (org.orekit.propagation.SpacecraftState)42 CartesianOrbit (org.orekit.orbits.CartesianOrbit)35 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)35 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)32 AbstractLegacyForceModelTest (org.orekit.forces.AbstractLegacyForceModelTest)28 PVCoordinates (org.orekit.utils.PVCoordinates)24 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)22 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)17 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)17 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)17 CircularOrbit (org.orekit.orbits.CircularOrbit)16 FieldNumericalPropagator (org.orekit.propagation.numerical.FieldNumericalPropagator)16