org.orekit.propagation.events
Class EventShifter

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

public class EventShifter
extends AbstractDetector

Wrapper shifting events occurrences times.

This class wraps an event detector to slightly shift the events occurrences times. A typical use case is for handling operational delays before or after some physical event really occurs.

For example, the satellite attitude mode may be switched from sun pointed to spin-stabilized a few minutes before eclipse entry, and switched back to sun pointed a few minutes after eclipse exit. This behavior is handled by wrapping an eclipse detector into an instance of this class with a positive times shift for increasing events (eclipse exit) and a negative times shift for decreasing events (eclipse entry).

Version:
$Revision: 3133 $ $Date: 2010-02-17 18:15:56 +0100 (mer. 17 févr. 2010) $
Author:
Luc Maisonobe
See Also:
Propagator.addEventDetector(EventDetector), EventDetector, Serialized Form

Field Summary
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
CONTINUE, RESET_DERIVATIVES, RESET_STATE, STOP
 
Constructor Summary
EventShifter(EventDetector detector, boolean useShiftedStates, double increasingTimeShift, double decreasingTimeShift)
          Build a new instance.
 
Method Summary
 int eventOccurred(SpacecraftState s, boolean increasing)
          Handle an event and choose what to do next.
 double g(SpacecraftState s)
          Compute the value of the switching function.
 double getDecreasingTimeShift()
          Get the decreasing events time shift.
 double getIncreasingTimeShift()
          Get the increasing events time shift.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getThreshold, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventShifter

public EventShifter(EventDetector detector,
                    boolean useShiftedStates,
                    double increasingTimeShift,
                    double decreasingTimeShift)
Build a new instance.

The max check interval, the convergence threshold of the raw unshifted events will be used for the shifted event. When an event occurs, the eventOccurred method of the raw unshifted events will be called (with spacecraft state at either the shifted or the unshifted event date depending on the useShiftedStates parameter).

Parameters:
detector - event detector for the raw unshifted event
useShiftedStates - if true, the state provided to eventOccurreed method of the detector will remain shifted, otherwise it will be unshifted to correspond to the underlying raw event.
increasingTimeShift - increasing events time shift.
decreasingTimeShift - decreasing events time shift.
Method Detail

getIncreasingTimeShift

public double getIncreasingTimeShift()
Get the increasing events time shift.

Returns:
increasing events time shift

getDecreasingTimeShift

public double getDecreasingTimeShift()
Get the decreasing events time shift.

Returns:
decreasing events time shift

eventOccurred

public int eventOccurred(SpacecraftState s,
                         boolean increasing)
                  throws OrekitException
Handle an event and choose what to do next.

The scheduling between this method and the OrekitStepHandler method handleStep(interpolator, isLast) is to call this method first and handleStep afterwards. This scheduling allows the propagator to pass true as the isLast parameter to the step handler to make it aware the step will be the last one if this method returns EventDetector.STOP. As the interpolator may be used to navigate back throughout the last step (as OrekitStepNormalizer does for example), user code called by this method and user code called by step handlers may experience apparently out of order values of the independent time variable. As an example, if the same user object implements both this EventDetector interface and the OrekitFixedStepHandler interface, a forward integration may call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for variable step handlers and to the size of the fixed step for fixed step handlers.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the current state information : date, kinematics, attitude
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
Returns:
one of EventDetector.STOP, EventDetector.RESET_STATE, EventDetector.RESET_DERIVATIVES or EventDetector.CONTINUE
Throws:
OrekitException - if some specific error occurs

g

public double g(SpacecraftState s)
         throws OrekitException
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.

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


Copyright © 2002-2010 CS Communication & Systèmes. All Rights Reserved.