Question usage EventDetectors


A very basic question, but cannot seem to find it anywhere.

I’m doing some very simple and non-complex examples of event detection. If one is using detectors that stops the propagation,like StopOnEvent, is there a way in the result from the propagator propagate() method to determine the event properties that causes the propagator to stop? The propagator itself returns a SpacecraftState and cannot find any connection to the event in that.

The use case would be a very simplistic while loop where the events are sequentially extracted.

It is indeed not so much more complex to use an eventslogger or own eventhandler but…


Nope, the event is not available from a SpacecraftState. You could try using RecordAndContinue. In the past I’ve used a custom handler that stores the event to a instance variable before returning STOP.

Thanks, yes that would be a way to do it to have a custom handler, but was hoping that it was somehow possible without.

Didn’t notice RecordAndContinue before, what is the pro/cons of that compared to EventsLogger, it is stated that it may consume lots of memory, but assume that applies for EventsLogger as well?


For the most part it is two different ways to do the same job. EventsLogger intercepts calls to eventOccured, while RecordAndContinue is an EventHandler.

1 Like