Class PythonEventDetector

  • All Implemented Interfaces:
    EventDetector

    public class PythonEventDetector
    extends Object
    implements EventDetector
    This interface represents space-dynamics aware events detectors.

    It mirrors the EventHandler interface from Apache Commons Math but provides a space-dynamics interface to the methods.

    Events detectors are a useful solution to meet the requirements of propagators concerning discrete conditions. The state of each event detector is queried by the integrator at each step. When the sign of the underlying g switching function changes, the step is rejected and reduced, in order to make sure the sign changes occur only at steps boundaries.

    When step ends exactly at a switching function sign change, the corresponding event is triggered, by calling the eventOccurred(SpacecraftState, boolean) method. The method can do whatever it needs with the event (logging it, performing some processing, ignore it ...). The return value of the method will be used by the propagator to stop or resume propagation, possibly changing the state vector.

    Author:
    Luc Maisonobe, Véronique Pommier-Maurussane
    • Constructor Detail

      • PythonEventDetector

        public PythonEventDetector()
    • Method Detail

      • pythonExtension

        public void pythonExtension​(long pythonObject)
        Part of JCC Python interface to object
      • pythonExtension

        public long pythonExtension()
        Part of JCC Python interface to object
      • pythonDecRef

        public void pythonDecRef()
        Part of JCC Python interface to object
      • init

        public void init​(SpacecraftState s0,
                         AbsoluteDate t)
        Initialize event handler at the start of a propagation.

        This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.

        The default implementation does nothing

        Specified by:
        init in interface EventDetector
        Parameters:
        s0 - initial state
        t - target time for the integration
      • g

        public double g​(SpacecraftState s)
        Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.
        Specified by:
        g in interface EventDetector
        Parameters:
        s - the current state information: date, kinematics, attitude
        Returns:
        value of the switching function
      • getThreshold

        public double getThreshold()
        Get the convergence threshold in the event time search.
        Specified by:
        getThreshold in interface EventDetector
        Returns:
        convergence threshold (s)
      • getMaxCheckInterval

        public double getMaxCheckInterval()
        Get maximal time interval between switching function checks.
        Specified by:
        getMaxCheckInterval in interface EventDetector
        Returns:
        maximal time interval (s) between switching function checks
      • getMaxIterationCount

        public int getMaxIterationCount()
        Get maximal number of iterations in the event time search.
        Specified by:
        getMaxIterationCount in interface EventDetector
        Returns:
        maximal number of iterations in the event time search
      • eventOccurred

        public Action eventOccurred​(SpacecraftState s,
                                    boolean increasing)
        Handle the event.
        Specified by:
        eventOccurred in interface EventDetector
        Parameters:
        s - SpaceCraft state to be used in the evaluation
        increasing - with the event occurred in an "increasing" or "decreasing" slope direction
        Returns:
        the Action that the calling detector should pass back to the evaluation system