Class EventShifter
- java.lang.Object
-
- org.orekit.propagation.events.AbstractDetector<EventShifter>
-
- org.orekit.propagation.events.EventShifter
-
- All Implemented Interfaces:
EventDetector
public class EventShifter extends AbstractDetector<EventShifter>
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:
Propagator.addEventDetector(EventDetector)
,EventDetector
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EventShifter(EventDetectionSettings detectionSettings, EventHandler handler, EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
Protected constructor with full parameters.EventShifter(EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
Build a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EventShifter
create(EventDetectionSettings detectionSettings, EventHandler newHandler)
Build a new instance.double
g(SpacecraftState s)
Compute the value of the switching function.double
getDecreasingTimeShift()
Get the decreasing events time shift.EventDetector
getDetector()
Get the detector for the raw unshifted event.double
getIncreasingTimeShift()
Get the increasing events time shift.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.-
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getDetectionSettings, getHandler, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.EventDetector
finish, getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
EventShifter
public EventShifter(EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
Build a new instance.The
max check interval
, theconvergence threshold
of the raw unshifted events will be used for the shifted event. When an event occurs, theeventOccurred
method of the raw unshifted events will be called (with spacecraft state at either the shifted or the unshifted event date depending on theuseShiftedStates
parameter).- Parameters:
detector
- event detector for the raw unshifted eventuseShiftedStates
- if true, the state provided toeventOccurred
method of the associatedhandler
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
protected EventShifter(EventDetectionSettings detectionSettings, EventHandler handler, EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
Protected constructor with full parameters.This constructor is not public as users are expected to use the builder API with the various
withXxx()
methods to set up the instance in a readable manner without using a huge amount of parameters.- Parameters:
detectionSettings
- event detection settingshandler
- event handler to call at event occurrencesdetector
- event detector for the raw unshifted eventuseShiftedStates
- if true, the state provided toeventOccurred
method of thedetector
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 Detail
-
create
protected EventShifter create(EventDetectionSettings detectionSettings, EventHandler newHandler)
Build a new instance.- Specified by:
create
in classAbstractDetector<EventShifter>
- Parameters:
detectionSettings
- detection settingsnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
getDetector
public EventDetector getDetector()
Get the detector for the raw unshifted event.- 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
-
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
This implementation sets the direction of propagation and initializes the event handler. If a subclass overrides this method it should call
super.init(s0, t)
.- Specified by:
init
in interfaceEventDetector
- Overrides:
init
in classAbstractDetector<EventShifter>
- Parameters:
s0
- initial statet
- 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.- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
-