Class StateMapper


  • public abstract class StateMapper
    extends Object
    This class maps between raw double elements and SpacecraftState instances.
    Since:
    6.0
    Author:
    Luc Maisonobe
    • Constructor Detail

      • StateMapper

        protected StateMapper​(AbsoluteDate referenceDate,
                              double mu,
                              OrbitType orbitType,
                              PositionAngle positionAngleType,
                              AttitudeProvider attitudeProvider,
                              Frame frame)
        Simple constructor.

        The position parameter type is meaningful only if propagation orbit type support it. As an example, it is not meaningful for propagation in Cartesian parameters.

        Parameters:
        referenceDate - reference date
        mu - central attraction coefficient (m³/s²)
        orbitType - orbit type to use for mapping
        positionAngleType - angle type to use for propagation
        attitudeProvider - attitude provider
        frame - inertial frame
    • Method Detail

      • getReferenceDate

        public AbsoluteDate getReferenceDate()
        Get reference date.
        Returns:
        reference date
      • getOrbitType

        public OrbitType getOrbitType()
        Get propagation parameter type.
        Returns:
        orbit type used for propagation
      • setPositionAngleType

        public void setPositionAngleType()
        Set position angle type.
      • getPositionAngleType

        public PositionAngle getPositionAngleType()
        Get propagation parameter type.
        Returns:
        angle type to use for propagation
      • getMu

        public double getMu()
        Get the central attraction coefficient μ.
        Returns:
        mu central attraction coefficient (m³/s²)
      • getFrame

        public Frame getFrame()
        Get the inertial frame.
        Returns:
        inertial frame
      • getAttitudeProvider

        public AttitudeProvider getAttitudeProvider()
        Get the attitude provider.
        Returns:
        attitude provider
      • mapDoubleToDate

        public AbsoluteDate mapDoubleToDate​(double t)
        Map the raw double time offset to a date.
        Parameters:
        t - date offset
        Returns:
        date
      • mapDoubleToDate

        public AbsoluteDate mapDoubleToDate​(double t,
                                            AbsoluteDate date)
        Map the raw double time offset to a date.
        Parameters:
        t - date offset
        date - The expected date.
        Returns:
        date if it is the same time as t to within the lower precision of the latter. Otherwise a new date is returned that corresponds to time t.
      • mapDateToDouble

        public double mapDateToDouble​(AbsoluteDate date)
        Map a date to a raw double time offset.
        Parameters:
        date - date
        Returns:
        time offset
      • mapArrayToState

        public SpacecraftState mapArrayToState​(double t,
                                               double[] y,
                                               double[] yDot,
                                               boolean meanOnly)
        Map the raw double components to a spacecraft state.
        Parameters:
        t - date offset
        y - state components
        yDot - time derivatives of the state components (null if unknown, in which case Keplerian motion is assumed)
        meanOnly - use only the mean elements to build the state
        Returns:
        spacecraft state
      • mapArrayToState

        public abstract SpacecraftState mapArrayToState​(AbsoluteDate date,
                                                        double[] y,
                                                        double[] yDot,
                                                        boolean meanOnly)
        Map the raw double components to a spacecraft state.
        Parameters:
        date - of the state components
        y - state components
        yDot - time derivatives of the state components (null if unknown, in which case Keplerian motion is assumed)
        meanOnly - use only the mean elements to build the state
        Returns:
        spacecraft state
      • mapStateToArray

        public abstract void mapStateToArray​(SpacecraftState state,
                                             double[] y,
                                             double[] yDot)
        Map a spacecraft state to raw double components.
        Parameters:
        state - state to map
        y - placeholder where to put the components
        yDot - placeholder where to put the components derivatives