Detector for simulation interval?


Quite often one would like to have the state at start and end of simulation to check for different detector status (such as visibility) at those points.

if one is doing a final_state = propagator.propagate(start, end) one gets the end state but not the start state (note that this is not the same as initialState of propagator).

Is there a clean way of getting both start and final state? One way is to first do a start_state = propagator.propagate(start, start) but this looks a bit odd. I don’t want event detectors to be active before start timepoint.

One possibility that would be quite neat and not sure if it is possible today is to create detectors “startSimulationDetector” and “endSimulationDetector”, but not sure the current API to detector allows for that? Using detectors would give a way to then get all events collected through an eventLogger for later parsing.


Hi petrus,

I don’t get it, how’s the “start” state different from getInitialState (before any propagation I mean)?
Edit: ah sorry I didn’t see you called propagate with two arguments

For AbstractIntegratedPropagator, you have a resetAtEnd “flag”. With the false behaviour, the initial state will always remain the same. Only propagate will give you a final state. I actually find a bit odd that the default value is true: ok it saves computational time, but it may also introduce additional integration noise when doing back and forth propagations. Anyway, analytical models including SGP4 do not have this feature in Orekit. I wouldn’t be against its implementation.


Hi Romain,

Thanks, yes I am using TLE and for others, getInitialState gives the state at epoch of the TLE which may be different from the start and stop of the propagation.

You can do a first run from TLE epoch to "start date " without any detector and only add them for the propagation on the interval of interest.
Anyway SGP4 is analytical so it doesn’t cost much computationally speaking to run it multiple times (at least without detectors), thus you could duplicate your Orekit TLE object and your TLEPropagator just for the state at “start date”.