Class 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
    • 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 points
        outputFrame - 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 points
        extrapolationThreshold - extrapolation threshold beyond which the propagation will fail
        outputFrame - 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 points
        outputFrame - output frame
        attitudeReferenceFrame - reference frame from which attitude is defined
        See Also:
        AbstractTimeInterpolator
      • 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 points
        extrapolationThreshold - extrapolation threshold beyond which the propagation will fail
        outputFrame - output frame
        attitudeReferenceFrame - 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 points
        extrapolationThreshold - extrapolation threshold beyond which the propagation will fail
        outputFrame - output frame
        attitudeReferenceFrame - reference frame from which attitude is defined
        pvaFilter - filter for derivatives from the sample to use in position-velocity-acceleration interpolation
        angularFilter - 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 points
        extrapolationThreshold - extrapolation threshold beyond which the propagation will fail
        outputFrame - 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 instance
        absPVInterpolatorIsPresent - 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 interface TimeInterpolator<SpacecraftState>
        Overrides:
        interpolate in class AbstractTimeInterpolator<SpacecraftState>
        Parameters:
        interpolationDate - interpolation date
        sample - 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 coordinates
        OrekitIllegalArgumentException - 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 interface TimeInterpolator<SpacecraftState>
        Overrides:
        getSubInterpolators in class AbstractTimeInterpolator<SpacecraftState>
        Returns:
        list of interpolators
      • getOutputFrame

        public Frame getOutputFrame()
        Get output frame.
        Returns:
        output frame