use of org.orekit.propagation.FieldSpacecraftState in project Orekit by CS-SI.
the class YawCompensationTest method checkField.
private <T extends RealFieldElement<T>> void checkField(final Field<T> field, final GroundPointing provider, final Orbit orbit, final AbsoluteDate date, final Frame frame) throws OrekitException {
final Attitude attitudeD = provider.getAttitude(orbit, date, frame);
final FieldOrbit<T> orbitF = new FieldSpacecraftState<>(field, new SpacecraftState(orbit)).getOrbit();
final FieldAbsoluteDate<T> dateF = new FieldAbsoluteDate<>(field, date);
final FieldAttitude<T> attitudeF = provider.getAttitude(orbitF, dateF, frame);
Assert.assertEquals(0.0, Rotation.distance(attitudeD.getRotation(), attitudeF.getRotation().toRotation()), 2.0e-13);
Assert.assertEquals(0.0, Vector3D.distance(attitudeD.getSpin(), attitudeF.getSpin().toVector3D()), 2.0e-11);
Assert.assertEquals(0.0, Vector3D.distance(attitudeD.getRotationAcceleration(), attitudeF.getRotationAcceleration().toVector3D()), 2.0e-13);
final TimeStampedPVCoordinates pvD = provider.getTargetPV(orbit, date, frame);
final TimeStampedFieldPVCoordinates<T> pvF = provider.getTargetPV(orbitF, dateF, frame);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getPosition(), pvF.getPosition().toVector3D()), 1.0e-15);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getVelocity(), pvF.getVelocity().toVector3D()), 9.0e-9);
Assert.assertEquals(0.0, Vector3D.distance(pvD.getAcceleration(), pvF.getAcceleration().toVector3D()), 8.0e-7);
}
Aggregations