org.orekit.propagation.precomputed
Class AbstractEphemeris

java.lang.Object
  extended by org.orekit.propagation.AbstractPropagator
      extended by org.orekit.propagation.precomputed.AbstractEphemeris
All Implemented Interfaces:
Serializable, BoundedPropagator, Propagator, PVCoordinatesProvider
Direct Known Subclasses:
HermiteEphemeris, LagrangeEphemeris

public abstract class AbstractEphemeris
extends AbstractPropagator
implements BoundedPropagator

This class handles tabulated spacecraft states entries (either from a pv coordinates provider and an attitude provider or a spacecraft states array). Tabulated entries should be chronologically classified in a increasing way. Within the interval of validity, interpolation can be performed in order to obtain continuous outputs. Two classes exist : LagrangeEphemeris and HermiteEphemeris extends this one. Important note : the validity interval of the extrapolated points can be different than the time interval because the interpolation can require a different number of interpolation points The methods getMinDate() and getMaxDate() give the boundaries of the effective validity interval (inherit from interface BoundedPropagator)

Since:
2.3
Version:
$Id: AbstractEphemeris.java 17582 2017-05-10 12:58:16Z bignon $
Author:
Sophie LAURENS
See Also:
Serialized Form
Concurrency :
not thread-safe
Concurrency comment :
internal mutable attributes

Field Summary
protected  boolean areAddStatesSupported
          True if the spacecraft states contains additional states.
protected  boolean areAttitudesSupported
          True if the spacecraft states contains one or two attitudes.
protected static int DEFAULT_INTERPOLATION_ORDER
          Default number of interpolated points.
protected static int DEFAULT_PREVIOUS_INDEX
          Default previous index.
protected  double[] durationFromTab
          The array of time duration from the first entry of data, chronologically sorted.
protected  Frame frame
          Reference frame.
protected  AbsoluteDateInterval interpolationInterval
          Ephemeris interval of validity.
protected  int interpOrder
          Interpolation order.
protected  boolean isFirstIntervalInterp
          True if it is the first interpolation on this interval.
protected  AbsoluteDate maxDate
          Last date in range.
protected  AbsoluteDate minDate
          First date in range.
protected  double mu
          Mu.
protected  int previousIndex
          At each call, the index is kept.
protected  ISearchIndex sortingAlgorithm
          Search index algorithm.
protected  SpacecraftState[] stateTab
          The SpacecraftStates array, chronologically sorted.
 
Fields inherited from class org.orekit.propagation.AbstractPropagator
MASS
 
Fields inherited from interface org.orekit.propagation.Propagator
EPHEMERIS_GENERATION_MODE, MASTER_MODE, SLAVE_MODE
 
Constructor Summary
AbstractEphemeris(SpacecraftState[] tab)
          Simple constructor of class AbstractEphemeris, with interpolation order equal to 2.
AbstractEphemeris(SpacecraftState[] tab, int order)
          Simple constructor of class AbstractEphemeris with defined interpolation order.
AbstractEphemeris(SpacecraftState[] tab, int order, ISearchIndex algo)
          Constructor of class AbstractEphemeris where a search index algorithm is passed on the constructor.
AbstractEphemeris(SpacecraftState[] tab, ISearchIndex algo)
          Constructor of class AbstractEphemeris where a search index algorithm is passed on the constructor and the order is by default equal to 2.
 
Method Summary
protected  Attitude[] attitudesInterpolation(SpacecraftState[] tab, int order, int i0, AbsoluteDate date)
          This method is called only if attitudes are supported.
protected  SpacecraftState basicPropagate(AbsoluteDate date)
          Propagate an orbit without any fancy features.
protected  SpacecraftState checkBounds(double date)
          Returns spacecraftstate on bounds if duration is on bounds.
protected  double[] convertTab(SpacecraftState[] tab, int order)
          Convert the SpacecraftState[] into a double[] which represents the duration from the first state date.
static SpacecraftState[] generateSpacecraftState(PVCoordinatesProvider pvProv, AttitudeProvider attProvForces, AttitudeProvider attProvEvents, double step, AbsoluteDateInterval ptsInterval, Frame frame, double mu)
          Creates a spacecraft array with constant step size.
 SpacecraftState getInitialState()
          Get the propagator initial state.
