|
Isis 3 Programmer Reference
|
1 #ifndef SpiceRotation_h
2 #define SpiceRotation_h
12 #include <nlohmann/json.hpp>
13 #include <ale/Orientations.h>
17 #include "PolynomialUnivariate.h"
18 #include "Quaternion.h"
292 std::vector<double>
Matrix();
305 std::vector<double>
J2000Vector(
const std::vector<double> &rVec);
332 void LoadCache(
double startTime,
double endTime,
int size);
349 std::vector<double>
Angles(
int axis3,
int axis2,
int axis1);
350 void SetAngles(std::vector<double> angles,
int axis3,
int axis2,
int axis1);
357 const std::vector<double> &abcAng2,
358 const std::vector<double> &abcAng3,
363 const std::vector<Angle> &decCoeff,
364 const std::vector<Angle> &pmCoeff);
367 std::vector<double> &abcAng2,
368 std::vector<double> &abcAng3);
371 std::vector<Angle> &decCoeff,
372 std::vector<Angle> &pmCoeff);
384 void SetCacheTime(std::vector<double> cacheTime);
390 std::vector<double>
toJ2000Partial(
const std::vector<double> &lookT,
394 void DCJdt(std::vector<double> &dRJ);
396 double WrapAngle(
double compareAngle,
double angle);
397 void SetAxes(
int axis1,
int axis2,
int axis3);
414 return m_orientation->getRotations().size();
432 ale::Orientations *m_orientation;
double GetBaseTime()
Accessor method to get the rotation base time.
int p_fullCacheSize
Initial requested cache size.
void ComputeAv()
Compute the angular velocity from the time-based functions fit to the pointing angles This method com...
double EphemerisTime() const
Accessor method to get current ephemeris time.
std::vector< Angle > sysNutPrecConstants()
Return the constants used to calculate the target body system nut/prec angles.
@ BPC
Isis specific code for binary pck.
void checkForBinaryPck()
Check loaded pck to see if any are binary and set frame type to indicate binary pck.
Contains Pvl Groups and Pvl Objects.
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
std::vector< Angle > pmCoefs()
Return the coefficients used to calculate the target body prime meridian.
int p_axis3
Axis of rotation for angle 3 of rotation.
void CacheLabel(Table &table)
Add labels to a SpiceRotation table.
std::vector< double > GetFullCacheTime()
Return full listing (cache) of original time coverage requested.
std::vector< double > EvaluatePolyFunction()
Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.
FrameType
Enumeration for the frame type of the rotation.
Quaternion p_quaternion
Quaternion for J2000 to reference rotation at et.
int p_axis1
Axis of rotation for angle 1 of rotation.
FrameType m_frameType
The type of rotation frame.
std::vector< double > p_coefficients[3]
Coefficients defining functions fit to 3 pointing angles.
double p_overrideBaseTime
Value set by caller to override computed base time.
double p_timeBias
iTime bias when reading kernels
std::vector< double > p_cacheTime
iTime for corresponding rotation
DownsizeStatus
Status of downsizing the cache.
void setFrameType()
Cached orientation information.
double p_baseTime
Base time used in fit equations.
std::vector< int > p_constantFrames
Chain of Naif frame codes in constant rotation TC.
void SetPolynomialDegree(int degree)
Set the degree of the polynomials to be fit to the three camera angles for the time period covered by...
bool p_matrixSet
Flag indicating p_TJ has been set.
Source
The rotation can come from one of 3 places for an Isis cube.
void loadPCFromTable(const PvlObject &Label)
Initialize planetary orientation constants from an cube body rotation label.
std::vector< double > GetCenterAngles()
Return the camera angles at the center time of the observation.
std::vector< Angle > poleRaCoefs()
Return the coefficients used to calculate the target body pole ra.
void SetPolynomial(const Source type=PolyFunction)
Set the coefficients of a polynomial fit to each of the three camera angles for the time period cover...
std::vector< double > TimeBasedRotation()
Return time-based 3x3 rotation CJ matrix as a quaternion.
std::vector< double > m_raNutPrec
Coefficients of pole right ascension nut/prec terms.
Source GetSource()
Accessor method to get the rotation source.
std::vector< Angle > poleDecCoefs()
Return the coefficients used to calculate the target body pole dec.
std::vector< double > p_TC
Rotation matrix from first constant rotation (after all time-based rotations in frame chain from J200...
void FrameTrace(double et)
Compute frame trace chain from target frame to J2000.
void SetFullCacheParameters(double startTime, double endTime, int cacheSize)
Set the full cache time parameters.
@ PckPolyFunction
Quadratic polynomial function with linear trignometric terms.
void setEphemerisTimeMemcache()
Updates rotation state based on the rotation cache.
void SetAngles(std::vector< double > angles, int axis3, int axis2, int axis1)
Set the rotation angles (phi, delta, and w) for the current time to define the time-based matrix CJ.
std::vector< double > J2000Vector(const std::vector< double > &rVec)
Given a direction vector in the reference frame, return a J2000 direction.
void MinimizeCache(DownsizeStatus status)
Set the downsize status to minimize cache.
std::vector< double > Angles(int axis3, int axis2, int axis1)
Return the camera angles (right ascension, declination, and twist) for the time-based matrix CJ.
Table Cache(const QString &tableName)
Return a table with J2000 to reference rotations.
std::vector< Angle > sysNutPrecCoefs()
Return the coefficients used to calculate the target body system nut/prec angles.
void setEphemerisTimeSpice()
When setting the ephemeris time, updates the rotation state based on data read directly from NAIF ker...
std::vector< double > m_decNutPrec
Coefficients of pole decliniation nut/prec terms.
virtual ~SpiceRotation()
Destructor for SpiceRotation object.
std::vector< double > StateTJ()
State matrix (6x6) for rotating state vectors from J2000 to target frame.
int p_axis2
Axis of rotation for angle 2 of rotation.
double p_fullCacheStartTime
Initial requested starting time of cache.
void LoadCache(double startTime, double endTime, int size)
Cache J2000 rotation quaternion over a time range.
std::vector< double > p_av
Angular velocity for rotation at time p_et.
int p_axisV
The axis defined by the velocity vector for defining a nadir rotation.
bool HasAngularVelocity()
Checks whether the rotation has angular velocities.
std::vector< double > p_CJ
Rotation matrix from J2000 to first constant rotation.
std::vector< int > p_timeFrames
Chain of Naif frame codes in time-based rotation CJ.
@ INERTL
See Naif Frames.req document for.
void setEphemerisTimePolyFunctionOverSpice()
When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kern...
std::vector< Angle > m_sysNutPrec1
Linear terms of planetary system nut/prec periods.
int p_degree
Degree of fit polynomial for angles.
static const double m_dayScale
Seconds per day for scaling time in seconds to get target body w.
@ Memcache
From cached table.
@ No
Do not downsize the cache.
bool p_noOverride
Flag to compute base time;.
bool IsCached() const
Checks if the cache is empty.
void SetConstantMatrix(std::vector< double > constantMatrix)
Set the constant 3x3 rotation TC matrix from a vector of length 9.
void LoadTimeCache()
Load the time cache.
PartialType
This enumeration indicates whether the partial derivative is taken with respect to Right Ascension,...
int p_axisP
The axis defined by the spacecraft vector for defining a nadir rotation.
std::vector< double > ToReferencePartial(std::vector< double > &lookJ, PartialType partialVar, int coeffIndex)
Compute the derivative with respect to one of the coefficients in the angle polynomial fit equation o...
std::vector< double > ConstantRotation()
Return the constant 3x3 rotation TC matrix as a quaternion.
std::vector< Angle > m_raPole
Coefficients of a quadratic polynomial fitting pole ra.
@ WRT_Declination
With respect to Declination.
Class for storing Table blobs information.
double DPolynomial(const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
std::vector< Angle > m_sysNutPrec0
Constants of planetary system nut/prec periods.
@ UNKNOWN
Isis specific code for unknown frame type.
std::vector< double > AngularVelocity()
Accessor method to get the angular velocity.
@ WRT_Twist
With respect to Twist or Prime Meridian Rotation.
void SetSource(Source source)
Resets the source of the rotation to the given value.
@ PolyFunction
From nth degree polynomial.
std::vector< int > ConstantFrameChain()
Accessor method to get the frame chain for the constant part of the rotation (ends in target)
double p_et
Current ephemeris time.
static const double m_centScale
Seconds per Julian century for scaling time in seconds.
void InitConstantRotation(double et)
Initialize the constant rotation.
std::vector< double > Extrapolate(double timeEt)
Extrapolate pointing for a given time assuming a constant angular velocity.
@ NOTJ2000PCK
PCK frame not referenced to J2000.
double WrapAngle(double compareAngle, double angle)
Wrap the input angle to keep it within 2pi radians of the angle to compare.
int Frame()
Accessor method that returns the frame code.
Provide operations for quaternion arithmetic.
double DPckPolynomial(PartialType partialVar, const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
std::vector< Angle > m_decPole
Coefficients of a quadratic polynomial fitting pole dec.
Table LineCache(const QString &tableName)
Return a table with J2000 to reference rotations.
void usePckPolynomial()
Set the coefficients of a polynomial fit to each of the three planet angles for the time period cover...
void SetOverrideBaseTime(double baseTime, double timeScale)
Set an override base time to be used with observations on scanners to allow all images in an observat...
std::vector< Angle > m_pm
Coefficients of a quadratic polynomial fitting pole pm.
void getPckPolynomial(std::vector< Angle > &raCoeff, std::vector< Angle > &decCoeff, std::vector< Angle > &pmCoeff)
Return the coefficients of a polynomial fit to each of the three planet angles.
int p_targetCode
For computing Nadir rotation only.
@ Done
Cache is downsized.
std::vector< double > m_pmNutPrec
Coefficients of prime meridian nut/prec terms.
void GetPolynomial(std::vector< double > &abcAng1, std::vector< double > &abcAng2, std::vector< double > &abcAng3)
Return the coefficients of a polynomial fit to each of the three camera angles for the time period co...
std::vector< double > & ConstantMatrix()
Return the constant 3x3 rotation TC matrix as a vector of length 9.
bool p_degreeApplied
Flag indicating whether or not a polynomial of degree p_degree has been created and used to fill the ...
std::vector< double > toJ2000Partial(const std::vector< double > &lookT, PartialType partialVar, int coeffIndex)
Given a direction vector in the reference frame, compute the derivative with respect to one of the co...
std::vector< int > TimeFrameChain()
Accessor method to get the frame chain for the rotation (begins in J2000).
bool m_tOrientationAvailable
Target orientation constants are available.
double TimeBias() const
Accessor method to get current time bias.
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
void setEphemerisTimePolyFunction()
When setting the ephemeris time, updates the rotation according to a polynomial that defines the thre...
void ReloadCache()
Cache J2000 rotation over existing cached time range using polynomials.
void SetTimeBasedMatrix(std::vector< double > timeBasedMatrix)
Set the time-based 3x3 rotation CJ matrix from a vector of length 9.
void loadPCFromSpice(int CenterBodyCode)
Initialize planetary orientation constants from Spice PCK.
bool p_hasAngularVelocity
Flag indicating whether the rotation includes angular velocity.
@ WRT_RightAscension
With respect to Right Ascension.
void DCJdt(std::vector< double > &dRJ)
Compute the derivative of the 3x3 rotation matrix CJ with respect to time.
double p_timeScale
Time scale used in fit equations.
double GetTimeScale()
Accessor method to get the rotation time scale.
std::vector< double > poleRaNutPrecCoefs()
Return the coefficients used to calculate the target body pole ra nut/prec coefficients.
SpiceRotation(int frameCode)
Construct an empty SpiceRotation class using a valid Naif frame code to set up for getting rotation f...
void SetAxes(int axis1, int axis2, int axis3)
Set the axes of rotation for decomposition of a rotation matrix into 3 angles.
@ PolyFunctionOverSpice
Kernels plus nth degree polynomial.
double p_overrideTimeScale
Value set by caller to override computed time scale.
std::vector< double > ReferenceVector(const std::vector< double > &jVec)
Given a direction vector in J2000, return a reference frame direction.
std::vector< double > poleDecNutPrecCoefs()
Return the coefficients used to calculate the target body pole dec nut/prec coefficients.
@ Spice
Directly from the kernels.
void SetFrame(int frameCode)
Change the frame to the given frame code.
void setPckPolynomial(const std::vector< Angle > &raCoeff, const std::vector< Angle > &decCoeff, const std::vector< Angle > &pmCoeff)
Set the coefficients of a polynomial fit to each of the three planet angles for the time period cover...
std::vector< double > & TimeBasedMatrix()
Return time-based 3x3 rotation CJ matrix as a vector of length 9.
std::vector< double > pmNutPrecCoefs()
Return the coefficients used to calculate the target body pm nut/prec coefficients.
double p_fullCacheEndTime
Initial requested ending time of cache.
void setEphemerisTimeNadir()
When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.
FrameType getFrameType()
Accessor method to get the rotation frame type.
DownsizeStatus p_minimizeCache
Status of downsizing the cache (set to No to ignore)
This is free and unencumbered software released into the public domain.
void SetEphemerisTime(double et)
Return the J2000 to reference frame quaternion at given time.
Source p_source
The source of the rotation data.
void setEphemerisTimePckPolyFunction()
When setting the ephemeris time, updates the rotation state based on the PcK polynomial.
Obtain SPICE rotation information for a body.
void ComputeBaseTime()
Compute the base time using cached times.