Class StateCovariance
- java.lang.Object
-
- org.orekit.propagation.StateCovariance
-
- All Implemented Interfaces:
TimeStamped
public class StateCovariance extends Object implements TimeStamped
This class is the representation of a covariance matrix at a given date.Currently, the covariance only represents the orbital elements.
It is possible to change the covariance frame by using the
changeCovarianceFrame(Orbit, Frame)
orchangeCovarianceFrame(Orbit, LOF)
method. These methods are based on Equations (18) and (20) of Covariance Transformations for Satellite Flight Dynamics Operations by David A. SVallado.Finally, covariance orbit type can be changed using the
changeCovarianceType(Orbit, OrbitType, PositionAngleType)
method.- Since:
- 11.3
- Author:
- Bryan Cazabonne, Vincent Cucchietti
-
-
Field Summary
Fields Modifier and Type Field Description static int
STATE_DIMENSION
State dimension.
-
Constructor Summary
Constructors Constructor Description StateCovariance(RealMatrix orbitalCovariance, AbsoluteDate epoch, Frame covarianceFrame, OrbitType orbitType, PositionAngleType angleType)
Constructor.StateCovariance(RealMatrix orbitalCovariance, AbsoluteDate epoch, LOF lof)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StateCovariance
changeCovarianceFrame(Orbit orbit, Frame frameOut)
Get the covariance in the output frame.StateCovariance
changeCovarianceFrame(Orbit orbit, LOF lofOut)
Get the covariance in a given local orbital frame.StateCovariance
changeCovarianceType(Orbit orbit, OrbitType outOrbitType, PositionAngleType outAngleType)
Get the covariance matrix in another orbit type.static void
checkFrameAndOrbitTypeConsistency(Frame covarianceFrame, OrbitType inputType)
Check constructor's inputs consistency.AbsoluteDate
getDate()
Get the date.Frame
getFrame()
Get the covariance frame.LOF
getLOF()
Get the covariance LOF type.RealMatrix
getMatrix()
Get the covariance matrix.OrbitType
getOrbitType()
Get the covariance orbit type.PositionAngleType
getPositionAngleType()
Get the covariance angle type.static RealMatrix
getStm(Orbit initialOrbit, double dt)
Get the state transition matrix considering Keplerian contribution only.static boolean
inputAndOutputAreIdentical(OrbitType inOrbitType, PositionAngleType inAngleType, OrbitType outOrbitType, PositionAngleType outAngleType)
Checks if input/output orbit and angle types are identical.static boolean
inputAndOutputOrbitTypesAreCartesian(OrbitType inOrbitType, OrbitType outOrbitType)
Checks if input and output orbit types are bothOrbitType.CARTESIAN
.StateCovariance
shiftedBy(Orbit orbit, double dt)
Get a time-shifted covariance matrix.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.time.TimeStamped
durationFrom
-
-
-
-
Field Detail
-
STATE_DIMENSION
public static final int STATE_DIMENSION
State dimension.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StateCovariance
public StateCovariance(RealMatrix orbitalCovariance, AbsoluteDate epoch, LOF lof)
Constructor.- Parameters:
orbitalCovariance
- 6x6 orbital parameters covarianceepoch
- epoch of the covariancelof
- covariance LOF type
-
StateCovariance
public StateCovariance(RealMatrix orbitalCovariance, AbsoluteDate epoch, Frame covarianceFrame, OrbitType orbitType, PositionAngleType angleType)
Constructor.- Parameters:
orbitalCovariance
- 6x6 orbital parameters covarianceepoch
- epoch of the covariancecovarianceFrame
- covariance frame (inertial or Earth fixed)orbitType
- orbit type of the covariance (CARTESIAN if covarianceFrame is not pseudo-inertial)angleType
- position angle type of the covariance (not used if orbitType is CARTESIAN)
-
-
Method Detail
-
checkFrameAndOrbitTypeConsistency
public static void checkFrameAndOrbitTypeConsistency(Frame covarianceFrame, OrbitType inputType)
Check constructor's inputs consistency.- Parameters:
covarianceFrame
- covariance frame (inertial or Earth fixed)inputType
- orbit type of the covariance- Throws:
OrekitException
- if input frame is not pseudo-inertial AND the orbit type is not Cartesian
-
inputAndOutputAreIdentical
public static boolean inputAndOutputAreIdentical(OrbitType inOrbitType, PositionAngleType inAngleType, OrbitType outOrbitType, PositionAngleType outAngleType)
Checks if input/output orbit and angle types are identical.- Parameters:
inOrbitType
- input orbit typeinAngleType
- input angle typeoutOrbitType
- output orbit typeoutAngleType
- output angle type- Returns:
- flag defining if input/output orbit and angle types are identical
-
inputAndOutputOrbitTypesAreCartesian
public static boolean inputAndOutputOrbitTypesAreCartesian(OrbitType inOrbitType, OrbitType outOrbitType)
Checks if input and output orbit types are bothOrbitType.CARTESIAN
.- Parameters:
inOrbitType
- input orbit typeoutOrbitType
- output orbit type- Returns:
- flag defining if input and output orbit types are both
OrbitType.CARTESIAN
-
getDate
public AbsoluteDate getDate()
Get the date..- Specified by:
getDate
in interfaceTimeStamped
- Returns:
- date attached to the object
-
getMatrix
public RealMatrix getMatrix()
Get the covariance matrix.- Returns:
- the covariance matrix
-
getOrbitType
public OrbitType getOrbitType()
Get the covariance orbit type.- Returns:
- the covariance orbit type
-
getPositionAngleType
public PositionAngleType getPositionAngleType()
Get the covariance angle type.- Returns:
- the covariance angle type
-
getFrame
public Frame getFrame()
Get the covariance frame.- Returns:
- the covariance frame (can be null)
- See Also:
getLOF()
-
getLOF
public LOF getLOF()
Get the covariance LOF type.- Returns:
- the covariance LOF type (can be null)
- See Also:
getFrame()
-
changeCovarianceType
public StateCovariance changeCovarianceType(Orbit orbit, OrbitType outOrbitType, PositionAngleType outAngleType)
Get the covariance matrix in another orbit type.The covariance orbit type cannot be changed if the covariance matrix is expressed in a
local orbital frame
or a non-pseudo inertial frame.As this type change uses the jacobian matrix of the transformation, it introduces a linear approximation. Hence, the current covariance matrix will not exactly match the new linearized case and the distribution will not follow a generalized Gaussian distribution anymore.
This is based on equation (1) to (6) from "Vallado, D. A. (2004). Covariance transformations for satellite flight dynamics operations."
- Parameters:
orbit
- orbit to which the covariance matrix should correspondoutOrbitType
- target orbit type of the state covariance matrixoutAngleType
- target position angle type of the state covariance matrix- Returns:
- a new covariance state, expressed in the target orbit type with the target position angle
- See Also:
changeCovarianceFrame(Orbit, Frame)
-
changeCovarianceFrame
public StateCovariance changeCovarianceFrame(Orbit orbit, LOF lofOut)
Get the covariance in a given local orbital frame.Changing the covariance frame is a linear process, this method does not introduce approximation unless a change in covariance orbit type is required.
This is based on equation (18) to (20) "from Vallado, D. A. (2004). Covariance transformations for satellite flight dynamics operations."
- Parameters:
orbit
- orbit to which the covariance matrix should correspondlofOut
- output local orbital frame- Returns:
- a new covariance state, expressed in the output local orbital frame
-
changeCovarianceFrame
public StateCovariance changeCovarianceFrame(Orbit orbit, Frame frameOut)
Get the covariance in the output frame.Changing the covariance frame is a linear process, this method does not introduce approximation unless a change in covariance orbit type is required.
This is based on equation (18) to (20) "from Vallado, D. A. (2004). Covariance transformations for satellite flight dynamics operations."
- Parameters:
orbit
- orbit to which the covariance matrix should correspondframeOut
- output frame- Returns:
- a new covariance state, expressed in the output frame
-
shiftedBy
public StateCovariance shiftedBy(Orbit orbit, double dt)
Get a time-shifted covariance matrix.The shifting model is a linearized, Keplerian one. In other words, it is based on a state transition matrix that is computed assuming Keplerian motion.
Shifting is not intended as a replacement for proper covariance propagation, but should be sufficient for small time shifts or coarse accuracy.
- Parameters:
orbit
- orbit to which the covariance matrix should corresponddt
- time shift in seconds- Returns:
- a new covariance state, shifted with respect to the instance
-
getStm
public static RealMatrix getStm(Orbit initialOrbit, double dt)
Get the state transition matrix considering Keplerian contribution only.- Parameters:
initialOrbit
- orbit to which the initial covariance matrix should corresponddt
- time difference between the two orbits- Returns:
- the state transition matrix used to shift the covariance matrix
-
-