I have been trying to create a step handler in Python by inheriting from the two Java interfaces OrekitStepHandler and OrekitFixedStepHandler.
Here is the code snippet:
class FakeStepHandler(OrekitStepHandler):
def __init__(self):
super().__init__()
handler = FakeStepHandler()
propagator.getMultiplexer().add(handler)
System throws error:
NotImplementedError: (‘instantiating java class’, <class ‘main.FakeStepHandler’>)
I was able to compile by replacing the super().__init__()
with pass
. However, this will result in handler value as <null>
and the propagator throws
JavaError: <super: <class ‘JavaError’>, >
Java stacktrace:
java.lang.NullPointerException
at org.orekit.propagation.integration.AbstractIntegratedPropagator$AdaptedStepHandler.init(AbstractIntegratedPropagator.java:1050)
at org.hipparchus.ode.AbstractIntegrator.initIntegration(AbstractIntegrator.java:224)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:195)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:509)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:440)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:400)
Version specification:
orekit version “12.2”
python version “3.11.8”
openjdk version “1.8.0_412”
OpenJDK Runtime Environment (Zulu 8.78.0.19-CA-win64) (build 1.8.0_412-b08)