Package org.orekit.propagation.events
Class FieldDateDetector<T extends CalculusFieldElement<T>>
java.lang.Object
org.orekit.propagation.events.FieldAbstractDetector<FieldDateDetector<T>,T>
org.orekit.propagation.events.FieldDateDetector<T>
- Type Parameters:
T- type of the field elements
- All Implemented Interfaces:
FieldEventDetector<T>,FieldTimeStamped<T>
public class FieldDateDetector<T extends CalculusFieldElement<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(Field, FieldTimeStamped...)) - several dates can be added (
addEventDate(FieldAbsoluteDate))
The gap between the added dates must be more than the minGap.
The default implementation behavior is to stop
propagation at the first event date occurrence. This can be changed by calling
FieldAbstractDetector.withHandler(FieldEventHandler) after construction.
- Author:
- Luc Maisonobe, Pascal Parraud
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault value for max check.static final doubleDefault value for minimum gap between added dates.static final doubleDefault value for convergence threshold.Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_ITER -
Constructor Summary
ConstructorsModifierConstructorDescriptionFieldDateDetector(Field<T> field, FieldTimeStamped<T>... dates) Build a new instance.protectedFieldDateDetector(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> handler, double minGap, FieldTimeStamped<T>... dates) Protected constructor with full parameters.FieldDateDetector(FieldAbsoluteDate<T> fieldAbsoluteDate) Build a new instance from a fielded date. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventDate(FieldAbsoluteDate<T> target) Add an event date.protected FieldDateDetector<T> create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler) Build a new instance.g(FieldSpacecraftState<T> s) Compute the value of the switching function.getDate()Get the current event date according to the propagator.getDates()Get all event field dates currently managed, in chronological order.Get the event function.toEventDetector(EventHandler eventHandler) Build non-Field instance.withMinGap(double newMinGap) Setup minimum gap between added dates.Methods inherited from class org.orekit.propagation.events.FieldAbstractDetector
checkIfForward, getDetectionSettings, getHandler, init, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThresholdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.propagation.events.FieldEventDetector
finish, getMaxCheckInterval, getMaxIterationCount, getThreshold, resetMethods inherited from interface org.orekit.time.FieldTimeStamped
durationFrom, durationFrom
-
Field Details
-
DEFAULT_MAX_CHECK
public static final double DEFAULT_MAX_CHECKDefault value for max check.- Since:
- 12.0
- See Also:
-
DEFAULT_MIN_GAP
public static final double DEFAULT_MIN_GAPDefault value for minimum gap between added dates.- Since:
- 12.0
- See Also:
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDDefault value for convergence threshold.- Since:
- 12.0
- See Also:
-
-
Constructor Details
-
FieldDateDetector
Build a new instance from a fielded date.- Parameters:
fieldAbsoluteDate- fielded date- Since:
- 13.0
-
FieldDateDetector
Build a new instance.First event dates are set here, but others can be added later with
addEventDate(FieldAbsoluteDate).- Parameters:
field- field to which dates belongdates- list of event dates- Since:
- 12.0
- See Also:
-
FieldDateDetector
@SafeVarargs protected FieldDateDetector(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> handler, double minGap, FieldTimeStamped<T>... dates) 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 occurrencesminGap- minimum gap between added dates (s)dates- list of event dates
-
-
Method Details
-
withMinGap
Setup minimum gap between added dates.- Parameters:
newMinGap- new minimum gap between added dates- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 12.0
-
create
protected FieldDateDetector<T> create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler) Build a new instance.- Specified by:
createin classFieldAbstractDetector<FieldDateDetector<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
-
getEventFunction
Description copied from interface:FieldEventDetectorGet the event function. It defines g both for double and Field.- Specified by:
getEventFunctionin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Overrides:
getEventFunctionin classFieldAbstractDetector<FieldDateDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>> - Returns:
- event function
-
getDates
Get all event field dates currently managed, in chronological order.- Returns:
- all event field dates currently managed, in chronological order
- Since:
- 12.0
-
g
Compute the value of the switching function. This function measures the difference between the current and the target date.- Specified by:
gin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Parameters:
s- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
getDate
Get the current event date according to the propagator.- Specified by:
getDatein interfaceFieldTimeStamped<T extends CalculusFieldElement<T>>- Returns:
- event date
-
toEventDetector
Build non-Field instance.- Overrides:
toEventDetectorin classFieldAbstractDetector<FieldDateDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>> - Parameters:
eventHandler- event handler- Returns:
- event detector
-
addEventDate
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:
-