Class SpacecraftStateInterpolator
- java.lang.Object
-
- org.orekit.time.AbstractTimeInterpolator<SpacecraftState>
-
- org.orekit.propagation.SpacecraftStateInterpolator
-
- All Implemented Interfaces:
TimeInterpolator<SpacecraftState>
public class SpacecraftStateInterpolator extends AbstractTimeInterpolator<SpacecraftState>
Generic class for spacecraft state interpolator.The user can specify what interpolator to use for each attribute of the spacecraft state. However, at least one interpolator for either orbit or absolute position-velocity-acceleration is needed. All the other interpolators can be left to null if the user do not want to interpolate these values.
- Author:
- Luc Maisonobe, Vincent Cucchietti
- See Also:
SpacecraftState
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.orekit.time.AbstractTimeInterpolator
AbstractTimeInterpolator.InterpolationData
-
-
Field Summary
-
Fields inherited from class org.orekit.time.AbstractTimeInterpolator
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC, DEFAULT_INTERPOLATION_POINTS
-
-
Constructor Summary
Constructors Constructor Description SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, Frame attitudeReferenceFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, Frame attitudeReferenceFrame, CartesianDerivativesFilter pvaFilter, AngularDerivativesFilter angularFilter)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, TimeInterpolator<Orbit> orbitInterpolator, TimeInterpolator<AbsolutePVCoordinates> absPVAInterpolator, TimeInterpolator<TimeStampedDouble> massInterpolator, TimeInterpolator<Attitude> attitudeInterpolator, TimeInterpolator<TimeStampedDouble> additionalStateInterpolator)
Constructor.SpacecraftStateInterpolator(int interpolationPoints, Frame outputFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.SpacecraftStateInterpolator(int interpolationPoints, Frame outputFrame, Frame attitudeReferenceFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.SpacecraftStateInterpolator(Frame outputFrame)
Simplest constructor to create a default Hermite interpolator for every spacecraft state field.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkSampleAndInterpolatorConsistency(List<SpacecraftState> sample, boolean orbitInterpolatorIsPresent, boolean absPVInterpolatorIsPresent)
Check that an interpolator exist for given sample state definition.static void
checkStatesDefinitionsConsistency(List<SpacecraftState> states)
Check that all state are either orbit defined or based on absolute position-velocity-acceleration.Optional<TimeInterpolator<AbsolutePVCoordinates>>
getAbsPVAInterpolator()
Get absolute position-velocity-acceleration interpolator.Optional<TimeInterpolator<TimeStampedDouble>>
getAdditionalStateInterpolator()
Get additional state interpolator.Optional<TimeInterpolator<Attitude>>
getAttitudeInterpolator()
Get attitude interpolator.Optional<TimeInterpolator<TimeStampedDouble>>
getMassInterpolator()
Get mass interpolator.Optional<TimeInterpolator<Orbit>>
getOrbitInterpolator()
Get orbit interpolator.Frame
getOutputFrame()
Get output frame.List<TimeInterpolator<? extends TimeStamped>>
getSubInterpolators()
Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.SpacecraftState
interpolate(AbsoluteDate interpolationDate, Collection<SpacecraftState> sample)
Get an interpolated instance.protected SpacecraftState
interpolate(AbstractTimeInterpolator.InterpolationData interpolationData)
Interpolate instance from given interpolation data.-
Methods inherited from class org.orekit.time.AbstractTimeInterpolator
addOptionalSubInterpolatorIfDefined, checkInterpolatorCompatibilityWithSampleSize, getCentralDate, getCentralDate, getExtrapolationThreshold, getNbInterpolationPoints, getTimeParameter, interpolate
-
-
-
-
Constructor Detail
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(Frame outputFrame)
Simplest constructor to create a default Hermite interpolator for every spacecraft state field.The interpolators will have the following configuration :
- Same frame for coordinates and attitude
- Default number of interpolation points of
DEFAULT_INTERPOLATION_POINTS
- Default extrapolation threshold of
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
s - Use of position and two time derivatives for absolute position-velocity-acceleration coordinates interpolation
- Use of angular and first time derivative for attitude interpolation
As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
outputFrame
- output frame- See Also:
AbstractTimeInterpolator
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, Frame outputFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.The interpolators will have the following configuration :
- Same frame for coordinates and attitude
- Default extrapolation threshold of
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
s - Use of position and two time derivatives for absolute position-velocity-acceleration coordinates interpolation
- Use of angular and first time derivative for attitude interpolation
As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
interpolationPoints
- number of interpolation pointsoutputFrame
- output frame- See Also:
AbstractTimeInterpolator
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.The interpolators will have the following configuration :
- Same frame for coordinates and attitude
- Use of position and two time derivatives for absolute position-velocity-acceleration coordinates interpolation
- Use of angular and first time derivative for attitude interpolation
As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
interpolationPoints
- number of interpolation pointsextrapolationThreshold
- extrapolation threshold beyond which the propagation will failoutputFrame
- output frame- Since:
- 12.1
- See Also:
AbstractTimeInterpolator
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, Frame outputFrame, Frame attitudeReferenceFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.The interpolators will have the following configuration :
- Default extrapolation threshold of
DEFAULT_EXTRAPOLATION_THRESHOLD_SEC
s - Use of position and two time derivatives for absolute position-velocity-acceleration coordinates interpolation
- Use of angular and first time derivative for attitude interpolation
As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
interpolationPoints
- number of interpolation pointsoutputFrame
- output frameattitudeReferenceFrame
- reference frame from which attitude is defined- See Also:
AbstractTimeInterpolator
- Default extrapolation threshold of
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, Frame attitudeReferenceFrame)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.The interpolators will have the following configuration :
- Use of position and two time derivatives for absolute position-velocity-acceleration coordinates interpolation
- Use of angular and first time derivative for attitude interpolation
As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
interpolationPoints
- number of interpolation pointsextrapolationThreshold
- extrapolation threshold beyond which the propagation will failoutputFrame
- output frameattitudeReferenceFrame
- reference frame from which attitude is defined
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, Frame attitudeReferenceFrame, CartesianDerivativesFilter pvaFilter, AngularDerivativesFilter angularFilter)
Constructor to create a customizable Hermite interpolator for every spacecraft state field.As this implementation of interpolation is polynomial, it should be used only with small number of interpolation points (about 10-20 points) in order to avoid Runge's phenomenon and numerical problems (including NaN appearing).
BEWARE: output frame must be inertial if this instance is going to interpolate between tabulated spacecraft states defined by orbit, will throw an error otherwise.
- Parameters:
interpolationPoints
- number of interpolation pointsextrapolationThreshold
- extrapolation threshold beyond which the propagation will failoutputFrame
- output frameattitudeReferenceFrame
- reference frame from which attitude is definedpvaFilter
- filter for derivatives from the sample to use in position-velocity-acceleration interpolationangularFilter
- filter for derivatives from the sample to use in attitude interpolation
-
SpacecraftStateInterpolator
public SpacecraftStateInterpolator(int interpolationPoints, double extrapolationThreshold, Frame outputFrame, TimeInterpolator<Orbit> orbitInterpolator, TimeInterpolator<AbsolutePVCoordinates> absPVAInterpolator, TimeInterpolator<TimeStampedDouble> massInterpolator, TimeInterpolator<Attitude> attitudeInterpolator, TimeInterpolator<TimeStampedDouble> additionalStateInterpolator)
Constructor.At least one interpolator for either orbit or absolute position-velocity-acceleration is needed. All the other interpolators can be left to null if the user do not want to interpolate these values.
BEWARE: output frame must be inertial if interpolated spacecraft states are defined by orbit. Throws an error otherwise.
BEWARE: it is up to the user to check the consistency of input interpolators.
- Parameters:
interpolationPoints
- number of interpolation pointsextrapolationThreshold
- extrapolation threshold beyond which the propagation will failoutputFrame
- output frame (inertial if the user is planning to use the orbit interpolator)orbitInterpolator
- orbit interpolator (can be null if absPVAInterpolator is defined)absPVAInterpolator
- absolute position-velocity-acceleration (can be null if orbitInterpolator is defined)massInterpolator
- mass interpolator (can be null)attitudeInterpolator
- attitude interpolator (can be null)additionalStateInterpolator
- additional state interpolator (can be null)- Since:
- 12.0.1
-
-
Method Detail
-
checkSampleAndInterpolatorConsistency
public static void checkSampleAndInterpolatorConsistency(List<SpacecraftState> sample, boolean orbitInterpolatorIsPresent, boolean absPVInterpolatorIsPresent)
Check that an interpolator exist for given sample state definition.- Parameters:
sample
- sample (non empty)orbitInterpolatorIsPresent
- flag defining if an orbit interpolator has been defined for this instanceabsPVInterpolatorIsPresent
- flag defining if an absolute position-velocity-acceleration interpolator has been defined for this instance- Throws:
OrekitIllegalArgumentException
- if there is no defined interpolator for given sample spacecraft state definition type
-
checkStatesDefinitionsConsistency
public static void checkStatesDefinitionsConsistency(List<SpacecraftState> states)
Check that all state are either orbit defined or based on absolute position-velocity-acceleration.- Parameters:
states
- spacecraft state sample
-
interpolate
public SpacecraftState interpolate(AbsoluteDate interpolationDate, Collection<SpacecraftState> sample)
Get an interpolated instance..The additional states that are interpolated are the ones already present in the first neighbor instance. The sample instances must therefore have at least the same additional states as this neighbor instance. They may have more additional states, but the extra ones will be ignored.
All the sample instances must be based on similar trajectory data, i.e. they must either all be based on orbits or all be based on absolute position-velocity-acceleration. Any inconsistency will trigger an
OrekitIllegalArgumentException
.- Specified by:
interpolate
in interfaceTimeInterpolator<SpacecraftState>
- Overrides:
interpolate
in classAbstractTimeInterpolator<SpacecraftState>
- Parameters:
interpolationDate
- interpolation datesample
- time stamped sample- Returns:
- a new instance, interpolated at specified date
- Throws:
OrekitIllegalArgumentException
- if there are states defined by orbits and absolute position-velocity-acceleration coordinatesOrekitIllegalArgumentException
- if there is no defined interpolator for given sample spacecraft state definition type
-
getSubInterpolators
public List<TimeInterpolator<? extends TimeStamped>> getSubInterpolators()
Get all lowest level interpolators implemented by this instance, otherwise return a list with this instance only.An example would be the spacecraft state interpolator which can use different interpolators for each of its attributes (orbit, absolute position-velocity-acceleration coordinates, mass...). In this case, it would return the list of all of these interpolators (or possibly all of their sub-interpolators if they were to use multiple interpolators themselves).
- Specified by:
getSubInterpolators
in interfaceTimeInterpolator<SpacecraftState>
- Overrides:
getSubInterpolators
in classAbstractTimeInterpolator<SpacecraftState>
- Returns:
- list of interpolators
-
interpolate
protected SpacecraftState interpolate(AbstractTimeInterpolator.InterpolationData interpolationData)
Interpolate instance from given interpolation data.- Specified by:
interpolate
in classAbstractTimeInterpolator<SpacecraftState>
- Parameters:
interpolationData
- interpolation data- Returns:
- interpolated instance from given interpolation data.
-
getOutputFrame
public Frame getOutputFrame()
Get output frame.- Returns:
- output frame
-
getOrbitInterpolator
public Optional<TimeInterpolator<Orbit>> getOrbitInterpolator()
Get orbit interpolator.- Returns:
- optional orbit interpolator
- See Also:
Optional
-
getAbsPVAInterpolator
public Optional<TimeInterpolator<AbsolutePVCoordinates>> getAbsPVAInterpolator()
Get absolute position-velocity-acceleration interpolator.- Returns:
- optional absolute position-velocity-acceleration interpolator
- See Also:
Optional
-
getMassInterpolator
public Optional<TimeInterpolator<TimeStampedDouble>> getMassInterpolator()
Get mass interpolator.- Returns:
- optional mass interpolator
- See Also:
Optional
-
getAttitudeInterpolator
public Optional<TimeInterpolator<Attitude>> getAttitudeInterpolator()
Get attitude interpolator.- Returns:
- optional attitude interpolator
- See Also:
Optional
-
getAdditionalStateInterpolator
public Optional<TimeInterpolator<TimeStampedDouble>> getAdditionalStateInterpolator()
Get additional state interpolator.- Returns:
- optional additional state interpolator
- See Also:
Optional
-
-