NodeDetector - only ascending node

Hi everyone,

Sorry for my stupid question, I’m pretty new on Orekit. I’m interested in introducing an event in the propagator that only finds the ascending node.
Luc Maisonobe suggested me to use NodeDetector (associated with a FilterType.TRIGGER_ONLY_INCREASING_EVENTS) within an EventSlopeFilter.
Someone could give me an example of how to set ‘EventSlopeFilter’.

thanks again and sorry for the inconvenience


Hi @matteonicoli

NodeDetector is based on sign changes of a g function at equator. Here the g function is just the z coordinate of the spacecraft in the frame selected at NodeDetector construction. When the sign changes (i.e. when the satellite crosses equator), the eventOccurred method of the event handler is called and the increasing boolean parameter of this method is set to true if the g function would go from negative values to positive values if propagation was forward and it is set to false if the g function would go from positive values to negative values if propagation was forward. For the NodeDetector the eventOccurred method of the events handler is therefore called with increasing set to true on ascending nodes and set to false on descending nodes. Note that this works even when propagating backward, because the event detection mechanism takes care of propagation direction when setting the boolean (i.e. if you propagate backward and have the z coordinate going from +1m to -1m with respect to equator, you are really crossing an ascending node, backward, so the increasing boolean would really be set to true).

You could therefore just use a NodeDetector and check the boolean to ignore descending nodes events, but this would waste computing time as in this case the propagator will run a root solver to locate accurately descending nodes events that you will just drop. The EventSlopeFilter is designed to fool the propagator so it does not even see the descending nodes events and it will pass them at full speed, and the even handler associated with the NodeDetector will always be called with its increasing boolean set to true. This is done as follows:

  NodeDetector rawDetector = new NodeDetector(eme2000).
                             withHandler((state, detector, increasing) ->
                                         System.out.println(state.getDate() + " " + (increasing ? " ascending node" : "descending node"))));
         final EventSlopeFilter<NodeDetector> filter =
                new EventSlopeFilter<>(rawDetector,

The EventSlopeFilter prevents propagator to waste time searching for decreasing events as it knows in advance the caller is not interested with these events. It does this by tampering with the raw detector g function. The propagator will see a function that changes sign, but in fact it will change sign only at ascending nodes. In fact the function will correspond to +z on some orbits and -z on other orbits, the EventSlopeFilter taking care of reverting the raw function sign as needed. Due to this tampering, the event handler should not be set at the EventSlopeFilter level (otherwise its increasing boolean parameter would reflect the tampering), but it should still be set at the raw detector (here NodeDetector) level. Internally, there is a local handler at EventSlopeFilter level that knows about the g function tampering and reset the boolean properly before delegating to the raw detector event handler.

As a result, the code snippet above should always print ascending node events, it should never be called with increasing set to false. So in real code, you would not need to check the boolean, I have just set it that way in the example so you can check that indeed it is always called as you want.


super interesting!
If I were to do this on python how can I implement ‘EventSlopeFilter’? I guess I should create my own class with the function which calls the def “g”, but how?

Thanks in advance for any help


Hi Bastien,

I dont think I have used it, but you should be able to do this without python subclassing,

This would become

filter = EventSlopeFilter(rawDetector, FilterType.TRIGGER_ONLY_INCREASING_EVENTS)


Hi Petrus,

thank you very much for the reply, just a quick question, I tried like:

rawDetector = NodeDetector(inertialFrame)
filter = EventSlopeFilter(rawDetector, FilterType.TRIGGER_ONLY_INCREASING_EVENTS)
detector_ANX = filter.withHandler(myContinueOnEvent().of_(filter ))

where can i find FilterType.TRIGGER_ONLY_INCREASING_EVENTS?

thanks again for the help


Hi Bastien,

A good way to search for things is the orekit API, reachable at:

If you search there (using the browser ctrl-f) you can find the location and description. (located in


Hi Petrus and Luc,

it works! thank you very much for all the help and patience