Class EventShifter

java.lang.Object
org.orekit.propagation.events.EventShifter
All Implemented Interfaces:
DetectorModifier, EventDetector

public class EventShifter extends Object implements DetectorModifier
Wrapper shifting events occurrences times.

This class wraps an event detector to slightly shift the events occurrences times. A typical use case is for handling operational delays before or after some physical event really occurs.

For example, the satellite attitude mode may be switched from sun pointed to spin-stabilized a few minutes before eclipse entry, and switched back to sun pointed a few minutes after eclipse exit. This behavior is handled by wrapping an eclipse detector into an instance of this class with a positive times shift for increasing events (eclipse exit) and a negative times shift for decreasing events (eclipse entry).

Author:
Luc Maisonobe
See Also:
  • Constructor Details

    • EventShifter

      public EventShifter(EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
      Build a new instance.

      The max check interval, the convergence threshold of the raw unshifted events will be used for the shifted event. When an event occurs, the eventOccurred method of the raw unshifted events will be called (with spacecraft state at either the shifted or the unshifted event date depending on the useShiftedStates parameter).

      Parameters:
      detector - event detector for the raw unshifted event
      useShiftedStates - if true, the state provided to eventOccurred method of the associated handler will remain shifted, otherwise it will be unshifted to correspond to the underlying raw event.
      increasingTimeShift - increasing events time shift.
      decreasingTimeShift - decreasing events time shift.
    • EventShifter

      public EventShifter(EventDetectionSettings detectionSettings, EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
      Constructor with full parameters.
      Parameters:
      detectionSettings - event detection settings
      detector - event detector for the raw unshifted event
      useShiftedStates - if true, the state provided to eventOccurred method of the detector will remain shifted, otherwise it will be unshifted to correspond to the underlying raw event.
      increasingTimeShift - increasing events time shift.
      decreasingTimeShift - decreasing events time shift.
      Since:
      13.0
  • Method Details

    • getHandler

      public EventHandler getHandler()
      Get the handler.
      Specified by:
      getHandler in interface DetectorModifier
      Specified by:
      getHandler in interface EventDetector
      Returns:
      event handler to call at event occurrences
    • getEventFunction

      public EventFunction getEventFunction()
      Get the event function. It defines g both for double and Field.
      Specified by:
      getEventFunction in interface DetectorModifier
      Specified by:
      getEventFunction in interface EventDetector
      Returns:
      event function
    • getDetectionSettings

      public EventDetectionSettings getDetectionSettings()
      Getter for the settings.
      Specified by:
      getDetectionSettings in interface DetectorModifier
      Specified by:
      getDetectionSettings in interface EventDetector
      Returns:
      detection settings
    • getDetector

      public EventDetector getDetector()
      Get the detector for the raw unshifted event.
      Specified by:
      getDetector in interface DetectorModifier
      Returns:
      the detector for the raw unshifted event
      Since:
      11.1
    • getIncreasingTimeShift

      public double getIncreasingTimeShift()
      Get the increasing events time shift.
      Returns:
      increasing events time shift
    • getDecreasingTimeShift

      public double getDecreasingTimeShift()
      Get the decreasing events time shift.
      Returns:
      decreasing events time shift
    • isUseShiftedStates

      public boolean isUseShiftedStates()
      Getter for shifted states in handler flag.
      Returns:
      flag
      Since:
      14.0
    • withDetectionSettings

      public EventShifter withDetectionSettings(EventDetectionSettings settings)
      Builds a new instance from the input detection settings.
      Parameters:
      settings - event detection settings to be used
      Returns:
      a new detector