use of org.orekit.propagation.sampling.OrekitStepHandler in project Orekit by CS-SI.
the class KeplerianPropagatorTest method variableStep.
@Test
public void variableStep() throws OrekitException {
final KeplerianOrbit orbit = new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE, FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
KeplerianPropagator propagator = new KeplerianPropagator(orbit);
final double step = orbit.getKeplerianPeriod() / 100;
propagator.setMasterMode(new OrekitStepHandler() {
private AbsoluteDate previous;
public void handleStep(OrekitStepInterpolator interpolator, boolean isLast) throws OrekitException {
if ((previous != null) && !isLast) {
Assert.assertEquals(step, interpolator.getCurrentState().getDate().durationFrom(previous), 1.0e-10);
}
previous = interpolator.getCurrentState().getDate();
}
});
AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
propagator.propagate(farTarget);
}
Aggregations