Class DateDetector
- All Implemented Interfaces:
EventDetector,TimeStamped
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 (
DateDetector(TimeStamped...)) - several dates can be added (
addEventDate(AbsoluteDate))
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
AbstractDetector.withHandler(EventHandler) 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.AbstractDetector
DEFAULT_MAX_ITER -
Constructor Summary
ConstructorsModifierConstructorDescriptionDateDetector(double minGap, AbsoluteDate date) Build a new instance from a single time.DateDetector(double minGap, TimeStamped... dates) Build a new instance.protectedDateDetector(EventDetectionSettings detectionSettings, EventHandler handler, double minGap, TimeStamped... dates) Protected constructor with full parameters.DateDetector(AbsoluteDate date) Build a new instance from a single time.DateDetector(TimeStamped... dates) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventDate(AbsoluteDate target) Add an event date.protected DateDetectorcreate(EventDetectionSettings detectionSettings, EventHandler newHandler) Build a new instance.doubleg(SpacecraftState s) Compute the value of the switching function.getDate()Get the current event date according to the propagator.getDates()Get all event dates currently managed, in chronological order.Get the event function.doubleGet the minimum gap between added dates.withMinGap(double newMinGap) Setup minimum gap between added dates.Methods inherited from class org.orekit.propagation.events.AbstractDetector
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.EventDetector
finish, getMaxCheckInterval, getMaxIterationCount, getThreshold, resetMethods inherited from interface org.orekit.time.TimeStamped
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
-
DateDetector
Build a new instance.First event dates are set here, but others can be added later with
addEventDate(AbsoluteDate), although the max. check should probably be changed then.- Parameters:
dates- list of event dates- Since:
- 12.0
- See Also:
-
DateDetector
Build a new instance from a single time.First event dates are set here, but others can be added later with
addEventDate(AbsoluteDate), although the max. check should probably be changed then.- Parameters:
date- event date- Since:
- 13.0
- See Also:
-
DateDetector
Build a new instance.First event dates are set here, but others can be added later with
addEventDate(AbsoluteDate), although the max. check should probably be changed then.- Parameters:
minGap- minimum gap between added dates (s)dates- list of event dates- Since:
- 13.0
- See Also:
-
DateDetector
Build a new instance from a single time.First event dates are set here, but others can be added later with
addEventDate(AbsoluteDate), although the max. check should probably be changed then.- Parameters:
minGap- minimum gap between added dates (s)date- event date- Since:
- 13.0
- See Also:
-
DateDetector
protected DateDetector(EventDetectionSettings detectionSettings, EventHandler handler, double minGap, TimeStamped... 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- detection settingshandler- event handler to call at event occurrencesminGap- minimum gap between added dates (s)dates- list of event dates- Since:
- 12.2
-
-
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
Build a new instance.- Specified by:
createin classAbstractDetector<DateDetector>- Parameters:
detectionSettings- detection settingsnewHandler- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
getDates
Get all event dates currently managed, in chronological order.- Returns:
- all event dates currently managed, in chronological order
- Since:
- 11.1
-
getEventFunction
Description copied from interface:EventDetectorGet the event function. It defines g both for double and Field.- Specified by:
getEventFunctionin interfaceEventDetector- Overrides:
getEventFunctionin classAbstractDetector<DateDetector>- Returns:
- event function
-
g
Compute the value of the switching function. This function measures the difference between the current and the target date.- Specified by:
gin interfaceEventDetector- 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 interfaceTimeStamped- Returns:
- event date
-
getMinGap
public double getMinGap()Get the minimum gap between added dates.- Returns:
- the minimum gap between added dates (s)
-
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:
-