use of org.orekit.propagation.events.FieldNodeDetector in project Orekit by CS-SI.
the class FieldEcksteinHechlerPropagatorTest method doStopAtTargetDate.
private <T extends RealFieldElement<T>> void doStopAtTargetDate(Field<T> field) throws OrekitException {
T zero = field.getZero();
FieldAbsoluteDate<T> date = new FieldAbsoluteDate<>(field);
final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), date, 3.986004415e14);
FieldEcksteinHechlerPropagator<T> propagator = new FieldEcksteinHechlerPropagator<>(orbit, provider);
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
propagator.addEventDetector(new FieldNodeDetector<>(orbit, itrf).withHandler(new FieldContinueOnEvent<FieldNodeDetector<T>, T>()));
FieldAbsoluteDate<T> farTarget = orbit.getDate().shiftedBy(10000.0);
FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate()).getReal()), 1.0e-3);
}
use of org.orekit.propagation.events.FieldNodeDetector in project Orekit by CS-SI.
the class FieldKeplerianPropagatorTest method doTestStopAtTargetDate.
private <T extends RealFieldElement<T>> void doTestStopAtTargetDate(Field<T> field) throws OrekitException {
T zero = field.getZero();
final FieldKeplerianOrbit<T> orbit = new FieldKeplerianOrbit<>(zero.add(7.8e6), zero.add(0.032), zero.add(0.4), zero.add(0.1), zero.add(0.2), zero.add(0.3), PositionAngle.TRUE, FramesFactory.getEME2000(), new FieldAbsoluteDate<>(field), 3.986004415e14);
FieldKeplerianPropagator<T> propagator = new FieldKeplerianPropagator<>(orbit);
Frame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
propagator.addEventDetector(new FieldNodeDetector<>(orbit, itrf).withHandler(new FieldContinueOnEvent<FieldNodeDetector<T>, T>()));
FieldAbsoluteDate<T> farTarget = orbit.getDate().shiftedBy(10000.0);
FieldSpacecraftState<T> propagated = propagator.propagate(farTarget);
Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate()).getReal()), 1.0e-3);
}
Aggregations