T
- class type for the generic versionpublic class EventShifter<T extends EventDetector> extends AbstractDetector<EventShifter<T>>
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).
Propagator.addEventDetector(EventDetector)
,
EventDetector
,
Serialized FormDEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Constructor and Description |
---|
EventShifter(T detector,
boolean useShiftedStates,
double increasingTimeShift,
double decreasingTimeShift)
Build a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected EventShifter<T> |
create(double newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler<? super EventShifter<T>> newHandler)
Build a new instance.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
double |
getDecreasingTimeShift()
Get the decreasing events time shift.
|
double |
getIncreasingTimeShift()
Get the increasing events time shift.
|
void |
init(SpacecraftState s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
public EventShifter(T detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
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).
detector
- event detector for the raw unshifted eventuseShiftedStates
- 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.protected EventShifter<T> create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super EventShifter<T>> newHandler)
create
in class AbstractDetector<EventShifter<T extends EventDetector>>
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrencespublic double getIncreasingTimeShift()
public double getDecreasingTimeShift()
public void init(SpacecraftState s0, AbsoluteDate t)
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
init
in interface EventDetector
init
in class AbstractDetector<EventShifter<T extends EventDetector>>
s0
- initial statet
- target time for the integrationpublic double g(SpacecraftState s) throws OrekitException
g
in interface EventDetector
g
in class AbstractDetector<EventShifter<T extends EventDetector>>
s
- the current state information: date, kinematics, attitudeOrekitException
- if some specific error occursCopyright © 2002-2017 CS Systèmes d'information. All rights reserved.