Package gaiasky.util.gaia
Class ConcreteAttitude
- java.lang.Object
-
- gaiasky.util.gaia.ConcreteAttitude
-
- All Implemented Interfaces:
Attitude
public class ConcreteAttitude extends java.lang.Object implements Attitude
This class implements the Attitude interface and contains just the minimum fields necessary to define a unique attitude at a given time, plus a large number of methods to compute quantities that depend only on this attitude and time.The various scanning laws and specific attitude representations (e.g., using splines, or tables for interpolation) can be implemented as providing attitude objects of this type.
In some cases (in particular for simple analytical scanning laws) there are more direct ways to retrieve some of the quantities for which there are methods in this class (e.g.,
getHeliotropicAnglesRates()
); the present method(s) may then be overridden for efficiency.
-
-
Constructor Summary
Constructors Constructor Description ConcreteAttitude(long t, Quaterniond q, boolean withZeroSigmaCorr)
Construct object from time, and a quaternion.ConcreteAttitude(long t, Quaterniond q, Quaterniond qDot, boolean withZeroSigmaCorr)
Construct object from time, quaternion and its derivative.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getAlAcRates(double alInstrumentAngle, double acFieldAngle)
Compute the angular speed AL and AC of an inertial direction in the SRS frame, using instrument angles (phi, zeta).double[]
getAlAcRates(FOV fov, double alFieldAngle, double acFieldAngle)
Compute the angular speed AL and AC of an inertial direction in the SRS frame, using field angles (fov, eta, zeta).Vector3d[]
getFovDirections()
Get the PFoV and FFoV directions as an array of unit vectors expressed in the ICRS (or CoMRS).HeliotropicAnglesRates
getHeliotropicAnglesRates()
Quaterniond
getQuaternion()
Quaterniond
getQuaternionDot()
Get the time derivative of the attitude.Vector3d
getSpinVectorInIcrs()
Get the inertial spin vector in the ICRS (or CoMRS).Vector3d
getSpinVectorInSrs()
Get the inertial spin vector in the SRS.Vector3d[]
getSrsAxes(Vector3d[] xyz)
Get the x, y, z axes of the SRS as an array of three unit vectors expressed in the ICRS (or CoMRS).long
getTime()
Get the time that this attitude is valid for as a single long value.void
setQuaternion(Quaterniond q)
The the quaternion of the attitude.void
setQuaternionDot(Quaterniond qDot)
void
setTime(long time)
Set the time of the attitude.
-
-
-
Constructor Detail
-
ConcreteAttitude
public ConcreteAttitude(long t, Quaterniond q, boolean withZeroSigmaCorr)
Construct object from time, and a quaternion. This leaves the time derivative undefined. It can be set later withsetQuaternionDot(Quaterniond)
- Parameters:
t
- time of the attitudeq
- quaternion
-
ConcreteAttitude
public ConcreteAttitude(long t, Quaterniond q, Quaterniond qDot, boolean withZeroSigmaCorr)
Construct object from time, quaternion and its derivative.- Parameters:
t
- time of the attitudeq
- quaternionqDot
- time derivative of quaternion [1/day]
-
-
Method Detail
-
getTime
public long getTime()
Description copied from interface:Attitude
Get the time that this attitude is valid for as a single long value. The meaning of the time depends on the TimeContext of the AttitudeDataServer that generated the attitude. Use #getGaiaTime() to get the time as an absolute GaiaTime if needed.
-
setTime
public void setTime(long time)
Set the time of the attitude. This usually does not make sense as the time is set during construction of the object- Parameters:
time
- time of the attitude in [ns] since reference epoch
-
getQuaternion
public Quaterniond getQuaternion()
- Specified by:
getQuaternion
in interfaceAttitude
- Returns:
- quaternion that represents the attitude
-
setQuaternion
public void setQuaternion(Quaterniond q)
The the quaternion of the attitude. * Set the time of the attitude. This usually does not make sense as the time is set during construction of the- Parameters:
q
-
-
getQuaternionDot
public Quaterniond getQuaternionDot()
Get the time derivative of the attitude.- Specified by:
getQuaternionDot
in interfaceAttitude
- Returns:
- time derivative of the attitude quaternion [1/day]
-
setQuaternionDot
public void setQuaternionDot(Quaterniond qDot)
- Parameters:
qDot
- quaternion derivative to set - all components in [1/day]
-
getHeliotropicAnglesRates
public HeliotropicAnglesRates getHeliotropicAnglesRates()
-
getSpinVectorInSrs
public Vector3d getSpinVectorInSrs()
Description copied from interface:Attitude
Get the inertial spin vector in the SRS.- Specified by:
getSpinVectorInSrs
in interfaceAttitude
- Returns:
- spin vector in [rad/day] relative to SRS
-
getSpinVectorInIcrs
public Vector3d getSpinVectorInIcrs()
Description copied from interface:Attitude
Get the inertial spin vector in the ICRS (or CoMRS).- Specified by:
getSpinVectorInIcrs
in interfaceAttitude
- Returns:
- spin vector in [rad/day] relative to ICRS
-
getFovDirections
public Vector3d[] getFovDirections()
Description copied from interface:Attitude
Get the PFoV and FFoV directions as an array of unit vectors expressed in the ICRS (or CoMRS).- Specified by:
getFovDirections
in interfaceAttitude
- Returns:
- array of two (PFoV, FFoV3) vectors
-
getSrsAxes
public Vector3d[] getSrsAxes(Vector3d[] xyz)
Description copied from interface:Attitude
Get the x, y, z axes of the SRS as an array of three unit vectors expressed in the ICRS (or CoMRS).- Specified by:
getSrsAxes
in interfaceAttitude
- Returns:
- array of three (x, y, z) vectors
- See Also:
Attitude.getSrsAxes(Vector3d[])
-
getAlAcRates
public double[] getAlAcRates(double alInstrumentAngle, double acFieldAngle)
Description copied from interface:Attitude
Compute the angular speed AL and AC of an inertial direction in the SRS frame, using instrument angles (phi, zeta).- Specified by:
getAlAcRates
in interfaceAttitude
- Parameters:
alInstrumentAngle
- (=AL angle phi) of the direction [rad]acFieldAngle
- (=AC angle zeta) of the direction [rad]- Returns:
- two-element double array containing the angular speed AL and AC [rad/s]
-
getAlAcRates
public double[] getAlAcRates(FOV fov, double alFieldAngle, double acFieldAngle)
Description copied from interface:Attitude
Compute the angular speed AL and AC of an inertial direction in the SRS frame, using field angles (fov, eta, zeta).- Specified by:
getAlAcRates
in interfaceAttitude
- Parameters:
fov
- FOV (Preceding or Following)alFieldAngle
- (=AL angle eta) of the direction [rad]acFieldAngle
- (=AC angle zeta) of the direction [rad]- Returns:
- two-element double array containing the angular speed AL and AC [rad/s]
-
-