Class EventSlopeFilter<T extends EventDetector>
- java.lang.Object
-
- org.orekit.propagation.events.EventSlopeFilter<T>
-
- Type Parameters:
T
- type of the detector
- All Implemented Interfaces:
EventDetector
public class EventSlopeFilter<T extends EventDetector> extends Object implements EventDetector
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
-
-
Constructor Summary
Constructors Constructor Description EventSlopeFilter(EventDetectionSettings detectionSettings, T rawDetector, FilterType filterType)
Constructor with full parameters.EventSlopeFilter(T rawDetector, FilterType filter)
Wrap anevent detector
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
finish(SpacecraftState state)
This method finalizes the event detector's job.double
g(SpacecraftState s)
Compute the value of the switching function.EventDetectionSettings
getDetectionSettings()
Getter for the settings.T
getDetector()
Get the wrapped raw detector.FilterType
getFilter()
Deprecated.since 13.0 (use getFilterType)FilterType
getFilterType()
Get filter type.EventHandler
getHandler()
Get the handler.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event detector at the start of a propagation.boolean
isForward()
Check if the current propagation is forward or backward.void
reset(SpacecraftState state, AbsoluteDate target)
Reset the event detector during propagation when the state is modified by an event or an additional data provider.EventSlopeFilter<T>
withDetectionSettings(EventDetectionSettings settings)
Builds a new instance from the input detection settings.-
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
getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
EventSlopeFilter
public EventSlopeFilter(T rawDetector, FilterType filter)
Wrap anevent detector
.- Parameters:
rawDetector
- event detector to wrapfilter
- filter to use
-
EventSlopeFilter
public EventSlopeFilter(EventDetectionSettings detectionSettings, T rawDetector, FilterType filterType)
Constructor with full parameters.- Parameters:
detectionSettings
- event detection settingsrawDetector
- event detector to wrapfilterType
- filter to use- Since:
- 13.0
-
-
Method Detail
-
getHandler
public EventHandler getHandler()
Get the handler.- Specified by:
getHandler
in interfaceEventDetector
- Returns:
- event handler to call at event occurrences
-
getDetectionSettings
public EventDetectionSettings getDetectionSettings()
Description copied from interface:EventDetector
Getter for the settings.- Specified by:
getDetectionSettings
in interfaceEventDetector
- Returns:
- detection settings
-
withDetectionSettings
public EventSlopeFilter<T> withDetectionSettings(EventDetectionSettings settings)
Builds a new instance from the input detection settings.- Parameters:
settings
- event detection settings to be used- Returns:
- a new detector
-
getDetector
public T getDetector()
Get the wrapped raw detector.- Returns:
- the wrapped raw detector
- Since:
- 11.1
-
getFilter
@Deprecated public FilterType getFilter()
Deprecated.since 13.0 (use getFilterType)Get filter type.- Returns:
- filter type
-
getFilterType
public FilterType getFilterType()
Get filter type.- Returns:
- filter type
- Since:
- 13.0
-
init
public void init(SpacecraftState s0, AbsoluteDate t)
Initialize event detector 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 initializes the handler.
- Specified by:
init
in interfaceEventDetector
- Parameters:
s0
- initial statet
- target time for the integration
-
reset
public void reset(SpacecraftState state, AbsoluteDate target)
Reset the event detector during propagation when the state is modified by an event or an additional data provider.The default implementation does nothing.
- Specified by:
reset
in interfaceEventDetector
- Parameters:
state
- current statetarget
- target time for the integration
-
finish
public void finish(SpacecraftState state)
This method finalizes the event detector's job.- Specified by:
finish
in interfaceEventDetector
- Parameters:
state
- state at propagation end
-
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
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
isForward
public boolean isForward()
Check if the current propagation is forward or backward.- Returns:
- true if the current propagation is forward
-
-