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);
}
}
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);
}
}
Aggregations