Class AbstractPropagator
- java.lang.Object
-
- org.orekit.propagation.AbstractPropagator
-
- All Implemented Interfaces:
Propagator,PVCoordinatesProvider
- Direct Known Subclasses:
AbstractAnalyticalPropagator,AbstractIntegratedPropagator
public abstract class AbstractPropagator extends Object implements Propagator
Common handling ofPropagatormethods for analytical propagators.This abstract class allows to provide easily the full set of
Propagatormethods, including all propagation modes support and discrete events support for any simple propagation method.- Author:
- Luc Maisonobe
-
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.Propagator
DEFAULT_LAW, DEFAULT_MASS, EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPropagator()Build a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)Add a set of user-specified state parameters to be computed along with the orbit propagation.abstract <T extends EventDetector>
voidaddEventDetector(T detector)Add an event detector.abstract voidclearEventsDetectors()Remove all events detectors.List<AdditionalStateProvider>getAdditionalStateProviders()Get an unmodifiable list of providers for additional state.AttitudeProvidergetAttitudeProvider()Get attitude provider.abstract Collection<EventDetector>getEventsDetectors()Get all the events detectors that have been added.protected doublegetFixedStepSize()Get the fixed step size.FramegetFrame()Get the frame in which the orbit is propagated.abstract BoundedPropagatorgetGeneratedEphemeris()Get the ephemeris generated during propagation.SpacecraftStategetInitialState()Get the propagator initial state.String[]getManagedAdditionalStates()Get all the names of all managed states.intgetMode()Get the current operating mode of the propagator.TimeStampedPVCoordinatesgetPVCoordinates(AbsoluteDate date, Frame frame)Get thePVCoordinatesof the body in the selected frame.protected AbsoluteDategetStartDate()Get the start date.protected OrekitStepHandlergetStepHandler()Get the step handler.booleanisAdditionalStateManaged(String name)Check if an additional state is managed.SpacecraftStatepropagate(AbsoluteDate target)Propagate towards a target date.voidresetInitialState(SpacecraftState state)Reset the propagator initial state.voidsetAttitudeProvider(AttitudeProvider attitudeProvider)Set attitude provider.voidsetEphemerisMode()Set the propagator to ephemeris generation mode.voidsetEphemerisMode(OrekitStepHandler handler)Set the propagator to ephemeris generation mode with the specified handler for each integration step.voidsetMasterMode(double h, OrekitFixedStepHandler handler)Set the propagator to master mode with fixed steps.voidsetMasterMode(OrekitStepHandler handler)Set the propagator to master mode with variable steps.voidsetSlaveMode()Set the propagator to slave mode.protected voidsetStartDate(AbsoluteDate startDate)Set a start date.protected SpacecraftStateupdateAdditionalStates(SpacecraftState original)Update state by adding all additional states.-
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
propagate
-
-
-
-
Method Detail
-
setStartDate
protected void setStartDate(AbsoluteDate startDate)
Set a start date.- Parameters:
startDate- start date
-
getStartDate
protected AbsoluteDate getStartDate()
Get the start date.- Returns:
- start date
-
getAttitudeProvider
public AttitudeProvider getAttitudeProvider()
Get attitude provider.- Specified by:
getAttitudeProviderin interfacePropagator- Returns:
- attitude provider
-
setAttitudeProvider
public void setAttitudeProvider(AttitudeProvider attitudeProvider)
Set attitude provider.- Specified by:
setAttitudeProviderin interfacePropagator- Parameters:
attitudeProvider- attitude provider
-
getInitialState
public SpacecraftState getInitialState()
Get the propagator initial state.- Specified by:
getInitialStatein interfacePropagator- Returns:
- initial state
-
getMode
public int getMode()
Get the current operating mode of the propagator.- Specified by:
getModein interfacePropagator- 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()
-
getFrame
public Frame getFrame()
Get the frame in which the orbit is propagated.The propagation frame is the definition frame of the initial state, so this method should be called after this state has been set, otherwise it may return null.
- Specified by:
getFramein interfacePropagator- Returns:
- frame in which the orbit is propagated
- See Also:
Propagator.resetInitialState(SpacecraftState)
-
resetInitialState
public void resetInitialState(SpacecraftState state)
Reset the propagator initial state.- Specified by:
resetInitialStatein interfacePropagator- Parameters:
state- new initial state to consider
-
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.
-
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:
setMasterModein interfacePropagator- 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:
setMasterModein interfacePropagator- 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.
-
setEphemerisMode
public void setEphemerisMode(OrekitStepHandler handler)
Set the propagator to ephemeris generation mode with the specified handler for each integration step.This mode is used when the user needs random access to the orbit state at any time between the initial and target times, as well as access to the steps computed by the integrator as in Master Mode. 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:
setEphemerisModein interfacePropagator- Parameters:
handler- handler called at the end of each finalized step- See Also:
Propagator.setEphemerisMode(),Propagator.getGeneratedEphemeris(),Propagator.setSlaveMode(),Propagator.setMasterMode(double, OrekitFixedStepHandler),Propagator.setMasterMode(OrekitStepHandler),Propagator.getMode(),Propagator.EPHEMERIS_GENERATION_MODE
-
addAdditionalStateProvider
public void addAdditionalStateProvider(AdditionalStateProvider additionalStateProvider)
Add a set of user-specified state parameters to be computed along with the orbit propagation.- Specified by:
addAdditionalStateProviderin interfacePropagator- Parameters:
additionalStateProvider- provider for additional state
-
getAdditionalStateProviders
public List<AdditionalStateProvider> getAdditionalStateProviders()
Get an unmodifiable list of providers for additional state.- Specified by:
getAdditionalStateProvidersin interfacePropagator- Returns:
- providers for the additional states
-
updateAdditionalStates
protected SpacecraftState updateAdditionalStates(SpacecraftState original)
Update state by adding all additional states.- Parameters:
original- original state- Returns:
- updated state, with all additional states included
- See Also:
addAdditionalStateProvider(AdditionalStateProvider)
-
isAdditionalStateManaged
public boolean isAdditionalStateManaged(String name)
Check if an additional state is managed.Managed states are states for which the propagators know how to compute its evolution. They correspond to additional states for which an
additional state providerhas been registered by calling theaddAdditionalStateProvidermethod. If the propagator is anintegrator-based propagator, the states for which a set ofadditional equationshas been registered by calling theaddAdditionalEquationsmethod are also counted as managed additional states.Additional states that are present in the
initial statebut have no evolution method registered are not considered as managed states. These unmanaged additional states are not lost during propagation, though. Their value will simply be copied unchanged throughout propagation.- Specified by:
isAdditionalStateManagedin interfacePropagator- Parameters:
name- name of the additional state- Returns:
- true if the additional state is managed
-
getManagedAdditionalStates
public String[] getManagedAdditionalStates()
Get all the names of all managed states.- Specified by:
getManagedAdditionalStatesin interfacePropagator- Returns:
- names of all managed states
-
getFixedStepSize
protected double getFixedStepSize()
Get the fixed step size.- Returns:
- fixed step size (or NaN if there are no fixed step size).
-
getStepHandler
protected OrekitStepHandler getStepHandler()
Get the step handler.- Returns:
- step handler
-
getGeneratedEphemeris
public abstract BoundedPropagator getGeneratedEphemeris()
Get the ephemeris generated during propagation.- Specified by:
getGeneratedEphemerisin interfacePropagator- Returns:
- generated ephemeris
- See Also:
Propagator.setEphemerisMode()
-
addEventDetector
public abstract <T extends EventDetector> void addEventDetector(T detector)
Add an event detector.- Specified by:
addEventDetectorin interfacePropagator- Type Parameters:
T- class type for the generic version- Parameters:
detector- event detector to add- See Also:
Propagator.clearEventsDetectors(),Propagator.getEventsDetectors()
-
getEventsDetectors
public abstract Collection<EventDetector> getEventsDetectors()
Get all the events detectors that have been added.- Specified by:
getEventsDetectorsin interfacePropagator- Returns:
- an unmodifiable collection of the added detectors
- See Also:
Propagator.addEventDetector(EventDetector),Propagator.clearEventsDetectors()
-
clearEventsDetectors
public abstract void clearEventsDetectors()
Remove all events detectors.- Specified by:
clearEventsDetectorsin interfacePropagator- See Also:
Propagator.addEventDetector(EventDetector),Propagator.getEventsDetectors()
-
propagate
public SpacecraftState propagate(AbsoluteDate target)
Propagate towards a target date.Simple propagators use only the target date as the specification for computing the propagated state. More feature rich propagators 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:
propagatein interfacePropagator- Parameters:
target- target date towards which orbit state should be propagated- Returns:
- propagated state
-
getPVCoordinates
public TimeStampedPVCoordinates getPVCoordinates(AbsoluteDate date, Frame frame)
Get thePVCoordinatesof the body in the selected frame.- Specified by:
getPVCoordinatesin interfacePVCoordinatesProvider- Parameters:
date- current dateframe- the frame where to define the position- Returns:
- time-stamped position/velocity of the body (m and m/s)
-
-