Hi Orekit users,
Could anyone please help me to address a problem in using PythonEventHandler?
I’m testing one example, python_files/test/BackAndForthDetectorTest.py, in the following link:
I replaced the package as follows:
in the example:
from org.orekit.python import PythonEventHandler
modified:
from org.orekit.propagation.events.handlers import PythonEventHandler
However, this example failed to run. Here’s an error message.
testBackAndForth (main.BackAndForthDetectorTest) … ERROR
======================================================================
ERROR: testBackAndForth (main.BackAndForthDetectorTest)
Traceback (most recent call last):
File “test_back_and_forth_detector.py”, line 105, in testBackAndForth
propagator.propagate(date1)
orekit.JavaError: <super: <class ‘JavaError’>, >
Java stacktrace:
java.lang.RuntimeException: AttributeError
at org.orekit.propagation.events.handlers.PythonEventHandler.init(Native Method)
at org.orekit.propagation.events.AbstractDetector.init(AbstractDetector.java:80)
at org.orekit.propagation.events.EventState.init(EventState.java:141)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:130)
at org.orekit.propagation.AbstractPropagator.propagate(AbstractPropagator.java:265)
Ran 1 test in 9.161s
FAILED (errors=1)
This example had no problem when I ran it in Orekit 10.x.
Is there something I missed? Or should I rewrite this event handler for Orekit 11.1?
Look forward to getting your feedback.
Thank you for your help in advance!
Best,