protected abstract  SpacecraftState getInterpolatedSpacecraftState(AbsoluteDate date)
          Get the interpolated spacecraft state.
 AbsoluteDate getMaxDate()
          Get the last date of the range.
 AbsoluteDate getMinDate()
          Get the first date of the range.
protected  int indexValidity(SpacecraftState[] tab, int index)
          Checks if interpolation is valid : meaning if 0<= index +1 -interpOrder/2 or index + interpOrder/2 <= maximalIndex
protected  AbsoluteDateInterval intervalValidity(SpacecraftState[] tab)
          Corrects the min and max dates with the constraint of the number of interpolations points required.
protected  Orbit propagateOrbit(AbsoluteDate date)
          Extrapolate an orbit up to a specific target date.
 void resetInitialState(SpacecraftState state)
          Reset the propagator initial state.
 void setAttitudeProvider(AttitudeProvider attitudeProvider)
          Set attitude provider for forces and events computation.
 void setAttitudeProviderEvents(AttitudeProvider attProviderEvents)
          Set attitude provider for events computation.
 void setAttitudeProviderForces(AttitudeProvider attProviderForces)
          Set attitude provider for forces computation.
 
Methods inherited from class org.orekit.propagation.AbstractPropagator
acceptStep, addAdditionalStateProvider, addAdditionalStateProvider, addEventDetector, clearEventsDetectors, getAttitudeProvider, getAttitudeProviderEvents, getAttitudeProviderForces, getEventsDetectors, getFrame, getGeneratedEphemeris, getMode, getPVCoordinates, getPvProvider, manageStateFrame, propagate, propagate, setEphemerisMode, setMasterMode, setMasterMode, setOrbitFrame, setSlaveMode, setStartDate
 
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
addEventDetector, clearEventsDetectors, getAttitudeProvider, getAttitudeProviderEvents, getAttitudeProviderForces, getEventsDetectors, getFrame, getGeneratedEphemeris, getMode, propagate, propagate, setEphemerisMode, setMasterMode, setMasterMode, setOrbitFrame, setSlaveMode
 
Methods inherited from interface org.orekit.utils.PVCoordinatesProvider
getPVCoordinates
 

Field Detail

DEFAULT_INTERPOLATION_ORDER

protected static final int DEFAULT_INTERPOLATION_ORDER
Default number of interpolated points. Fits an Hermite interpolation.

See Also:
Constant Field Values

DEFAULT_PREVIOUS_INDEX

protected static final int DEFAULT_PREVIOUS_INDEX
Default previous index.

See Also:
Constant Field Values

sortingAlgorithm

protected ISearchIndex sortingAlgorithm
Search index algorithm.


minDate

protected AbsoluteDate minDate
First date in range.


maxDate

protected AbsoluteDate maxDate
Last date in range.


areAddStatesSupported

protected boolean areAddStatesSupported
True if the spacecraft states contains additional states.


areAttitudesSupported

protected boolean areAttitudesSupported
True if the spacecraft states contains one or two attitudes.


isFirstIntervalInterp

protected boolean isFirstIntervalInterp
True if it is the first interpolation on this interval.


interpolationInterval

protected AbsoluteDateInterval interpolationInterval
Ephemeris interval of validity.


interpOrder

protected final int interpOrder
Interpolation order. For example, it equals 2 for an Hermite interpolation, and should be even for a Lagrange interpolation.


stateTab

protected SpacecraftState[] stateTab
The SpacecraftStates array, chronologically sorted.


durationFromTab

protected double[] durationFromTab
The array of time duration from the first entry of data, chronologically sorted.


mu

protected double mu
Mu.


frame

protected Frame frame
Reference frame.


previousIndex

protected int previousIndex
At each call, the index is kept.

Constructor Detail

AbstractEphemeris

public AbstractEphemeris(SpacecraftState[] tab)
                  throws OrekitException
Simple constructor of class AbstractEphemeris, with interpolation order equal to 2. Fits an Hermite Interpolation. Creates a search index algorithm by default as a BinarySearchIndexOpenClosed.

Parameters:
tab - : a SpacecraftState[] sorted by chronological order (duplicates are allowed)
Throws:
OrekitException - if the tab is does not contains at least (order) points if order < 2 (should never happen) if the list of additional states does not always contain the same names

AbstractEphemeris

public AbstractEphemeris(SpacecraftState[] tab,
                         int order)
                  throws OrekitException
