Class FieldEventSlopeFilter<D extends FieldEventDetector<T>,T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldAbstractDetector<FieldEventSlopeFilter<D,T>,T>
-
- org.orekit.propagation.events.FieldEventSlopeFilter<D,T>
-
- Type Parameters:
D
- type of the detectorT
- type of the field elements
- All Implemented Interfaces:
FieldEventDetector<T>
public class FieldEventSlopeFilter<D extends FieldEventDetector<T>,T extends CalculusFieldElement<T>> extends FieldAbstractDetector<FieldEventSlopeFilter<D,T>,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 (
FieldAbsoluteDate
,FieldSpacecraftState
).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 aFieldPropagator
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:
FieldEventEnablingPredicateFilter
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_CHECK, DEFAULT_MAX_ITER, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Modifier Constructor Description FieldEventSlopeFilter(D rawDetector, FilterType filter)
Wrap anevent detector
.protected
FieldEventSlopeFilter(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> handler, D rawDetector, FilterType filter)
Protected constructor with full parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FieldEventSlopeFilter<D,T>
create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Build a new instance.T
g(FieldSpacecraftState<T> s)
Compute the value of the switching function.D
getDetector()
Get the wrapped raw detector.void
init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t)
Initialize event handler at the start of a propagation.-
Methods inherited from class org.orekit.propagation.events.FieldAbstractDetector
getDetectionSettings, getHandler, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
-
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.FieldEventDetector
finish, getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
FieldEventSlopeFilter
public FieldEventSlopeFilter(D rawDetector, FilterType filter)
Wrap anevent detector
.- Parameters:
rawDetector
- event detector to wrapfilter
- filter to use
-
FieldEventSlopeFilter
protected FieldEventSlopeFilter(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> handler, D rawDetector, FilterType filter)
Protected constructor with full parameters.This constructor is not public as users are expected to use the builder API with the various
withXxx()
methods to set up the instance in a readable manner without using a huge amount of parameters.- Parameters:
detectionSettings
- event detection settingshandler
- event handler to call at event occurrencesrawDetector
- event detector to wrapfilter
- filter to use since 13.0
-
-
Method Detail
-
create
protected FieldEventSlopeFilter<D,T> create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Build a new instance.- Specified by:
create
in classFieldAbstractDetector<FieldEventSlopeFilter<D extends FieldEventDetector<T>,T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
detectionSettings
- detection settingsnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
getDetector
public D getDetector()
Get the wrapped raw detector.- Returns:
- the wrapped raw detector
-
init
public void init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> 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 initializes the handler.
- Specified by:
init
in interfaceFieldEventDetector<D extends FieldEventDetector<T>>
- Overrides:
init
in classFieldAbstractDetector<FieldEventSlopeFilter<D extends FieldEventDetector<T>,T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
s0
- initial statet
- target time for the integration
-
g
public T g(FieldSpacecraftState<T> 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.- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
-