Search in sources :

Example 1 with PolynomialNutation

use of org.orekit.data.PolynomialNutation in project Orekit by CS-SI.

the class MODProviderTest method testEuler2000.

@Test
public void testEuler2000() throws OrekitException {
    // this alternate representation of the transform
    // is from equation 33 in IERS conventions 2003
    TransformProvider eulerBasedProvider = new TransformProvider() {

        private static final long serialVersionUID = 1L;

        private final PolynomialNutation zetaA = new PolynomialNutation(2.5976176 * Constants.ARC_SECONDS_TO_RADIANS, 2306.0809506 * Constants.ARC_SECONDS_TO_RADIANS, 0.3019015 * Constants.ARC_SECONDS_TO_RADIANS, 0.0179663 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000327 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000002 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation thetaA = new PolynomialNutation(0.0, 2004.1917476 * Constants.ARC_SECONDS_TO_RADIANS, -0.4269353 * Constants.ARC_SECONDS_TO_RADIANS, -0.0418251 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000601 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000001 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation zA = new PolynomialNutation(-2.5976176 * Constants.ARC_SECONDS_TO_RADIANS, 2306.0803226 * Constants.ARC_SECONDS_TO_RADIANS, 1.0947790 * Constants.ARC_SECONDS_TO_RADIANS, 0.0182273 * Constants.ARC_SECONDS_TO_RADIANS, 0.0000470 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000003 * Constants.ARC_SECONDS_TO_RADIANS);

        public Transform getTransform(AbsoluteDate date) {
            final double tc = IERSConventions.IERS_2003.evaluateTC(date);
            final Rotation r1 = new Rotation(Vector3D.PLUS_K, zA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r2 = new Rotation(Vector3D.PLUS_J, -thetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r3 = new Rotation(Vector3D.PLUS_K, zetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            return new Transform(date, r1.compose(r2.compose(r3, RotationConvention.VECTOR_OPERATOR), RotationConvention.VECTOR_OPERATOR));
        }

        public <T extends RealFieldElement<T>> FieldTransform<T> getTransform(final FieldAbsoluteDate<T> date) {
            throw new UnsupportedOperationException("never called in this test");
        }
    };
    MODProvider modProvider = new MODProvider(IERSConventions.IERS_2003);
    for (double dt = -Constants.JULIAN_CENTURY; dt < Constants.JULIAN_CENTURY; dt += 50 * Constants.JULIAN_DAY) {
        AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt);
        Transform t = new Transform(date, modProvider.getTransform(date).getInverse(), eulerBasedProvider.getTransform(date));
        Assert.assertEquals(0, t.getRotation().getAngle(), 6.6e-13);
    }
}
Also used : RealFieldElement(org.hipparchus.RealFieldElement) PolynomialNutation(org.orekit.data.PolynomialNutation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with PolynomialNutation

use of org.orekit.data.PolynomialNutation in project Orekit by CS-SI.

the class MODProviderTest method testEuler1976.

@Test
public void testEuler1976() throws OrekitException {
    TransformProvider eulerBasedProvider = new TransformProvider() {

        private static final long serialVersionUID = 1L;

        private final PolynomialNutation zetaA = new PolynomialNutation(0.0, 2306.2181 * Constants.ARC_SECONDS_TO_RADIANS, 0.30188 * Constants.ARC_SECONDS_TO_RADIANS, 0.017998 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation thetaA = new PolynomialNutation(0.0, 2004.3109 * Constants.ARC_SECONDS_TO_RADIANS, -0.42665 * Constants.ARC_SECONDS_TO_RADIANS, -0.041833 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation zA = new PolynomialNutation(0.0, 2306.2181 * Constants.ARC_SECONDS_TO_RADIANS, 1.09468 * Constants.ARC_SECONDS_TO_RADIANS, 0.018203 * Constants.ARC_SECONDS_TO_RADIANS);

        public Transform getTransform(AbsoluteDate date) {
            final double tc = IERSConventions.IERS_1996.evaluateTC(date);
            final Rotation r1 = new Rotation(Vector3D.PLUS_K, zA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r2 = new Rotation(Vector3D.PLUS_J, -thetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r3 = new Rotation(Vector3D.PLUS_K, zetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            return new Transform(date, r1.compose(r2.compose(r3, RotationConvention.VECTOR_OPERATOR), RotationConvention.VECTOR_OPERATOR));
        }

        public <T extends RealFieldElement<T>> FieldTransform<T> getTransform(final FieldAbsoluteDate<T> date) {
            throw new UnsupportedOperationException("never called in this test");
        }
    };
    MODProvider modProvider = new MODProvider(IERSConventions.IERS_1996);
    for (double dt = -5 * Constants.JULIAN_YEAR; dt < 5 * Constants.JULIAN_YEAR; dt += 10 * Constants.JULIAN_DAY) {
        AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt);
        Transform t = new Transform(date, modProvider.getTransform(date).getInverse(), eulerBasedProvider.getTransform(date));
        Assert.assertEquals(0, t.getRotation().getAngle(), 1.01e-11);
    }
}
Also used : RealFieldElement(org.hipparchus.RealFieldElement) PolynomialNutation(org.orekit.data.PolynomialNutation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

RealFieldElement (org.hipparchus.RealFieldElement)2 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)2 Test (org.junit.Test)2 PolynomialNutation (org.orekit.data.PolynomialNutation)2 AbsoluteDate (org.orekit.time.AbsoluteDate)2 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)2