org.orekit.propagation.events
Class DateDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by org.orekit.propagation.events.DateDetector
All Implemented Interfaces:
Serializable, EventDetector, TimeStamped

public class DateDetector
extends AbstractDetector
implements TimeStamped

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:

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 using provided constructors.

Author:
Luc Maisonobe, Pascal Parraud
See Also:
Propagator.addEventDetector(EventDetector), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
DateDetector(AbsoluteDate target)
          Build a new instance.
DateDetector(AbsoluteDate target, double maxCheck, double threshold)
          Build a new instance.
DateDetector(AbsoluteDate target, double maxCheck, double threshold, EventDetector.Action action)
          Build a new instance.
DateDetector(AbsoluteDate target, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
          Build a new instance.
DateDetector(double maxCheck, double threshold)
          Build a new instance.
DateDetector(double maxCheck, double threshold, EventDetector.Action action)
          Build a new instance.
DateDetector(double maxCheck, double threshold, EventDetector.Action action, boolean remove)
          Build a new instance.
 
Method Summary
 void addEventDate(AbsoluteDate target)
          Add an event date.
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          Handle a date event and choose what to do next.
 double g(SpacecraftState s)
          Compute the value of the switching function.
 AbsoluteDate getDate()
          Get the current event date according to the propagator.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateDetector

public DateDetector(double maxCheck,
                    double threshold)
Build a new instance.

This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.

The default implementation behavior is to stop propagation at date occurrence.

Parameters:
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(double maxCheck,
                    double threshold,
                    EventDetector.Action action)
Build a new instance.

This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.

Parameters:
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
action - action performed at date detection
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(double maxCheck,
                    double threshold,
                    EventDetector.Action action,
                    boolean remove)
Build a new instance.

This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.

Parameters:
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
action - action performed at date detection
remove - true if detector should be removed after first detection
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(AbsoluteDate target,
                    double maxCheck,
                    double threshold)
Build a new instance.

First event date is set here, but others can be added later with addEventDate(AbsoluteDate).

The default implementation behavior is to stop propagation at date occurrence.

Parameters:
target - target date
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(AbsoluteDate target,
                    double maxCheck,
                    double threshold,
                    EventDetector.Action action)
Build a new instance.

First event date is set here, but others can be added later with addEventDate(AbsoluteDate).

Parameters:
target - target date
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
action - action performed at date detection
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(AbsoluteDate target,
                    double maxCheck,
                    double threshold,
                    EventDetector.Action action,
                    boolean remove)
Build a new instance.

First event date is set here, but others can be added later with addEventDate(AbsoluteDate).

Parameters:
target - target date
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
action - action performed at date detection
remove - true if detector should be removed after first detection
Since:
3.1
See Also:
addEventDate(AbsoluteDate)

DateDetector

public DateDetector(AbsoluteDate target)
Build a new instance.

This constructor is dedicated to single date detection. MaxCheck is set to 10.e9, so almost no other date can be added. Tolerance is set to 10.e-10.

Parameters:
target - target date
See Also:
addEventDate(AbsoluteDate)
Method Detail

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException
Handle a date event and choose what to do next.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information : date, kinematics, attitude
increasing - the way of the switching function is not guaranted as it can change according to the added event dates
forward - if true, the integration variable (time) increases during integration.
Returns:
the action performed at the first event date occurrence.
Throws:
OrekitException - if some specific error occurs

shouldBeRemoved

public boolean shouldBeRemoved()
This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the current detector should be removed after first event detection. WARNING: this method can be called only once a event has been triggered. Before, the value is not available.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection

g

public double g(SpacecraftState s)
         throws OrekitException
Compute the value of the switching function. This function measures the difference between the current and the target date.

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the current state information: date, kinematics, attitude
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

getDate

public AbsoluteDate getDate()
Get the current event date according to the propagator.

Specified by:
getDate in interface TimeStamped
Returns:
event date

addEventDate

public void addEventDate(AbsoluteDate target)
                  throws IllegalArgumentException
Add an event date.

The date to add must be:

Parameters:
target - target date
Throws:
IllegalArgumentException - if the date is too close from already defined interval
See Also:
DateDetector(double, double)


Copyright © 2017 CNES. All Rights Reserved.