public abstract class AbstractDetector extends Object implements EventDetector
Propagator.addEventDetector(EventDetector),
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractDetector.PropagationDelayType
Propagation delay type.
|
EventDetector.Action| Modifier and Type | Field and Description |
|---|---|
protected EventDetector.Action |
actionAtEntry
Action performed at entry
|
protected EventDetector.Action |
actionAtExit
Action performed at exit
|
static double |
DEFAULT_MAXCHECK
Default maximum checking interval (s).
|
static double |
DEFAULT_THRESHOLD
Default convergence threshold (s).
|
protected boolean |
removeAtEntry
True if detector should be removed at entry
|
protected boolean |
removeAtExit
True if detector should be removed at exit
|
protected boolean |
shouldBeRemovedFlag
True if detector should be removed (updated by eventOccured)
|
DECREASING, INCREASING, INCREASING_DECREASING| Constructor and Description |
|---|
AbstractDetector(double maxCheckIn,
double thresholdIn)
Build a new instance.
|
AbstractDetector(double maxCheckIn,
double thresholdIn,
EventDetector.Action actionAtEntryIn,
EventDetector.Action actionAtExitIn,
boolean removeAtEntryIn,
boolean removeAtExitIn)
Build a new instance.
|
AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn)
Build a new instance.
|
AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn,
EventDetector.Action actionIn,
boolean removeIn)
Build a new instance.
|
AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn,
EventDetector.Action actionAtEntryIn,
EventDetector.Action actionAtExitIn,
boolean removeAtEntryIn,
boolean removeAtExitIn)
Build a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
EventDetector.Action |
eventOccurred(SpacecraftState s,
boolean increasing,
boolean forward)
Handle an event and choose what to do next.
|
abstract double |
g(SpacecraftState s)
Compute the value of the switching function.
|
EventDetector.Action |
getActionAtEntry() |
EventDetector.Action |
getActionAtExit() |
Frame |
getInertialFrame()
Gets the inertial frame used for signal propagation computation.
|
double |
getMaxCheckInterval()
Get maximal time interval between switching function checks.
|
int |
getMaxIterationCount()
Get maximal number of iterations in the event time search.
|
AbstractDetector.PropagationDelayType |
getPropagationDelayType()
Returns the propagation delay type.
|
protected AbsoluteDate |
getSignalEmissionDate(PVCoordinatesProvider emitter,
PVCoordinatesProvider orbit,
AbsoluteDate date,
double epsilon)
Compute signal emission date which is the date at which the signal received by the spacecraft (receiver) has been
emitted by the emitter depending on
AbstractDetector.PropagationDelayType. |
protected AbsoluteDate |
getSignalReceptionDate(PVCoordinatesProvider receiver,
PVCoordinatesProvider orbit,
AbsoluteDate date,
double epsilon)
Compute signal reception date which is the date at which the signal emitted by the spacecraft (emitter) has been
received by the receiver depending on
AbstractDetector.PropagationDelayType. |
int |
getSlopeSelection()
Get the parameter in charge of the selection of detected events by the slope of the
g-function.
|
double |
getThreshold()
Get the convergence threshold in the event time search.
|
void |
init(SpacecraftState s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
boolean |
isRemoveAtEntry() |
boolean |
isRemoveAtExit() |
static SpacecraftState |
logEventsOverTimeInterval(CodedEventsLogger eventsLogger,
Propagator satProp,
CodingEventDetector detector,
AbsoluteDateInterval interval)
Log detected events on a given time interval into the entered events logger.
|
SpacecraftState |
resetState(SpacecraftState oldState)
Reset the state (including additional states) prior to continue propagation.
|
void |
setMaxCheckInterval(double maxCheckIn)
Setter for the max check interval.
|
protected void |
setPropagationDelayType(AbstractDetector.PropagationDelayType propagationDelayTypeIn,
Frame frameIn)
Setter for propagation delay computation type.
|
boolean |
shouldBeRemoved()
This method is called after
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has been triggered. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopypublic static final double DEFAULT_MAXCHECK
public static final double DEFAULT_THRESHOLD
protected EventDetector.Action actionAtEntry
protected EventDetector.Action actionAtExit
protected boolean removeAtEntry
protected boolean removeAtExit
protected boolean shouldBeRemovedFlag
public AbstractDetector(double maxCheckIn,
double thresholdIn)
maxCheckIn - maximum checking interval (s)thresholdIn - convergence threshold (s)public AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn)
slopeSelectionIn - g-function slope selection (0, 1, or 2)maxCheckIn - maximum checking interval (s)thresholdIn - convergence threshold (s)public AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn,
EventDetector.Action actionIn,
boolean removeIn)
slopeSelectionIn - g-function slope selection (0, 1, or 2)maxCheckIn - maximum checking interval (s)thresholdIn - convergence threshold (s)actionIn - action performed when entering/exiting the eclipse depending on slope selectionremoveIn - when the spacecraft point enters or exit the zone depending on slope selectionpublic AbstractDetector(double maxCheckIn,
double thresholdIn,
EventDetector.Action actionAtEntryIn,
EventDetector.Action actionAtExitIn,
boolean removeAtEntryIn,
boolean removeAtExitIn)
maxCheckIn - maximum checking interval (s)thresholdIn - convergence threshold (s)actionAtEntryIn - action performed at increasing event detectionactionAtExitIn - action performed at decreasing event detectionremoveAtEntryIn - states if the detector should be removed at increasing event detectionremoveAtExitIn - states if the detector should be removed at decreasing event detectionpublic AbstractDetector(int slopeSelectionIn,
double maxCheckIn,
double thresholdIn,
EventDetector.Action actionAtEntryIn,
EventDetector.Action actionAtExitIn,
boolean removeAtEntryIn,
boolean removeAtExitIn)
slopeSelectionIn - g-function slope selection (0, 1, or 2)maxCheckIn - maximum checking interval (s)thresholdIn - convergence threshold (s)actionAtEntryIn - action performed at increasing event detectionactionAtExitIn - action performed at decreasing event detectionremoveAtEntryIn - states if the detector should be removed at increasing event detectionremoveAtExitIn - states if the detector should be removed at decreasing event detectionpublic void init(SpacecraftState s0, AbsoluteDate t) throws PatriusException
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.
init in interface EventDetectors0 - initial statet - target time for the integrationPatriusException - thrown if initialization failedpublic boolean shouldBeRemoved()
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the
current detector should be removed after first event detection. WARNING: this method
can be called only once a event has been triggered. Before, the value is not available.shouldBeRemoved in interface EventDetectorpublic EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward) throws PatriusException
The scheduling between this method and the PatriusStepHandler method handleStep() is to call this method first
and handleStep afterwards. This scheduling allows the propagator to pass true as the
isLast parameter to the step handler to make it aware the step will be the last one if this method
returns EventDetector.Action.STOP. As the interpolator may be used to navigate back throughout the last
step (as OrekitStepNormalizer does for example), user code called by this method and user code called by step handlers
may experience apparently out of order values of the independent time variable. As an example, if the same user
object implements both this EventDetector interface and the OrekitFixedStepHandler interface, a forward integration may call its eventOccurred method
with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at
2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for
variable step handlers and to the size of
the fixed step for fixed step
handlers.
eventOccurred in interface EventDetectors - the current state information: date, kinematics, attitude for forces and events
computation, mass provider, and additional statesincreasing - if true, the value of the switching function increases when times increases
around event (note that increase is measured with respect to physical time, not with
respect to propagation which may go backward in time)forward - if true, the integration variable (time) increases during integration.EventDetector.Action.STOP, EventDetector.Action.RESET_STATE,
EventDetector.Action.RESET_DERIVATIVES, EventDetector.Action.CONTINUEPatriusException - if some specific error occurspublic abstract double g(SpacecraftState s) throws PatriusException
g in interface EventDetectors - the current state information: date, kinematics, attitude for forces and events
computation, mass provider, and additional statesPatriusException - if some specific error occurspublic double getMaxCheckInterval()
getMaxCheckInterval in interface EventDetectorpublic int getMaxIterationCount()
getMaxIterationCount in interface EventDetectorpublic double getThreshold()
getThreshold in interface EventDetectorpublic EventDetector.Action getActionAtEntry()
public EventDetector.Action getActionAtExit()
public boolean isRemoveAtEntry()
public boolean isRemoveAtExit()
public SpacecraftState resetState(SpacecraftState oldState) throws PatriusException
This method is called after the step handler has returned and before the next step is started, but only when
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has itself returned the EventDetector.Action.RESET_STATE indicator. It allows the
user to reset the state for the next step, without perturbing the step handler of the finishing step. If the
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) never returns the EventDetector.Action.RESET_STATE indicator, this function will
never be called, and it is safe to simply return null.
resetState in interface EventDetectoroldState - old statePatriusException - if the state cannot be resetedpublic int getSlopeSelection()
getSlopeSelection in interface EventDetectorprotected AbsoluteDate getSignalEmissionDate(PVCoordinatesProvider emitter, PVCoordinatesProvider orbit, AbsoluteDate date, double epsilon) throws PatriusException
AbstractDetector.PropagationDelayType.emitter - emitterorbit - orbit of the spacecraft (receiver)date - date at which the spacecraft orbit is definedepsilon - absolute duration threshold used for convergence of signal propagation computation. The epsilon is
a time absolute error (ex: 1E-14s, in this case, the signal distance accuracy is 1E-14s x 3E8m/s = 3E-6m).PatriusException - thrown if computation failedprotected AbsoluteDate getSignalReceptionDate(PVCoordinatesProvider receiver, PVCoordinatesProvider orbit, AbsoluteDate date, double epsilon) throws PatriusException
AbstractDetector.PropagationDelayType.receiver - receiverorbit - orbit of the spacecraft (emitter)date - date at which the spacecraft orbit is definedepsilon - absolute duration threshold used for convergence of signal propagation computation. The epsilon is
a time absolute error (ex: 1E-14s, in this case, the signal distance accuracy is 1E-14s x 3E8m/s = 3E-6m).PatriusException - thrown if computation failedpublic AbstractDetector.PropagationDelayType getPropagationDelayType()
public Frame getInertialFrame()
protected void setPropagationDelayType(AbstractDetector.PropagationDelayType propagationDelayTypeIn, Frame frameIn)
propagationDelayTypeIn - propagation delay type used in events computationframeIn - frame to use for signal propagation with delay (may be null if propagation delay type is
considered instantaneous). Warning: the usage of a pseudo inertial frame is tolerated, however it will
lead to some inaccuracies due to the non-invariance of the frame with respect to time. For this reason,
it is suggested to use the ICRF frame or a frame which is frozen with respect to the ICRF.IllegalArgumentException - if the provided frame is not pseudo inertial.public void setMaxCheckInterval(double maxCheckIn)
maxCheckIn - the max check interval to setpublic static SpacecraftState logEventsOverTimeInterval(CodedEventsLogger eventsLogger, Propagator satProp, CodingEventDetector detector, AbsoluteDateInterval interval) throws PatriusException
eventsLogger - input events logger in which the events must be recordedsatProp - spacecraft orbit propagatordetector - detector to be monitoredinterval - time interval on which the events are looked forPatriusException - if spacecraft state cannot be propagatedCopyright © 2022 CNES. All rights reserved.