Simple constructor of class AbstractEphemeris with defined interpolation order. Creates a search index algorithm by default as a BinarySearchIndexOpenClosed.

Parameters:
tab - : a SpacecraftState[] sorted by chronological order (duplicates are allowed)
order - : interpolation order. For example, it equals 2 for an Hermite interpolation, and should be even for a Lagrange interpolation.
Throws:
OrekitException - if the tab is does not contains at least (order) points if order < 2 if the list of additional states does not always contain the same names

AbstractEphemeris

public AbstractEphemeris(SpacecraftState[] tab,
                         ISearchIndex algo)
                  throws OrekitException
Constructor of class AbstractEphemeris where a search index algorithm is passed on the constructor and the order is by default equal to 2.

Parameters:
tab - : a SpacecraftState[] sorted by chronological order (duplicates are allowed)
algo - : an instance of a class implementing ISearchIndex. Contains the search index algorithm to use. If null, a search index algorithm by default as a BinarySearchIndexOpenClosed is created.
Throws:
OrekitException - if order < 2 if the list of additional states does not always contain the same names

AbstractEphemeris

public AbstractEphemeris(SpacecraftState[] tab,
                         int order,
                         ISearchIndex algo)
                  throws OrekitException
Constructor of class AbstractEphemeris where a search index algorithm is passed on the constructor. Important remark : the other constructor verifies it contains enough points to do at least one interpolation, and it extracts an AbsoluteDate[] from tab, then converts it into a double[]. If the search index is given, this step is useless, AS LONG AS the instance has been correctly created by user. No exception will be thrown if it is not the case.

Parameters:
tab - : a SpacecraftState[] sorted by chronological order (duplicates are allowed)
order - : interpolation order. For example, it equals 2 for an Hermite interpolation, and should be even for a Lagrange interpolation.
algo - : an instance of a class implementing ISearchIndex. Contains the search index algorithm to use. If null, a search index algorithm by default as a BinarySearchIndexOpenClosed is created.
Throws:
OrekitException - if order < 2 if the list of additional states does not always contain the same names
Method Detail

getMinDate

public AbsoluteDate getMinDate()
Get the first date of the range.

Specified by:
getMinDate in interface BoundedPropagator
Returns:
the first date of the range

getMaxDate

public AbsoluteDate getMaxDate()
Get the last date of the range.

Specified by:
getMaxDate in interface BoundedPropagator
Returns:
the last date of the range

convertTab

protected double[] convertTab(SpacecraftState[] tab,
                              int order)
                       throws OrekitException
Convert the SpacecraftState[] into a double[] which represents the duration from the first state date. Therefore, the first component of the double[] is zero.

Parameters:
tab - the SpacecraftState array in input
order - : interpolation order. To do the interpolation, tab should have at least (order) points
Returns:
duration tab from the first state date
Throws:
OrekitException - if the tab has less than order elements

attitudesInterpolation

protected Attitude[] attitudesInterpolation(SpacecraftState[] tab,
                                            int order,
                                            int i0,
                                            AbsoluteDate date)
                                     throws OrekitException
This method is called only if attitudes are supported.

Parameters:
tab - : the spacecraftstate array, already sorted.
order - : number of points for interpolation. For a Lagrange interpolation, it has to be even. For an Hermite interpolation, it is equal to 2.
i0 - : index associated with date.
date - : the date where the interpolation is done.
Returns:
attInterpolated : the interpolated attitude for - attInterpolated[0] forces computation - attInterpolated[1] events computation
Throws:
OrekitException - should never happen

intervalValidity

protected AbsoluteDateInterval intervalValidity(SpacecraftState[] tab)
                                         throws OrekitException
Corrects the min and max dates with the constraint of the number of interpolations points required. minDate = n^th date and maxDate = [maximalIndex - n]^th date with n = order/2 -1 Get the validity interval for interpolation. Redundant with indexValidity.

Parameters:
tab - : the spacecraftstate array, already chronologically sorted.
Returns:
interval (attribute of the class) AbsoluteDateInterval = [tab(n), tab(maximalIndex-n)]
Throws:
OrekitException - if order < 2

indexValidity

protected int indexValidity(SpacecraftState[] tab,
                            int index)
                     throws OrekitException
Checks if interpolation is valid : meaning if 0<= index +1 -interpOrder/2 or index + interpOrder/2 <= maximalIndex

