org.orekit.propagation
Class AbstractPropagator

java.lang.Object
  extended by org.orekit.propagation.AbstractPropagator
All Implemented Interfaces:
java.io.Serializable, BasicPropagator, Propagator, PVCoordinatesProvider
Direct Known Subclasses:
EcksteinHechlerPropagator, KeplerianPropagator

public abstract class AbstractPropagator
extends java.lang.Object
implements Propagator

Common handling of Propagator methods for analytical-like propagators.

This abstract class allows to provide easily the full set of Propagator methods, including all propagation modes support and discrete events support for any simple propagation method. Only three methods must be implemented by derived classes: getInitialState(), basicPropagate(AbsoluteDate) and Propagator.resetInitialState(SpacecraftState). The second method should perform straightforward propagation starting from some internally stored initial state up to the specified target date. The third method should reset the initial state when called.

Version:
$Revision: 3123 $ $Date: 2010-02-15 17:18:40 +0100 (lun. 15 févr. 2010) $
Author:
Luc Maisonobe
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.orekit.propagation.Propagator
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
 
Constructor Summary
protected AbstractPropagator()
          Build a new instance.
 
Method Summary
protected  CombinedEventsDetectorsManager addEndDateChecker(AbsoluteDate startDate, AbsoluteDate endDate, CombinedEventsDetectorsManager manager)
          Add an event handler for end date checking.
 void addEventDetector(EventDetector detector)
          Add an event detector.
protected abstract  SpacecraftState basicPropagate(AbsoluteDate date)
          Propagate an orbit without any fancy features.
 void clearEventsDetectors()
          Remove all events detectors.
 java.util.Collection<EventDetector> getEventsDetectors()
          Get all the events detectors that have been added.
 BoundedPropagator getGeneratedEphemeris()
          Get the ephemeris generated during propagation.
abstract  SpacecraftState getInitialState()
          Get the propagator initial state.
 int getMode()
          Get the current operating mode of the propagator.
 PVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame)
          Get the PVCoordinates of the body in the selected frame.
 SpacecraftState propagate(AbsoluteDate target)
          Propagate towards a target date.
 void setEphemerisMode()
          Set the propagator to ephemeris generation mode.
 void setMasterMode(double h, OrekitFixedStepHandler handler)
          Set the propagator to master mode with fixed steps.
 void setMasterMode(OrekitStepHandler handler)
          Set the propagator to master mode with variable steps.
 void setSlaveMode()
          Set the propagator to slave mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.orekit.propagation.Propagator
resetInitialState
 

Constructor Detail

AbstractPropagator

protected AbstractPropagator()
Build a new instance.

Method Detail

getMode

public int getMode()
Get the current operating mode of the propagator.

Specified by:
getMode in interface Propagator
Returns:
one of Propagator.SLAVE_MODE, Propagator.MASTER_MODE, Propagator.EPHEMERIS_GENERATION_MODE
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode()

setSlaveMode

public void setSlaveMode()
Set the propagator to slave mode.

This mode is used when the user needs only the final orbit at the target time. The (slave) propagator computes this result and return it to the calling (master) application, without any intermediate feedback.

This is the default mode.

Specified by:
setSlaveMode in interface Propagator
See Also:
Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.SLAVE_MODE

setMasterMode

public void setMasterMode(double h,
                          OrekitFixedStepHandler handler)
Set the propagator to master mode with fixed steps.

This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.

