org.orekit.propagation.events
Interface EventDetector

All Superinterfaces:
Serializable
All Known Subinterfaces:
CodingEventDetector
All Known Implementing Classes:
AbstractDetector, AbstractDetectorWithTropoCorrection, AlignmentDetector, AltitudeDetector, AnomalyDetector, AOLDetector, ApparentElevationDetector, ApsideDetector, BetaAngleDetector, CentralBodyMaskCircularFOVDetector, CircularFieldOfViewDetector, CombinedPhenomenaDetector, DateDetector, DihedralFieldOfViewDetector, DistanceDetector, EarthZoneDetector, EclipseDetector, ElevationDetector, EventShifter, ExtremaDistanceDetector, ExtremaElevationDetector, ExtremaLatitudeDetector, ExtremaLongitudeDetector, ExtremaSightAxisDetector, ExtremaThreeBodiesAngleDetector, GenericCodingEventDetector, GroundMaskElevationDetector, ImpulseManeuver, LatitudeDetector, LocalTimeDetector, LongitudeDetector, MaskingDetector, NadirSolarIncidenceDetector, NodeDetector, NthOccurrenceDetector, NullMassDetector, NullMassPartDetector, PerigeeAltitudeDetector, RFVisibilityDetector, SatToSatMutualVisibilityDetector, SensorInhibitionDetector, SensorVisibilityDetector, SolarTimeDetector, StationToSatMutualVisibilityDetector, TargetInFieldOfViewDetector, ThreeBodiesAngleDetector, VisibilityFromStationDetector

public interface EventDetector
extends Serializable

This interface represents space-dynamics aware events detectors with support for additional states.

It mirrors the EventHandler interface from 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, 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 or the future event detection.

Author:
Luc Maisonobe, Véronique Pommier-Maurussane

Nested Class Summary
static class EventDetector.Action
          Enumerate for actions to be performed when an event occurs.
 
Field Summary
static int DECREASING
          Decreasing g-function related events parameter.
static int INCREASING
          Increasing g-function related events parameter.
static int INCREASING_DECREASING
          Both increasing and decreasing g-function related events parameter.
 
Method Summary
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          Handle an event and choose what to do next.
 double g(SpacecraftState s)
          Compute the value of the switching function.
 double getMaxCheckInterval()
          Get maximal time interval between switching function checks.
 int getMaxIterationCount()
          Get maximal number of iterations in the event time search.
 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.
 SpacecraftState resetState(SpacecraftState oldState)
          Reset the state (including additional states) prior to continue propagation.
 boolean shouldBeRemoved()
          This method is called after eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 

Field Detail

INCREASING

static final int INCREASING
Increasing g-function related events parameter.

See Also:
Constant Field Values

DECREASING

static final int DECREASING
Decreasing g-function related events parameter.

See Also:
Constant Field Values

INCREASING_DECREASING

static final int INCREASING_DECREASING
Both increasing and decreasing g-function related events parameter.

See Also:
Constant Field Values
Method Detail

init

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.

Parameters:
s0 - initial state
t - target time for the integration

g

double g(SpacecraftState s)
         throws OrekitException
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 for forces and events computation, mass provider, and additional states
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

eventOccurred

EventDetector.Action eventOccurred(SpacecraftState s,
                                   boolean increasing,
                                   boolean forward)
                                   throws OrekitException
Handle an event and choose what to do next.

The scheduling between this method and the OrekitStepHandler method handleStep(interpolator, isLast) 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.

Parameters:
s - the current state information: date, kinematics, attitude for forces and events computation, mass provider, and additional states
increasing - 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.
Returns:
one of EventDetector.Action.STOP, EventDetector.Action.RESET_STATE, EventDetector.Action.RESET_DERIVATIVES, EventDetector.Action.CONTINUE
Throws:
OrekitException - if some specific error occurs

shouldBeRemoved

boolean shouldBeRemoved()
This method is called after eventOccurred(org.orekit.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.

Returns:
true if the current detector should be removed after first event detection

resetState

SpacecraftState resetState(SpacecraftState oldState)
                           throws OrekitException
Reset the state (including additional states) prior to continue propagation.

This method is called after the step handler has returned and before the next step is started, but only when eventOccurred(org.orekit.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 eventOccurred(org.orekit.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.

Parameters:
oldState - old state
Returns:
new state
Throws:
OrekitException - if the state cannot be reseted

getThreshold

double getThreshold()
Get the convergence threshold in the event time search.

Returns:
convergence threshold (s)

getMaxCheckInterval

double getMaxCheckInterval()
Get maximal time interval between switching function checks.

Returns:
maximal time interval (s) between switching function checks

getMaxIterationCount

int getMaxIterationCount()
Get maximal number of iterations in the event time search.

Returns:
maximal number of iterations in the event time search

getSlopeSelection

int getSlopeSelection()
Get the parameter in charge of the selection of detected events by the slope of the g-function.

Returns:
EventDetector.INCREASING (0): events related to the increasing g-function;
EventDetector.DECREASING (1): events related to the decreasing g-function;
EventDetector.INCREASING_DECREASING (2): events related to both increasing and decreasing g-function.


Copyright © 2016 CNES. All Rights Reserved.