Class EventSlopeFilter<T extends EventDetector>
- java.lang.Object
-
- org.orekit.propagation.events.AbstractDetector<EventSlopeFilter<T>>
-
- org.orekit.propagation.events.EventSlopeFilter<T>
-
- All Implemented Interfaces:
Serializable
,EventDetector
public class EventSlopeFilter<T extends EventDetector> extends AbstractDetector<EventSlopeFilter<T>>
Wrapper used to detect only increasing or decreasing events.This class is heavily based on the class EventFilter from the Hipparchus library. The changes performed consist in replacing raw types (double and double arrays) with space dynamics types (
AbsoluteDate
,SpacecraftState
).General
events
are defined implicitly by ag function
crossing zero. This function needs to be continuous in the event neighborhood, and its sign must remain consistent between events. This implies that during an orbit propagation, events triggered are alternately events for which the function increases from negative to positive values, and events for which the function decreases from positive to negative values.Sometimes, users are only interested in one type of event (say increasing events for example) and not in the other type. In these cases, looking precisely for all events location and triggering events that will later be ignored is a waste of computing time.
Users can wrap a regular
event detector
in an instance of this class and provide this wrapping instance to aPropagator
in order to avoid wasting time looking for uninteresting events. The wrapper will intercept the calls to theg function
and to theeventOccurred
method in order to ignore uninteresting events. The wrapped regularevent detector
will then see only the interesting events, i.e. either onlyincreasing
events or onlydecreasing
events. The number of calls to theg function
will also be reduced.- See Also:
EventEnablingPredicateFilter
, Serialized Form
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description EventSlopeFilter(T rawDetector, FilterType filter)
Wrap anevent detector
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EventSlopeFilter<T>
create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super EventSlopeFilter<T>> newHandler)
Build a new instance.double
g(SpacecraftState s)
Compute the value of the switching function.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.-
Methods inherited from class org.orekit.propagation.events.AbstractDetector
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
-
-
-
-
Constructor Detail
-
EventSlopeFilter
public EventSlopeFilter(T rawDetector, FilterType filter)
Wrap anevent detector
.- Parameters:
rawDetector
- event detector to wrapfilter
- filter to use
-
-
Method Detail
-
create
protected EventSlopeFilter<T> create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super EventSlopeFilter<T>> newHandler)
Build a new instance.- Specified by:
create
in classAbstractDetector<EventSlopeFilter<T extends EventDetector>>
- Parameters:
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 occurrences- Returns:
- a new instance of the appropriate sub-type
-
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<EventSlopeFilter<T extends EventDetector>>
- 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.- Specified by:
g
in interfaceEventDetector
- Specified by:
g
in classAbstractDetector<EventSlopeFilter<T extends EventDetector>>
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
-