Search in sources :

Example 1 with FieldOrekitStepHandlerMultiplexer

use of org.orekit.propagation.sampling.FieldOrekitStepHandlerMultiplexer in project Orekit by CS-SI.

the class FieldKeplerianPropagatorTest method doTestStepException.

private <T extends RealFieldElement<T>> void doTestStepException(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);
    FieldOrekitStepHandlerMultiplexer<T> multiplexer = new FieldOrekitStepHandlerMultiplexer<>();
    propagator.setMasterMode(multiplexer);
    multiplexer.add(new FieldOrekitStepHandler<T>() {

        public void init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t) {
        }

        public void handleStep(FieldOrekitStepInterpolator<T> interpolator, boolean isLast) throws OrekitException {
            if (isLast) {
                throw new OrekitException((Throwable) null, new DummyLocalizable("dummy error"));
            }
        }
    });
    propagator.propagate(orbit.getDate().shiftedBy(-3600));
}
Also used : DummyLocalizable(org.hipparchus.exception.DummyLocalizable) FieldKeplerianOrbit(org.orekit.orbits.FieldKeplerianOrbit) FieldOrekitStepHandlerMultiplexer(org.orekit.propagation.sampling.FieldOrekitStepHandlerMultiplexer) OrekitException(org.orekit.errors.OrekitException)

Aggregations

DummyLocalizable (org.hipparchus.exception.DummyLocalizable)1 OrekitException (org.orekit.errors.OrekitException)1 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)1 FieldOrekitStepHandlerMultiplexer (org.orekit.propagation.sampling.FieldOrekitStepHandlerMultiplexer)1