|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.orekit.propagation.SpacecraftState
public class SpacecraftState
This class is the representation of a complete state holding orbit, attitude for forces and events computation and additional states informations at a given date.
It contains an Orbit
, plus two attitudes (for forces and events computation) and a map of additional states
at a current AbsoluteDate
. Orbit and attitudes are guaranteed to be consistent in terms of date and reference
frame. The attitudes objects can be copied in the map of additional states with the additional state name
"ATTITUDE_FORCES", "ATTITUDE_EVENTS" or "ATTITUDE" (in numerical propagation only). The stored Attitude and the additional state
representing the attitude are guaranteed to be equal.
The user can declare a SpacecraftState with an input MassProvider
. The masses from each part of the mass
model are automatically added to the map of additional states with a name in the form "MASS_
The state can be slightly shifted to close dates. This shift is based on a simple keplerian model for orbit, a linear extrapolation for both attitudes taking the spin rate into account, no additional states changes. It is not intended as a replacement for proper orbit and attitude propagation but should be sufficient for either small time shifts or coarse accuracy.
The instance SpacecraftState
is guaranteed to be immutable.
NumericalPropagator
,
Serialized FormField Summary | |
---|---|
static String |
MASS
Default prefix for additional state representing a mass. |
static int |
ORBIT_DIMENSION
First index of the additional states. |
Constructor Summary | |
---|---|
SpacecraftState(double[] y,
OrbitType orbitType,
PositionAngle angleType,
AbsoluteDate date,
double mu,
Frame frame,
Map<String,AdditionalStateInfo> addStatesInfo,
AttitudeProvider attProviderForces,
AttitudeProvider attProviderEvents)
Build a spacecraft from an array (a state vector) and an additional states informations map. |
|
SpacecraftState(Orbit orbit)
Build a spacecraft state from orbit only. |
|
SpacecraftState(Orbit orbit,
Attitude attitude)
Build a spacecraft state from orbit and a single attitude. |
|
SpacecraftState(Orbit orbit,
Attitude attForces,
Attitude attEvents)
Build a spacecraft state from orbit, attitude for forces and events computation. |
|
SpacecraftState(Orbit orbit,
Attitude attForces,
Attitude attEvents,
Map<String,double[]> addStates)
Build a spacecraft state from orbit, attitude for forces and events computation and additional states map. |
|
SpacecraftState(Orbit orbit,
Attitude attForces,
Attitude attEvents,
MassProvider massProvider)
Build a spacecraft state from orbit, attitude for forces and events computation and mass provider. |
|
SpacecraftState(Orbit orbit,
Attitude attForces,
Attitude attEvents,
MassProvider massProvider,
Map<String,double[]> additionalStates)
Build a spacecraft state from orbit, attitude for forces and events computation, mass provider and additional states map. |
|
SpacecraftState(Orbit orbit,
Attitude attitude,
MassProvider massProvider)
Build a spacecraft state from orbit, attitude and mass provider. |
|
SpacecraftState(Orbit orbit,
MassProvider massProvider)
Create a new instance from orbit and mass provider. |
Method Summary | |
---|---|
SpacecraftState |
addAdditionalState(String name,
double[] state)
Add an additional state to the additional states map. |
SpacecraftState |
addAttitude(Attitude newAttitude,
AttitudeEquation.AttitudeType type)
Add attitude to the additional states map. |
SpacecraftState |
addAttitudeToAdditionalStates(AttitudeEquation.AttitudeType attitudeType)
Add attitude to the additional states map. |
SpacecraftState |
addMassProvider(MassProvider massProvider)
Add the values of mass parts from MassProvider to additional states map. |
static boolean |
equalsAddStates(Map<String,double[]> addStates1,
Map<String,double[]> addStates2)
Compares additional states. |
double |
getA()
Get the semi-major axis. |
double[] |
getAdditionalState(String name)
Get one additional state. |
Map<String,double[]> |
getAdditionalStates()
Get additional states. |
Map<String,AdditionalStateInfo> |
getAdditionalStatesInfos()
Get the additional states informations map. |
Map<String,double[]> |
getAdditionalStatesMass()
Get additional states with the prefix "MASS_". |
Attitude |
getAttitude()
Get the default attitude : the attitude for forces computation. |
Attitude |
getAttitude(Frame outputFrame)
Get the default attitude : the attitude for forces computation in given output frame. |
Attitude |
getAttitude(LOFType lofType)
Get the default attitude : the attitude for forces computation in given local orbital frame. |
Attitude |
getAttitudeEvents()
Get the attitude for events computation. |
Attitude |
getAttitudeEvents(Frame outputFrame)
Get the attitude for events computation in given output frame. |
Attitude |
getAttitudeEvents(LOFType lofType)
Get the attitude for events computation in given local orbital frame. |
Attitude |
getAttitudeForces()
Get the attitude for forces computation. |
Attitude |
getAttitudeForces(Frame outputFrame)
Get the attitude for forces computation in given output frame. |
Attitude |
getAttitudeForces(LOFType lofType)
Get the attitude for forces computation in given local orbital frame. |
AbsoluteDate |
getDate()
Get the date. |
double |
getE()
Get the eccentricity. |
double |
getEquinoctialEx()
Get the first component of the eccentricity vector (as per equinoctial parameters). |
double |
getEquinoctialEy()
Get the second component of the eccentricity vector (as per equinoctial parameters). |
Frame |
getFrame()
Get the inertial frame. |
double |
getHx()
Get the first component of the inclination vector (as per equinoctial parameters). |
double |
getHy()
Get the second component of the inclination vector (as per equinoctial parameters). |
double |
getI()
Get the inclination. |
double |
getKeplerianMeanMotion()
Get the keplerian mean motion. |
double |
getKeplerianPeriod()
Get the keplerian period. |
double |
getLE()
Get the eccentric latitude argument (as per equinoctial parameters). |
double |
getLM()
Get the mean latitude argument (as per equinoctial parameters). |
double |
getLv()
Get the true latitude argument (as per equinoctial parameters). |
double |
getMass(String partName)
Get the mass of the given part. |
double |
getMu()
Get the central attraction coefficient. |
Orbit |
getOrbit()
Gets the current orbit. |
PVCoordinates |
getPVCoordinates()
Get the PVCoordinates in orbit definition frame. |
PVCoordinates |
getPVCoordinates(Frame outputFrame)
Get the PVCoordinates in given output frame. |
int |
getStateVectorSize()
Get the state vector size. |
SpacecraftState |
interpolate(AbsoluteDate date,
Collection<SpacecraftState> sample)
Get an interpolated instance. |
void |
mapStateToArray(OrbitType orbitType,
PositionAngle angleType,
double[] stateVector)
Convert SpacecraftState to state vector. |
SpacecraftState |
shiftedBy(double dt)
Get a time-shifted state. |
Transform |
toTransform()
Compute the transform from orbit/attitude reference frame to spacecraft frame. |
Transform |
toTransform(Frame frame)
Compute the transform from specified frame to spacecraft frame. |
Transform |
toTransform(Frame frame,
LOFType lofType)
Compute the transform from specified frame to local orbital frame. |
Transform |
toTransform(LOFType lofType)
Compute the transform from orbit/attitude reference frame to local orbital frame. |
Transform |
toTransformEvents()
Compute the transform from orbit/attitude (for events computation) reference frame to spacecraft frame. |
Transform |
toTransformEvents(Frame frame)
Compute the transform from specified reference frame to spacecraft frame. |
Transform |
toTransformForces()
Compute the transform from orbit/attitude (for forces computation) reference frame to spacecraft frame. |
Transform |
toTransformForces(Frame frame)
Compute the transform from specified frame to spacecraft frame. |
SpacecraftState |
updateMass(String partName,
double newMass)
Update the mass of the given part. |
SpacecraftState |
updateOrbit(Orbit newOrbit)
Update the orbit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MASS
public static final int ORBIT_DIMENSION
Constructor Detail |
---|
public SpacecraftState(Orbit orbit)
Attitude (for forces and events computation) are set to null values. No mass informations are added.
orbit
- the orbitpublic SpacecraftState(Orbit orbit, Attitude attitude) throws IllegalArgumentException
Attitude for forces computation is set to the input attitude. Attitude for events computation is set to null value. No mass informations are added.
orbit
- the orbitattitude
- the default attitude
IllegalArgumentException
- if orbit and attitude dates or frames are not equalpublic SpacecraftState(Orbit orbit, MassProvider massProvider)
Attitude (for forces and events computation) are set to null values.
The mass states informations contained in the mass provider are added to the additional states map with the name
in the form "MASS_
orbit
- the orbitmassProvider
- the mass providerpublic SpacecraftState(Orbit orbit, Attitude attitude, MassProvider massProvider) throws IllegalArgumentException
Attitude for forces computation is set to the input attitude. Attitude for events computation is set to null value.
The mass states informations contained in the mass provider are added to the additional states list with the name
in the form "MASS_
orbit
- the orbitattitude
- the default attitudemassProvider
- the mass provider
IllegalArgumentException
- if orbit and attitude dates or frames are not equalpublic SpacecraftState(Orbit orbit, Attitude attForces, Attitude attEvents) throws IllegalArgumentException
No mass informations are added.
orbit
- the orbitattForces
- the attitude for forces computationattEvents
- the attitude for events computation
IllegalArgumentException
- if attitudeForces == null and attitudeEvents!= null
if orbit and attitude dates or frames are not equalpublic SpacecraftState(Orbit orbit, Attitude attForces, Attitude attEvents, Map<String,double[]> addStates) throws IllegalArgumentException
No mass informations are added.
orbit
- the orbitattForces
- the attitude for forces computationattEvents
- the attitude for events computationaddStates
- the additional states map
IllegalArgumentException
- if attitudeForces == null and attitudeEvents!= null
if orbit and attitude dates or frames are not equal
if attitude object and attitude in the additional states list map are not equalpublic SpacecraftState(Orbit orbit, Attitude attForces, Attitude attEvents, MassProvider massProvider) throws IllegalArgumentException
The mass states informations contained in the mass provider are added to the additional states list with the name
in the form "MASS_
orbit
- the orbitattForces
- the attitude for forces computationattEvents
- the attitude for events computationmassProvider
- the mass provider
IllegalArgumentException
- if attitudeForces == null and attitudeEvents!= null
if orbit and attitude dates or frames are not equalpublic SpacecraftState(Orbit orbit, Attitude attForces, Attitude attEvents, MassProvider massProvider, Map<String,double[]> additionalStates) throws IllegalArgumentException
The mass states informations contained in the mass provider are added to the additional states list with the name
in the form "MASS_
orbit
- the orbitattForces
- the attitude for forces computationattEvents
- the attitude for events computationmassProvider
- the mass provideradditionalStates
- the additional states
IllegalArgumentException
- if attitudeForces == null and attitudeEvents!= null
if orbit and attitude dates or frames are not equal
if attitude object and attitude in the additional states list map are not equalpublic SpacecraftState(double[] y, OrbitType orbitType, PositionAngle angleType, AbsoluteDate date, double mu, Frame frame, Map<String,AdditionalStateInfo> addStatesInfo, AttitudeProvider attProviderForces, AttitudeProvider attProviderEvents) throws OrekitException
If the additional state informations list contains a state with the prefix "ATTITUDE_FORCES" (or
"ATTITUDE_EVENTS" or "ATTITUDE"), it means that the attitude for forces computation (or events computation) was
added to the additional states map. Then the corresponding Attitude object is initialized with the additional
state value. Otherwise, the Attitude
is initialized using the corresponding AttitudeProvider
.
y
- the state vectororbitType
- the orbit typeangleType
- the position angle typedate
- the integration datemu
- central attraction coefficient used for propagation (m3/s2)frame
- frame in which integration is performedaddStatesInfo
- the additional states informations mapattProviderForces
- the attitude provider for forces computationattProviderEvents
- the attitude provider for events computation
OrekitException
- if attitude cannot be computedMethod Detail |
---|
public SpacecraftState addAdditionalState(String name, double[] state) throws OrekitException
If the additionalStates map already contained a mapping for the name entered, the old state is replaced by the specified state. It is not possible to add an additional state with "ATTITUDE_FORCES" or "ATTITUDE_EVENTS" or "ATTITTUDE" name : it is a reserved name.
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
name
- the additional state namestate
- the additional state value
OrekitException
- if the name of the additional state to be added is "ATTITUDE_FORCES" or "ATTITUDE_EVENTS" or
"ATTITUDE".public SpacecraftState addAttitudeToAdditionalStates(AttitudeEquation.AttitudeType attitudeType) throws OrekitException
The additional state name could be "ATTITUDE_FORCES" if AttitudeEquation.AttitudeType.ATTITUDE_FORCES
, "ATTITUDE_EVENTS"
if AttitudeEquation.AttitudeType.ATTITUDE_EVENTS
or "ATTITUDE" if AttitudeEquation.AttitudeType.ATTITUDE
. If AttitudeType#ATTITUDE,
the only one attitude available is added to the additional states map.
If an additional state with the name "ATTITUDE_FORCES", "ATTITUDE_EVENTS" or "ATTITUDE" is already in the additional state map, its value will be updated with the new one. The attitude additional state contains the rotation and the spin.
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
attitudeType
- one of AttitudeEquation.AttitudeType.ATTITUDE_FORCES
or AttitudeEquation.AttitudeType.ATTITUDE_EVENTS
or
AttitudeEquation.AttitudeType.ATTITUDE
OrekitException
- if no attitude information is defined
if additional states map contains (ATTITUDE_FORCES or ATTITUDE_EVENTS) state and ATTITUDE state.public SpacecraftState addMassProvider(MassProvider massProvider)
If the additional state map already contained an additional state from the input mass provider, its value will be updated with the new one.
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
massProvider
- the mass provider to add
public SpacecraftState addAttitude(Attitude newAttitude, AttitudeEquation.AttitudeType type)
Add attitude to the additional states map. It is not possible to add an attitude for events computation if no attitude for forces computation is defined.
Be careful, additional states associated with attitude are not updated. The user should call addAttitudeToAdditionalStates to add it.
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
newAttitude
- the attitude to be added to the statetype
- the attitude type
IllegalArgumentException
- if attitudeForces == null and attitudeEvents!= nullpublic SpacecraftState updateMass(String partName, double newMass) throws OrekitException
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
partName
- given partnewMass
- new mass of the given part
OrekitException
- if no mass informations already defined for the given partpublic SpacecraftState updateOrbit(Orbit newOrbit)
SpacecraftState
object state being immutable, a new SpacecraftState
object is
returned.
newOrbit
- the new orbit
public SpacecraftState shiftedBy(double dt)
The state can be slightly shifted to close dates. This shift is based on a simple keplerian model for orbit, a linear extrapolation for attitude taking the spin rate into account. It is not intended as a replacement for proper orbit and attitude propagation but should be sufficient for small time shifts or coarse accuracy.
WARNING : Additional states map is not changed (except for attitude objects if present) !
As a rough order of magnitude, the following table shows the interpolation errors obtained between this simple
shift method and an Eckstein-Heschler
propagator
for an 800km altitude nearly circular polar Earth orbit with
body center pointing
. Beware that these results may be different
for other orbits.
interpolation time (s) | position error (m) | velocity error (m/s) | attitude error (°) |
---|---|---|---|
60 | 20 | 1 | 0.001 |
120 | 100 | 2 | 0.002 |
300 | 600 | 4 | 0.005 |
600 | 2000 | 6 | 0.008 |
900 | 4000 | 6 | 0.010 |
shiftedBy
in interface TimeShiftable<SpacecraftState>
dt
- time shift in seconds
public SpacecraftState interpolate(AbsoluteDate date, Collection<SpacecraftState> sample) throws OrekitException
The input sample SpacecraftState should have the same additional states size and name. If no attitudes are defined, an error is handled.
Note that the state of the current instance may not be used in the interpolation process, only its type and non interpolable fields are used (for example central attraction coefficient or frame when interpolating orbits). The interpolable fields taken into account are taken only from the states of the sample points. So if the state of the instance must be used, the instance should be included in the sample points.
interpolate
in interface TimeInterpolable<SpacecraftState>
date
- interpolation datesample
- sample points on which interpolation should be done
OrekitException
- if the sample points are inconsistent
if no attitudes are definedpublic Orbit getOrbit()
public AbsoluteDate getDate()
getDate
in interface TimeStamped
public Frame getFrame()
public Transform toTransform() throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
OrekitException
- if no attitude information is definedpublic Transform toTransform(Frame frame) throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
frame
- input frame
OrekitException
- if no attitude information is definedpublic Transform toTransform(LOFType lofType)
lofType
- the LOF type
public Transform toTransform(Frame frame, LOFType lofType) throws OrekitException
frame
- input framelofType
- the LOF type
OrekitException
- if some frame specific error occurspublic Transform toTransformForces() throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
OrekitException
- if no attitude information is definedpublic Transform toTransformForces(Frame frame) throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
frame
- input frame
OrekitException
- if no attitude information is definedpublic Transform toTransformEvents() throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
OrekitException
- if no attitude information is definedpublic Transform toTransformEvents(Frame frame) throws OrekitException
The spacecraft frame origin is at the point defined by the orbit, and its orientation is defined by the attitude.
frame
- input frame
OrekitException
- if no attitude information is definedpublic double getMu()
public double getKeplerianPeriod()
The keplerian period is computed directly from semi major axis and central acceleration constant.
public double getKeplerianMeanMotion()
The keplerian mean motion is computed directly from semi major axis and central acceleration constant.
public double getA()
public double getEquinoctialEx()
getE()
public double getEquinoctialEy()
getE()
public double getHx()
getI()
public double getHy()
getI()
public double getLv()
getLE()
,
getLM()
public double getLE()
getLv()
,
getLM()
public double getLM()
getLv()
,
getLE()
public double getE()
getEquinoctialEx()
,
getEquinoctialEy()
public double getI()
getHx()
,
getHy()
public PVCoordinates getPVCoordinates()
PVCoordinates
in orbit definition frame.
Compute the position and velocity of the satellite. This method caches its
results, and recompute them only when the method is called with a new value
for mu. The result is provided as a reference to the internally cached PVCoordinates
, so the caller is
responsible to copy it in a separate PVCoordinates
if it needs to keep the value for a while.
public PVCoordinates getPVCoordinates(Frame outputFrame) throws OrekitException
PVCoordinates
in given output frame.
Compute the position and velocity of the satellite. This method caches its
results, and recompute them only when the method is called with a new value
for mu. The result is provided as a reference to the internally cached PVCoordinates
, so the caller is
responsible to copy it in a separate PVCoordinates
if it needs to keep the value for a while.
outputFrame
- frame in which coordinates should be defined
OrekitException
- if the transformation between frames cannot be computedpublic Attitude getAttitude()
public Attitude getAttitude(Frame outputFrame) throws OrekitException
outputFrame
- frame in which the attitude is wanted
OrekitException
- if conversion between reference frames failspublic Attitude getAttitude(LOFType lofType) throws OrekitException
Warning: this method creates a new local orbital frame at each call. For multiple calls, prefer using
getAttitude(Frame)
with your own LocalOrbitalFrame
.
lofType
- the LOF type
OrekitException
- if conversion between reference frames failspublic Attitude getAttitudeForces()
public Attitude getAttitudeForces(Frame outputFrame) throws OrekitException
outputFrame
- frame in which the attitude is wanted
OrekitException
- if conversion between reference frames failspublic Attitude getAttitudeForces(LOFType lofType) throws OrekitException
Warning: this method creates a new local orbital frame at each call. For multiple calls, prefer using
getAttitude(Frame)
with your own LocalOrbitalFrame
.
lofType
- the LOF type
OrekitException
- if conversion between reference frames failspublic Attitude getAttitudeEvents()
getAttitude()
if there is no specific attitude
for Events).public Attitude getAttitudeEvents(Frame outputFrame) throws OrekitException
outputFrame
- frame in which the attitude is wanted
getAttitude(Frame)
if there is no specific attitude
for Events).
OrekitException
- if conversion between reference frames failspublic Attitude getAttitudeEvents(LOFType lofType) throws OrekitException
Warning: this method creates a new local orbital frame at each call. For multiple calls, prefer using
getAttitude(Frame)
with your own LocalOrbitalFrame
.
lofType
- the LOF type
getAttitude(LOFType)
if there is no specific attitude
for Events).
OrekitException
- if conversion between reference frames failspublic double getMass(String partName) throws OrekitException
partName
- given part
OrekitException
- if no mass informations defined for the given part.public Map<String,double[]> getAdditionalStates()
public Map<String,double[]> getAdditionalStatesMass()
public double[] getAdditionalState(String name) throws OrekitException
name
- additional state name.
OrekitException
- if the input additional state name is unknownpublic Map<String,AdditionalStateInfo> getAdditionalStatesInfos()
public void mapStateToArray(OrbitType orbitType, PositionAngle angleType, double[] stateVector)
orbitType
- the orbital
parameters typesangleType
- the position angles typestateVector
- flat array into which the state vector should be mappedpublic static boolean equalsAddStates(Map<String,double[]> addStates1, Map<String,double[]> addStates2)
addStates1
- the first additional states to compareaddStates2
- the second additional states to compare
public int getStateVectorSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |