Class FieldEventEnablingPredicateFilter<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldAbstractDetector<FieldEventEnablingPredicateFilter<T>,T>
-
- org.orekit.propagation.events.FieldEventEnablingPredicateFilter<T>
-
- Type Parameters:
T
- type of the field elements
- All Implemented Interfaces:
FieldEventDetector<T>
public class FieldEventEnablingPredicateFilter<T extends CalculusFieldElement<T>> extends FieldAbstractDetector<FieldEventEnablingPredicateFilter<T>,T>
Wrapper used to detect events only when enabled by an external predicated function.General
events
are defined implicitly by ag function
crossing zero. This implies that during an orbit propagation, events are triggered at all zero crossings.Sometimes, users would like to enable or disable events by themselves, for example to trigger them only for certain orbits, or to check elevation maximums only when elevation itself is positive (i.e. they want to discard elevation maximums below ground). 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 the see only the interesting events, i.e. either only events that occur when a user-provided event enabling predicate function is true, ignoring all events that occur when the event enabling predicate function is false. The number of calls to theg function
will also be reduced.- Since:
- 12.0
- See Also:
FieldEventSlopeFilter
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldEventEnablingPredicateFilter(FieldAdaptableInterval<T> maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)
Protected constructor with full parameters.FieldEventEnablingPredicateFilter(FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)
Wrap anevent detector
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FieldEventEnablingPredicateFilter<T>
create(FieldAdaptableInterval<T> newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<T> newHandler)
Build a new instance.T
g(FieldSpacecraftState<T> s)
Compute the value of the switching function.FieldEventDetector<T>
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
create, getDetectionSettings, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, 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
-
-
-
-
Constructor Detail
-
FieldEventEnablingPredicateFilter
public FieldEventEnablingPredicateFilter(FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)
Wrap anevent detector
.- Parameters:
rawDetector
- event detector to wrapenabler
- event enabling predicate function to use
-
FieldEventEnablingPredicateFilter
protected FieldEventEnablingPredicateFilter(FieldAdaptableInterval<T> maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)
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:
maxCheck
- maximum checking intervalthreshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrencesrawDetector
- event detector to wrapenabler
- event enabling function to use
-
-
Method Detail
-
create
protected FieldEventEnablingPredicateFilter<T> create(FieldAdaptableInterval<T> newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<T> newHandler)
Build a new instance.- Specified by:
create
in classFieldAbstractDetector<FieldEventEnablingPredicateFilter<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
newMaxCheck
- maximum checking intervalnewThreshold
- 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
-
getDetector
public FieldEventDetector<T> 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 does nothing
- Specified by:
init
in interfaceFieldEventDetector<T extends CalculusFieldElement<T>>
- Overrides:
init
in classFieldAbstractDetector<FieldEventEnablingPredicateFilter<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
-
-