Parameters:
tab - : the SpacecraftState array, already chronologically sorted.
index - : the closest spacecraft state from a given date.
Returns:
i0 : for Hermite, i0 = index. For Lagrange, i0 = index + 1 - order / 2. is the first interpolation point.
Throws:
OrekitException - if the index does not allow enough point to do the interpolation.

checkBounds

protected SpacecraftState checkBounds(double date)
Returns spacecraftstate on bounds if duration is on bounds.

Parameters:
date - duration
Returns:
spacecraft state on bounds if duration is on bounds, null otherwise.

generateSpacecraftState

public static SpacecraftState[] generateSpacecraftState(PVCoordinatesProvider pvProv,
                                                        AttitudeProvider attProvForces,
                                                        AttitudeProvider attProvEvents,
                                                        double step,
                                                        AbsoluteDateInterval ptsInterval,
                                                        Frame frame,
                                                        double mu)
                                                 throws OrekitException
Creates a spacecraft array with constant step size.

Parameters:
pvProv - pv coordinates provider
attProvForces - attitude provider for forces computation
attProvEvents - attitude provider for events computation
step - step size
ptsInterval - time interval the array should cover
frame - reference frame
mu - mu
Returns:
spacecraft states array
Throws:
OrekitException - if default attitude cannot be computed (when attProv is null)

getInterpolatedSpacecraftState

protected abstract SpacecraftState getInterpolatedSpacecraftState(AbsoluteDate date)
                                                           throws OrekitException
Get the interpolated spacecraft state.

WARNING: when implementing this method. a call to checkBounds(double) should be performed first to properly handle date on bounds since none of search index convention are able to properly handle both bounds.

Parameters:
date - interpolation date
Returns:
interpolated spacecraft state
Throws:
OrekitException - bcs of class SimpleTimeStampArray

basicPropagate

protected SpacecraftState basicPropagate(AbsoluteDate date)
                                  throws PropagationException
Description copied from class: AbstractPropagator
Propagate an orbit without any fancy features.

This method is similar in spirit to the AbstractPropagator.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.

Overrides:
basicPropagate in class AbstractPropagator
Parameters:
date - target date for propagation
Returns:
state at specified date
Throws:
PropagationException - if propagation cannot reach specified date

propagateOrbit

protected Orbit propagateOrbit(AbsoluteDate date)
                        throws PropagationException
Description copied from class: AbstractPropagator
Extrapolate an orbit up to a specific target date.

Specified by:
propagateOrbit in class AbstractPropagator
Parameters:
date - target date for the orbit
Returns:
extrapolated parameters
Throws:
PropagationException - if some parameters are out of bounds

getInitialState

public SpacecraftState getInitialState()
                                throws OrekitException
Get the propagator initial state.

Specified by:
getInitialState in interface Propagator
Overrides:
getInitialState in class AbstractPropagator
Returns:
initial state
Throws:
OrekitException - if state cannot be retrieved

resetInitialState

public void resetInitialState(SpacecraftState state)
                       throws PropagationException
Reset the propagator initial state.

Specified by:
resetInitialState in interface Propagator
Overrides:
resetInitialState in class AbstractPropagator
Parameters:
state - new initial state to consider
Throws:
PropagationException - if initial state cannot be reset

setAttitudeProvider

public void setAttitudeProvider(AttitudeProvider attitudeProvider)
Description copied from class: AbstractPropagator
Set attitude provider for forces and events computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProvider in interface Propagator
Overrides:
setAttitudeProvider in class AbstractPropagator
Parameters:
attitudeProvider - attitude provider

setAttitudeProviderForces

public void setAttitudeProviderForces(AttitudeProvider attProviderForces)
Description copied from class: AbstractPropagator
Set attitude provider for forces computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProviderForces in interface Propagator
Overrides:
setAttitudeProviderForces in class AbstractPropagator
Parameters:
attProviderForces - attitude provider for forces computation

setAttitudeProviderEvents

public void setAttitudeProviderEvents(AttitudeProvider attProviderEvents)
Description copied from class: AbstractPropagator
Set attitude provider for events computation. A default attitude provider is available in ConstantAttitudeLaw.

Specified by:
setAttitudeProviderEvents in interface Propagator
Overrides:
setAttitudeProviderEvents in class AbstractPropagator
Parameters:
attProviderEvents - attitude provider for events computation


Copyright © 2017 CNES. All Rights Reserved.