Search in sources :

Example 91 with PVCoordinates

use of org.orekit.utils.PVCoordinates 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 92 with PVCoordinates

use of org.orekit.utils.PVCoordinates 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)

Example 93 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class FramesFactoryTest method testUnwrapInterpolatingTransformProvider.

@Test
public void testUnwrapInterpolatingTransformProvider() throws OrekitException {
    TransformProvider raw = new TransformProvider() {

        private static final long serialVersionUID = 1L;

        public Transform getTransform(final AbsoluteDate date) {
            double dt = date.durationFrom(AbsoluteDate.J2000_EPOCH);
            double sin = FastMath.sin(dt * MathUtils.TWO_PI / Constants.JULIAN_DAY);
            return new Transform(date, new PVCoordinates(new Vector3D(sin, Vector3D.PLUS_I), Vector3D.ZERO));
        }

        public <T extends RealFieldElement<T>> FieldTransform<T> getTransform(final FieldAbsoluteDate<T> date) {
            throw new UnsupportedOperationException("never called in this test");
        }
    };
    Frame parent = FramesFactory.getGCRF();
    Frame frame = new Frame(parent, new InterpolatingTransformProvider(raw, CartesianDerivativesFilter.USE_P, AngularDerivativesFilter.USE_R, 4, Constants.JULIAN_DAY, 10, Constants.JULIAN_YEAR, 2 * Constants.JULIAN_DAY), "sine");
    double maxErrorNonInterpolating = 0;
    double maxErrorInterpolating = 0;
    for (double dt = 0; dt < Constants.JULIAN_DAY; dt += 60.0) {
        AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt);
        Transform reference = raw.getTransform(date);
        Transform nonInterpolating = FramesFactory.getNonInterpolatingTransform(parent, frame, date);
        Transform interpolating = parent.getTransformTo(frame, date);
        double errorNonInterpolating = Vector3D.distance(reference.getTranslation(), nonInterpolating.getTranslation());
        maxErrorNonInterpolating = FastMath.max(maxErrorNonInterpolating, errorNonInterpolating);
        double errorInterpolating = Vector3D.distance(reference.getTranslation(), interpolating.getTranslation());
        maxErrorInterpolating = FastMath.max(maxErrorInterpolating, errorInterpolating);
    }
    Assert.assertEquals(0.0, maxErrorNonInterpolating, 1.0e-15);
    Assert.assertEquals(1.0, maxErrorInterpolating, 1.0e-15);
}
Also used : RealFieldElement(org.hipparchus.RealFieldElement) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 94 with PVCoordinates

use of org.orekit.utils.PVCoordinates 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 95 with PVCoordinates

use of org.orekit.utils.PVCoordinates in project Orekit by CS-SI.

the class GTODProviderTest method testAASReferenceGEOField.

@Test
public void testAASReferenceGEOField() 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[][] { { 53153, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53154, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53155, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53156, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53157, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53158, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53159, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN }, { 53160, -0.4709050, 0.0000000, -0.083853, 0.467217, -0.053614, -0.004494, Double.NaN, Double.NaN } }));
    FieldAbsoluteDate<Decimal64> t0 = new FieldAbsoluteDate<>(Decimal64Field.getInstance(), new DateComponents(2004, 06, 01), TimeComponents.H00, TimeScalesFactory.getUTC());
    FieldTransform<Decimal64> t = FramesFactory.getTOD(IERSConventions.IERS_1996, true).getTransformTo(FramesFactory.getGTOD(IERSConventions.IERS_1996, true), t0);
    // TOD iau76
    PVCoordinates pvTOD = new PVCoordinates(new Vector3D(-40577427.7501, -11500096.1306, 10293.2583), new Vector3D(837.552338, -2957.524176, -0.928772));
    // PEF iau76
    PVCoordinates pvPEF = new PVCoordinates(new Vector3D(24796919.2956, -34115870.9001, 10293.2583), new Vector3D(-0.979178, -1.476540, -0.928772));
    // 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 Decimal64 dDeltaPsi = FramesFactory.getEOPHistory(IERSConventions.IERS_1996, true).getEquinoxNutationCorrection(t0)[0];
    final Decimal64 epsilonA = IERSConventions.IERS_1996.getMeanObliquityFunction().value(t0);
    final FieldTransform<Decimal64> fix = new FieldTransform<>(t0, new FieldRotation<>(FieldVector3D.getPlusK(Decimal64Field.getInstance()), dDeltaPsi.multiply(epsilonA.cos()), RotationConvention.FRAME_TRANSFORM));
    checkPV(fix.transformPVCoordinates(pvPEF), t.transformPVCoordinates(pvTOD), 0.0503, 3.59e-4);
    // 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), 1458.27, 3.847e-4);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Decimal64(org.hipparchus.util.Decimal64) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) Test(org.junit.Test)

Aggregations

PVCoordinates (org.orekit.utils.PVCoordinates)341 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)271 Test (org.junit.Test)242 AbsoluteDate (org.orekit.time.AbsoluteDate)189 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)159 SpacecraftState (org.orekit.propagation.SpacecraftState)95 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)76 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)73 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)71 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)67 Orbit (org.orekit.orbits.Orbit)65 EquinoctialOrbit (org.orekit.orbits.EquinoctialOrbit)57 Frame (org.orekit.frames.Frame)53 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)44 CartesianOrbit (org.orekit.orbits.CartesianOrbit)43 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)42 DateComponents (org.orekit.time.DateComponents)40 CircularOrbit (org.orekit.orbits.CircularOrbit)37 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)30 NumericalPropagator (org.orekit.propagation.numerical.NumericalPropagator)30