Hi, Orekit forum!
I’m a new user of the orekit, I don’t know much about the orekit. I’m here to ask for your help.
I don’t know the reason for the unknown orekit error, It’s maybe about Propagation.
I compile using Python 3.7 with Pycharm.
The portion of the code that causes the error and the package you imported are as:
package:
import math
import logging
import orekit
from org.orekit.propagation.events.handlers import RecordAndContinue
from org.orekit.propagation.events.handlers import PythonEventHandler
from org.orekit.propagation.events import DateDetector
from org.orekit.frames import FramesFactory
from org.orekit.time import AbsoluteDate
from org.orekit.time import TimeScalesFactory
from org.hipparchus.ode.events import Action
code:
def propagate(self, start, end, steps, mode=1, factor=2):
self.setup_timesampler(start, end, steps, mode, factor)
if end is None:
self.propagator.propagate(start)
elif None not in (start, end):
# TODO: check value of shift, technically 1s should be enough
shifted_start = start.shiftedBy(-60.0)
shifted_end = end.shiftedBy(60.0)
self.propagator.propagate(shifted_start, shifted_end)
else:
raise CelestialBodyError("Invalid arguments for propagation.")
for your information, setup_timesampler is as:
def setup_timesampler(self, start, end, steps, mode=1, factor=2):
"""Create and attach TimeSampler to propagator."""
self.time_sampler = TimeSampler(start, end, steps, mode, factor).withHandler(
self.event_handler
)
self.propagator.addEventDetector(self.time_sampler)
The error is printed as:
File "C:\space\cb.py", line 103, in propagate
self.propagator.propagate(shifted_start, shifted_end)
orekit.JavaError: <super: <class 'JavaError'>, <JavaError object>>
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:95)
at org.orekit.propagation.events.EventState.init(EventState.java:141)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:133)
I can provide you with more code if necessary. Please, would you mind help me?
Many thanks.
Sky