TLEPropagator ApsideDetector

Hey,

I managed to add an ApsideDetector to an NumericalPropagator with Keplerian Parameters initially. Now I want to use the same Detector for a TLE Propagator:

def peri_apo_detector(endDate,prop):
detector= ApsideDetector(prop.getInitialState().getOrbit()).withHandler(ContinueOnEvent())
logger = EventsLogger()
logged_detector = logger.monitorDetector(detector)
prop.addEventDetector(logged_detector)
prop.propagate(initDate, endDate) #detection happens here
events = logger.getLoggedEvents()
return events

The line ‘prop.propagate(initDate, endDate)’ is the failure point. I already tried to remove only initDate.
This is how I set up the TLEPropagator:

my_TLE = TLE(tle_line1, tle_line2)
initDate = my_TLE.getDate()
finalDate = initDate.shiftedBy(t_shifted)
propagator = TLEPropagator.selectExtrapolator(my_TLE)

And that is how I call the function:

events = peri_apo_detector(finalDate, propagator)

Thanks to everyone trying to help me out!
Max

Hello @max_gze,

I have produced a similar code on my end and it works as expected. Could you give us the error you are getting when running your script ?

Cheers,
Vincent

Hey Vincent,

this would be the error:
orekit.JavaError: <super: <class ‘JavaError’>, >
Java stacktrace:
org.orekit.errors.OrekitException: non resettable state
at org.orekit.propagation.analytical.tle.TLEPropagator.resetIntermediateState(TLEPropagator.java:568)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(AbstractAnalyticalPropagator.java:282)
at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:151)

Thank you, this helps a lot.

You are encountering this error because your propagator has an event detector with a step handler that returns either an Action.RESET_DERIVATIVES or an Action.RESET_STATE. Could you look into that ?

Hi there

What version of Orekit are you using?
With >= 12.1 the TlePropagator can reset its state.

Cheers,
Romain.

Hey,

I’m using Version 11.2. Switching to 12.1/2 might be one solution for this issue. Additionally I need the stateToTLE method (available from 12.0 on).

Thanks!

1 Like

It’s me again.

I’ve been trying downloading Version 12.2.1 and 12.2 for the last 2 days but somehow it doesn’t work. I tried to integrate the new Orekit version this way:
orekit.initVM(classpath=(
“/Users/maxgantze/Desktop/BA/orekit-12.2.jar:”
))

The error that occurs is always the same:
Exception in thread “main” java.lang.NoClassDefFoundError: org/hipparchus/analysis/differentiation/UnivariateDerivative1
Caused by: java.lang.ClassNotFoundException: org.hipparchus.analysis.differentiation.UnivariateDerivative1
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
Traceback (most recent call last):
File “/Users/myname/BA/ba-max/main.py”, line 5, in
orekit.initVM(classpath=(
orekit.JavaError: <exception str() failed>

So I tried to install different versions of Hipparchus manually (2.0, 3.0, 3.1) but it never worked out. This way I tried to integrate the different Hipparchus applications:
orekit.initVM(classpath=(
“/Users/myname/Desktop/BA/orekit-12.2.jar:” # Orekit 12.2 JAR-Datei
“/Users/myname/Desktop/BA/hipparchus-2.0-bin/hipparchus-core-2.0.jar:” # Hipparchus Core
“/Users/myname/Desktop/BA/hipparchus-2.0-bin/hipparchus-clustering-2.0.jar:”…

Dd you have any ideas/experiences on that issue? I’m using macOS and the Python Wrapper!

Big thanks to everyone trying to help out!
Max