public final class AttitudeLegsSequence extends Object implements AttitudeLeg
AttitudeLeg
.
This class is different from the AttitudesSequence
class in Orekit because even if they both represent a
sequence of attitude laws, AttitudeLegsSequence
contains attitude laws version "Attitude", while
AttitudesSequence
contains attitude laws version "Orbit determination"; moreover,
AttitudeLegsSequence
does not perform events detection between two consecutive attitude laws. This class
implements AttitudeLeg, so it can be used as one.
VERY IMPORTANT NOTICE : this class breaches the contract for AttitudeLeg : the PVCoordinatesProvider parameter in the getAttitude() calls is never used, the instance uses the inner PVCoordinatesProvider instead. This breach was necessary; it ensures the consistency between the attitude law legs and the slews between them. Indeed, to avoid performances problems, the slews are built and computed given a specific PVCoordinatesProvider. Therefore, all inner AttitudeLeg instances use the same PVCoordinatesProvider instance.
Constructor and Description |
---|
AttitudeLegsSequence(PVCoordinatesProvider pvcp)
Only constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String code,
AttitudeLeg leg)
Adds an AttitudeLeg instance to the sequence, with conditions.
The conditions are : A new instance can only be inserted at the beginning or the end of the sequence (except the first one of course). |
Attitude |
getAttitude(Orbit orbit)
Compute the attitude corresponding to an orbital state.
|
Attitude |
getAttitude(PVCoordinatesProvider pvProv,
AbsoluteDate date,
Frame frame)
Gets the attitude from the sequence.
The AttitudeLeg matching the date is called to compute the attitude. |
AttitudeLeg |
getAttitudeLeg(AbsoluteDate date)
Gets the
AttitudeLeg corresponding to the date. |
AttitudeLeg |
getAttitudeLeg(String code)
Get the attitude leg in the sequence with the selected code.
|
AttitudeLeg |
getFirstAttitudeLeg()
Gets the first leg.
|
AttitudeLeg |
getLastAttitudeLeg()
Gets the last leg.
|
AttitudeLeg |
getNextAttitudeLeg(AttitudeLeg law)
Gets the next attitude law after the selected
AttitudeLeg law. |
AttitudeLeg |
getNextAttitudeLeg(String law)
Gets the next attitude law after the
AttitudeLeg law with the selected code. |
Attitude |
getOldAttitudeOnTransition(PVCoordinatesProvider pvProv,
AbsoluteDate date,
Frame frame)
Returns the attitude at a transition date for the old attitude law (the law previous to
the valid transition law).
|
AttitudeLeg |
getPreviousAttitudeLeg(AttitudeLeg law)
Gets the previous attitude law before the selected
AttitudeLeg law. |
AttitudeLeg |
getPreviousAttitudeLeg(String law)
Gets the previous attitude law before the selected
AttitudeLeg law. |
LinkedHashMap<String,AttitudeLeg> |
getSequence()
Returns a copy of the map containing of all AttitudeLeg instances.
|
AbsoluteDateInterval |
getTimeInterval()
Return the time interval of validity
|
boolean |
isEmpty()
Returns true if the sequence is empty.
|
void |
setSpinDerivativesComputation(boolean computeSpinDerivatives)
Method to activate spin derivative computation.
|
public AttitudeLegsSequence(PVCoordinatesProvider pvcp)
pvcp
- the PVCoordinates instances that all AttitudeLeg providers are meant to use.public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws PatriusException
PatriusException
is thrown.getAttitude
in interface AttitudeProvider
pvProv
- unused provider, can be null. See class comments.date
- the date for which the attitude is computedframe
- the frame for which the attitude is computedPatriusException
- if the date is out of the sequence's range.public AbsoluteDateInterval getTimeInterval()
AttitudeLeg
getTimeInterval
in interface AttitudeLeg
public void setSpinDerivativesComputation(boolean computeSpinDerivatives)
Spin derivatives computation does not apply to provided laws. Call
setSpinDerivativesComputation(boolean)
on each law to activate/deactivate underlying law spin derivative
computation.
setSpinDerivativesComputation
in interface AttitudeProvider
computeSpinDerivatives
- true if spin derivatives should be computedpublic LinkedHashMap<String,AttitudeLeg> getSequence()
public void add(String code, AttitudeLeg leg) throws PatriusException
IllegalArgumentException
will be raised.code
- the code of the attitude leg to be added to the sequenceleg
- the attitude leg to be added to the sequencePatriusException
- if the AttitudeLeg is a non computed slewIllegalArgumentException
- if the attitude leg does not match the conditionspublic boolean isEmpty()
public AttitudeLeg getFirstAttitudeLeg()
public AttitudeLeg getLastAttitudeLeg()
public AttitudeLeg getNextAttitudeLeg(AttitudeLeg law) throws PatriusException
AttitudeLeg
law.law
- the previous AttitudeLeg
AttitudeLeg
PatriusException
- attitude exceptionpublic AttitudeLeg getNextAttitudeLeg(String law) throws PatriusException
AttitudeLeg
law with the selected code.law
- the code of the previous AttitudeLeg
AttitudeLeg
PatriusException
- attitude exceptionpublic AttitudeLeg getPreviousAttitudeLeg(AttitudeLeg law) throws PatriusException
AttitudeLeg
law.law
- the next AttitudeLeg
AttitudeLeg
PatriusException
- attitude exceptionpublic AttitudeLeg getPreviousAttitudeLeg(String law) throws PatriusException
AttitudeLeg
law.law
- the next AttitudeLeg
AttitudeLeg
PatriusException
- attitude exceptionpublic Attitude getOldAttitudeOnTransition(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws PatriusException
pvProv
- unused provider, can be null. See class comments.date
- the date for which the attitude is computedframe
- the frame for which the attitude is computedPatriusException
- attitude exceptionpublic AttitudeLeg getAttitudeLeg(AbsoluteDate date) throws PatriusException
AttitudeLeg
corresponding to the date. If date corresponds to the limit of an interval, the
second law is returned.date
- the date at which you want the AttitudeLeg
AttitudeLeg
PatriusException
- attitude exceptionpublic AttitudeLeg getAttitudeLeg(String code) throws PatriusException
code
- the codePatriusException
- when the law with the selected code is not in the sequencepublic Attitude getAttitude(Orbit orbit) throws PatriusException
getAttitude
in interface AttitudeProvider
orbit
- current orbitPatriusException
- if attitude cannot be computedCopyright © 2018 CNES. All Rights Reserved.