Package org.orekit.propagation.events
Class FieldDateDetector<T extends org.hipparchus.RealFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldAbstractDetector<FieldDateDetector<T>,T>
-
- org.orekit.propagation.events.FieldDateDetector<T>
-
- All Implemented Interfaces:
FieldEventDetector<T>
,FieldTimeStamped<T>
public class FieldDateDetector<T extends org.hipparchus.RealFieldElement<T>> extends FieldAbstractDetector<FieldDateDetector<T>,T> implements FieldTimeStamped<T>
Finder for date events.This class finds date events (i.e. occurrence of some predefined dates).
As of version 5.1, it is an enhanced date detector:
- it can be defined without prior date (
FieldDateDetector(RealFieldElement, RealFieldElement, FieldTimeStamped...)
) - several dates can be added (
addEventDate(FieldAbsoluteDate)
)
The gap between the added dates must be more than the maxCheck.
The default implementation behavior is to
stop
propagation at the first event date occurrence. This can be changed by callingFieldAbstractDetector.withHandler(FieldEventHandler)
after construction.- Author:
- Luc Maisonobe, Pascal Parraud
- See Also:
FieldPropagator.addEventDetector(FieldEventDetector)
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description FieldDateDetector(FieldAbsoluteDate<T> target)
Build a new instance.FieldDateDetector(T maxCheck, T threshold, FieldTimeStamped<T>... dates)
Build a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventDate(FieldAbsoluteDate<T> target)
Add an event date.protected FieldDateDetector<T>
create(T newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<? super FieldDateDetector<T>,T> newHandler)
Build a new instance.T
g(FieldSpacecraftState<T> s)
Compute the value of the switching function.FieldAbsoluteDate<T>
getDate()
Get the current event date according to the propagator.-
Methods inherited from class org.orekit.propagation.events.FieldAbstractDetector
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
-
-
-
-
Constructor Detail
-
FieldDateDetector
@SafeVarargs public FieldDateDetector(T maxCheck, T threshold, FieldTimeStamped<T>... dates)
Build a new instance.First event dates are set here, but others can be added later with
addEventDate(FieldAbsoluteDate)
.- Parameters:
maxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)dates
- list of event dates- See Also:
addEventDate(FieldAbsoluteDate)
-
FieldDateDetector
public FieldDateDetector(FieldAbsoluteDate<T> target)
Build a new instance.This constructor is dedicated to single date detection.
max check interval
is set to 1.0e10, so almost no other date can be added. Tolerance is set to 1.0e-9.- Parameters:
target
- target date- See Also:
addEventDate(FieldAbsoluteDate)
-
-
Method Detail
-
create
protected FieldDateDetector<T> create(T newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<? super FieldDateDetector<T>,T> newHandler)
Build a new instance.- Specified by:
create
in classFieldAbstractDetector<FieldDateDetector<T extends org.hipparchus.RealFieldElement<T>>,T extends org.hipparchus.RealFieldElement<T>>
- 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
-
g
public T g(FieldSpacecraftState<T> s)
Compute the value of the switching function. This function measures the difference between the current and the target date.- Specified by:
g
in interfaceFieldEventDetector<T extends org.hipparchus.RealFieldElement<T>>
- Specified by:
g
in classFieldAbstractDetector<FieldDateDetector<T extends org.hipparchus.RealFieldElement<T>>,T extends org.hipparchus.RealFieldElement<T>>
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
getDate
public FieldAbsoluteDate<T> getDate()
Get the current event date according to the propagator.- Specified by:
getDate
in interfaceFieldTimeStamped<T extends org.hipparchus.RealFieldElement<T>>
- Returns:
- event date
-
addEventDate
public void addEventDate(FieldAbsoluteDate<T> target) throws IllegalArgumentException
Add an event date.The date to add must be:
- less than the smallest already registered event date minus the maxCheck
- or more than the largest already registered event date plus the maxCheck
- Parameters:
target
- target date- Throws:
IllegalArgumentException
- if the date is too close from already defined interval- See Also:
FieldDateDetector(RealFieldElement, RealFieldElement, FieldTimeStamped...)
-
-