Specified by:
setMasterMode in interface Propagator
Parameters:
h - fixed stepsize (s)
handler - handler called at the end of each finalized step
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(OrekitStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.MASTER_MODE

setMasterMode

public void setMasterMode(OrekitStepHandler handler)
Set the propagator to master mode with variable steps.

This mode is used when the user needs to have some custom function called at the end of each finalized step during integration. The (master) propagator integration loop calls the (slave) application callback methods at each finalized step.

Specified by:
setMasterMode in interface Propagator
Parameters:
handler - handler called at the end of each finalized step
See Also:
Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setEphemerisMode(), Propagator.getMode(), Propagator.MASTER_MODE

setEphemerisMode

public void setEphemerisMode()
Set the propagator to ephemeris generation mode.

This mode is used when the user needs random access to the orbit state at any time between the initial and target times, and in no sequential order. A typical example is the implementation of search and iterative algorithms that may navigate forward and backward inside the propagation range before finding their result.

Beware that since this mode stores all intermediate results, it may be memory intensive for long integration ranges and high precision/short time steps.

Specified by:
setEphemerisMode in interface Propagator
See Also:
Propagator.getGeneratedEphemeris(), Propagator.setSlaveMode(), Propagator.setMasterMode(double, OrekitFixedStepHandler), Propagator.setMasterMode(OrekitStepHandler), Propagator.getMode(), Propagator.EPHEMERIS_GENERATION_MODE

getGeneratedEphemeris

public BoundedPropagator getGeneratedEphemeris()
Get the ephemeris generated during propagation.

Specified by:
getGeneratedEphemeris in interface Propagator
Returns:
generated ephemeris
See Also:
Propagator.setEphemerisMode()

addEventDetector

public void addEventDetector(EventDetector detector)
Add an event detector.

Specified by:
addEventDetector in interface Propagator
Parameters:
detector - event detector to add
See Also:
Propagator.clearEventsDetectors(), Propagator.getEventsDetectors()

getEventsDetectors

public java.util.Collection<EventDetector> getEventsDetectors()
Get all the events detectors that have been added.

Specified by:
getEventsDetectors in interface Propagator
Returns:
an unmodifiable collection of the added detectors
See Also:
Propagator.addEventDetector(EventDetector), Propagator.clearEventsDetectors()

clearEventsDetectors

public void clearEventsDetectors()
Remove all events detectors.

Specified by:
clearEventsDetectors in interface Propagator
See Also:
Propagator.addEventDetector(EventDetector), Propagator.getEventsDetectors()

propagate

public SpacecraftState propagate(AbsoluteDate target)
                          throws PropagationException
Propagate towards a target date.

Simple propagators use only the target date as the specification for computing the propagated state. More feature rich propagators like the ones implemented the extended interface Propagator can consider other information and provide different operating modes or G-stop facilities to stop at pinpointed events occurrences. In these cases, the target date is only a hint, not a mandatory objective.

Specified by:
propagate in interface BasicPropagator
Parameters:
target - target date towards which orbit state should be propagated
Returns:
propagated state
Throws:
PropagationException - if state cannot be propagated

getPVCoordinates

public PVCoordinates getPVCoordinates(AbsoluteDate date,
                                      Frame frame)
                               throws OrekitException
Get the PVCoordinates of the body in the selected frame.

Specified by:
getPVCoordinates in interface PVCoordinatesProvider
Parameters:
date - current date
frame - the frame where to define the position
Returns:
position/velocity of the body (m and m/s)
Throws:
OrekitException - if position cannot be computed in given frame

getInitialState

public abstract SpacecraftState getInitialState()
Get the propagator initial state.

Specified by:
getInitialState in interface Propagator
Returns:
initial state

basicPropagate

protected abstract SpacecraftState basicPropagate(AbsoluteDate date)
                                           throws PropagationException
Propagate an orbit without any fancy features.

This method is similar in spirit to the propagate(org.orekit.time.AbsoluteDate) method, except that it does not call any handler during propagation, nor any discrete events. It always stop exactly at the specified date.

Parameters:
date - target date for propagation
Returns:
state at specified date
Throws:
PropagationException - if propagation cannot reach specified date

addEndDateChecker

protected CombinedEventsDetectorsManager addEndDateChecker(AbsoluteDate startDate,
                                                           AbsoluteDate endDate,
                                                           CombinedEventsDetectorsManager manager)
Add an event handler for end date checking.

This method can be used to simplify handling of integration end date. It leverages the nominal stop condition with the exceptional stop conditions.

Parameters:
startDate - propagation start date
endDate - desired end date
manager - manager containing the user-defined handlers
Returns:
a new manager containing all the user-defined handlers plus a dedicated manager triggering a stop event at entDate


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