12#include <nlohmann/json.hpp>
13#include <ale/Orientations.h>
290 std::vector<double>
Matrix();
303 std::vector<double>
J2000Vector(
const std::vector<double> &rVec);
330 void LoadCache(
double startTime,
double endTime,
int size);
347 std::vector<double>
Angles(
int axis3,
int axis2,
int axis1);
348 void SetAngles(std::vector<double> angles,
int axis3,
int axis2,
int axis1);
355 const std::vector<double> &abcAng2,
356 const std::vector<double> &abcAng3,
361 const std::vector<Angle> &decCoeff,
362 const std::vector<Angle> &pmCoeff);
365 std::vector<double> &abcAng2,
366 std::vector<double> &abcAng3);
369 std::vector<Angle> &decCoeff,
370 std::vector<Angle> &pmCoeff);
388 std::vector<double>
toJ2000Partial(
const std::vector<double> &lookT,
392 void DCJdt(std::vector<double> &dRJ);
394 double WrapAngle(
double compareAngle,
double angle);
395 void SetAxes(
int axis1,
int axis2,
int axis3);
435 std::vector<int> p_constantFrames;
438 std::vector<int> p_timeFrames;
448 bool m_tOrientationAvailable;
461 bool p_degreeApplied;
464 std::vector<double> p_coefficients[3];
467 double p_overrideBaseTime;
468 double p_overrideTimeScale;
470 double p_fullCacheStartTime;
471 double p_fullCacheEndTime;
473 std::vector<double> p_TC;
476 std::vector<double> p_CJ;
478 std::vector<double> p_av;
479 bool p_hasAngularVelocity;
481 std::vector<double> StateTJ();
563 std::vector<Angle>m_raPole;
564 std::vector<Angle>m_decPole;
565 std::vector<Angle>m_pm ;
570 std::vector<double>m_raNutPrec;
571 std::vector<double>m_decNutPrec;
572 std::vector<double>m_pmNutPrec;
575 std::vector<Angle>m_sysNutPrec0;
576 std::vector<Angle>m_sysNutPrec1;
582 static const double m_centScale;
584 static const double m_dayScale;
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
Provide operations for quaternion arithmetic.
Definition Quaternion.h:36
Obtain SPICE rotation information for a body.
Definition SpiceRotation.h:208
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...
Definition SpiceRotation.cpp:1594
void setEphemerisTimePolyFunction()
When setting the ephemeris time, updates the rotation according to a polynomial that defines the thre...
Definition SpiceRotation.cpp:3419
std::vector< double > GetFullCacheTime()
Return full listing (cache) of original time coverage requested.
Definition SpiceRotation.cpp:2695
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...
Definition SpiceRotation.cpp:1726
void loadPCFromTable(const PvlObject &Label)
Initialize planetary orientation constants from an cube body rotation label.
Definition SpiceRotation.cpp:1090
void SetConstantMatrix(std::vector< double > constantMatrix)
Set the constant 3x3 rotation TC matrix from a vector of length 9.
Definition SpiceRotation.cpp:2892
void SetFullCacheParameters(double startTime, double endTime, int cacheSize)
Set the full cache time parameters.
Definition SpiceRotation.cpp:3152
double GetTimeScale()
Accessor method to get the rotation time scale.
Definition SpiceRotation.cpp:2420
int Frame()
Accessor method that returns the frame code.
Definition SpiceRotation.cpp:225
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...
Definition SpiceRotation.cpp:2015
int cacheSize()
Definition SpiceRotation.h:410
FrameType getFrameType()
Accessor method to get the rotation frame type.
Definition SpiceRotation.cpp:2379
int p_degree
Degree of fit polynomial for angles.
Definition SpiceRotation.h:426
void setEphemerisTimePckPolyFunction()
When setting the ephemeris time, updates the rotation state based on the PcK polynomial.
Definition SpiceRotation.cpp:3515
void CacheLabel(Table &table)
Add labels to a SpiceRotation table.
Definition SpiceRotation.cpp:1169
void SetTimeBasedMatrix(std::vector< double > timeBasedMatrix)
Set the time-based 3x3 rotation CJ matrix from a vector of length 9.
Definition SpiceRotation.cpp:2927
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
Definition SpiceRotation.cpp:2852
double EphemerisTime() const
Accessor method to get current ephemeris time.
Definition SpiceRotation.cpp:306
void SetAxes(int axis1, int axis2, int axis3)
Set the axes of rotation for decomposition of a rotation matrix into 3 angles.
Definition SpiceRotation.cpp:2437
double GetBaseTime()
Accessor method to get the rotation base time.
Definition SpiceRotation.cpp:2410
std::vector< double > EvaluatePolyFunction()
Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.
Definition SpiceRotation.cpp:3385
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...
Definition SpiceRotation.cpp:2219
void ReloadCache()
Cache J2000 rotation over existing cached time range using polynomials.
Definition SpiceRotation.cpp:728
std::vector< Angle > poleDecCoefs()
Return the coefficients used to calculate the target body pole dec.
Definition SpiceRotation.cpp:1464
double WrapAngle(double compareAngle, double angle)
Wrap the input angle to keep it within 2pi radians of the angle to compare.
Definition SpiceRotation.cpp:2302
std::vector< double > GetCenterAngles()
Return the camera angles at the center time of the observation.
Definition SpiceRotation.cpp:1277
void setEphemerisTimeNadir()
When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.
Definition SpiceRotation.cpp:3287
Source GetSource()
Accessor method to get the rotation source.
Definition SpiceRotation.cpp:2389
void LoadTimeCache()
Load the time cache.
Definition SpiceRotation.cpp:2459
std::vector< double > & TimeBasedMatrix()
Return time-based 3x3 rotation CJ matrix as a vector of length 9.
Definition SpiceRotation.cpp:2917
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.
Definition SpiceRotation.cpp:1296
void InitConstantRotation(double et)
Initialize the constant rotation.
Definition SpiceRotation.cpp:2938
int p_axis1
Axis of rotation for angle 1 of rotation.
Definition SpiceRotation.h:427
int p_axis3
Axis of rotation for angle 3 of rotation.
Definition SpiceRotation.h:429
Table Cache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition SpiceRotation.cpp:855
void LoadCache(double startTime, double endTime, int size)
Cache J2000 rotation quaternion over a time range.
Definition SpiceRotation.cpp:349
std::vector< double > ConstantRotation()
Return the constant 3x3 rotation TC matrix as a quaternion.
Definition SpiceRotation.cpp:2867
std::vector< double > ReferenceVector(const std::vector< double > &jVec)
Given a direction vector in J2000, return a reference frame direction.
Definition SpiceRotation.cpp:1687
std::vector< double > AngularVelocity()
Accessor method to get the angular velocity.
Definition SpiceRotation.cpp:1352
std::vector< Angle > sysNutPrecCoefs()
Return the coefficients used to calculate the target body system nut/prec angles.
Definition SpiceRotation.cpp:1570
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...
Definition SpiceRotation.cpp:2097
Table LineCache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition SpiceRotation.cpp:819
std::vector< double > J2000Vector(const std::vector< double > &rVec)
Given a direction vector in the reference frame, return a J2000 direction.
Definition SpiceRotation.cpp:1395
double DPckPolynomial(PartialType partialVar, const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
Definition SpiceRotation.cpp:2159
void SetEphemerisTime(double et)
Return the J2000 to reference frame quaternion at given time.
Definition SpiceRotation.cpp:260
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition SpiceRotation.cpp:214
std::vector< int > TimeFrameChain()
Accessor method to get the frame chain for the rotation (begins in J2000).
Definition SpiceRotation.cpp:1373
SpiceRotation(int frameCode)
Construct an empty SpiceRotation class using a valid Naif frame code to set up for getting rotation f...
Definition SpiceRotation.cpp:58
std::vector< Angle > sysNutPrecConstants()
Return the constants used to calculate the target body system nut/prec angles.
Definition SpiceRotation.cpp:1552
std::vector< double > Extrapolate(double timeEt)
Extrapolate pointing for a given time assuming a constant angular velocity.
Definition SpiceRotation.cpp:3123
std::vector< double > poleRaNutPrecCoefs()
Return the coefficients used to calculate the target body pole ra nut/prec coefficients.
Definition SpiceRotation.cpp:1501
std::vector< double > p_cacheTime
iTime for corresponding rotation
Definition SpiceRotation.h:425
DownsizeStatus
Status of downsizing the cache.
Definition SpiceRotation.h:265
@ Done
Cache is downsized.
Definition SpiceRotation.h:267
@ No
Do not downsize the cache.
Definition SpiceRotation.h:268
@ Yes
Downsize the cache.
Definition SpiceRotation.h:266
void checkForBinaryPck()
Check loaded pck to see if any are binary and set frame type to indicate binary pck.
Definition SpiceRotation.cpp:3167
std::vector< Angle > poleRaCoefs()
Return the coefficients used to calculate the target body pole ra.
Definition SpiceRotation.cpp:1444
void setEphemerisTimePolyFunctionOverSpice()
When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kern...
Definition SpiceRotation.cpp:3469
void SetCacheTime(std::vector< double > cacheTime)
Definition SpiceRotation.cpp:2104
void SetSource(Source source)
Resets the source of the rotation to the given value.
Definition SpiceRotation.cpp:2399
void setEphemerisTimeSpice()
When setting the ephemeris time, updates the rotation state based on data read directly from NAIF ker...
Definition SpiceRotation.cpp:3326
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...
Definition SpiceRotation.cpp:2038
Source
The rotation can come from one of 3 places for an Isis cube.
Definition SpiceRotation.h:243
@ PolyFunction
From nth degree polynomial.
Definition SpiceRotation.h:247
@ Spice
Directly from the kernels.
Definition SpiceRotation.h:244
@ Nadir
Nadir pointing.
Definition SpiceRotation.h:245
@ PckPolyFunction
Quadratic polynomial function with linear trignometric terms.
Definition SpiceRotation.h:249
@ Memcache
From cached table.
Definition SpiceRotation.h:246
@ PolyFunctionOverSpice
Kernels plus nth degree polynomial.
Definition SpiceRotation.h:248
PartialType
This enumeration indicates whether the partial derivative is taken with respect to Right Ascension,...
Definition SpiceRotation.h:256
@ WRT_RightAscension
With respect to Right Ascension.
Definition SpiceRotation.h:257
@ WRT_Twist
With respect to Twist or Prime Meridian Rotation.
Definition SpiceRotation.h:259
@ WRT_Declination
With respect to Declination.
Definition SpiceRotation.h:258
void loadPCFromSpice(int CenterBodyCode)
Initialize planetary orientation constants from Spice PCK.
Definition SpiceRotation.cpp:978
ale::Orientations * m_orientation
Definition SpiceRotation.h:430
void setEphemerisTimeMemcache()
Updates rotation state based on the rotation cache.
Definition SpiceRotation.cpp:3255
void ComputeAv()
Compute the angular velocity from the time-based functions fit to the pointing angles This method com...
Definition SpiceRotation.cpp:2969
double DPolynomial(const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
Definition SpiceRotation.cpp:2124
void ComputeBaseTime()
Compute the base time using cached times.
Definition SpiceRotation.cpp:2074
void SetPolynomialDegree(int degree)
Set the degree of the polynomials to be fit to the three camera angles for the time period covered by...
Definition SpiceRotation.cpp:2330
void MinimizeCache(DownsizeStatus status)
Set the downsize status to minimize cache.
Definition SpiceRotation.cpp:326
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.
Definition SpiceRotation.cpp:1323
bool HasAngularVelocity()
Checks whether the rotation has angular velocities.
Definition SpiceRotation.cpp:1383
void DCJdt(std::vector< double > &dRJ)
Compute the derivative of the 3x3 rotation matrix CJ with respect to time.
Definition SpiceRotation.cpp:3014
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Definition SpiceRotation.cpp:242
std::vector< int > ConstantFrameChain()
Accessor method to get the frame chain for the constant part of the rotation (ends in target)
Definition SpiceRotation.cpp:1363
void FrameTrace(double et)
Compute frame trace chain from target frame to J2000.
Definition SpiceRotation.cpp:2727
int p_axis2
Axis of rotation for angle 2 of rotation.
Definition SpiceRotation.h:428
std::vector< double > & ConstantMatrix()
Return the constant 3x3 rotation TC matrix as a vector of length 9.
Definition SpiceRotation.cpp:2882
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.
Definition SpiceRotation.cpp:2060
std::vector< double > pmNutPrecCoefs()
Return the coefficients used to calculate the target body pm nut/prec coefficients.
Definition SpiceRotation.cpp:1535
FrameType
Enumeration for the frame type of the rotation.
Definition SpiceRotation.h:274
@ INERTL
See Naif Frames.req document for.
Definition SpiceRotation.h:276
@ CK
Definition SpiceRotation.h:278
@ TK
Definition SpiceRotation.h:279
@ PCK
definitions
Definition SpiceRotation.h:277
@ DYN
Definition SpiceRotation.h:280
@ NOTJ2000PCK
PCK frame not referenced to J2000.
Definition SpiceRotation.h:282
@ UNKNOWN
Isis specific code for unknown frame type.
Definition SpiceRotation.h:275
@ BPC
Isis specific code for binary pck.
Definition SpiceRotation.h:281
bool IsCached() const
Checks if the cache is empty.
Definition SpiceRotation.cpp:316
std::vector< double > poleDecNutPrecCoefs()
Return the coefficients used to calculate the target body pole dec nut/prec coefficients.
Definition SpiceRotation.cpp:1518
std::vector< Angle > pmCoefs()
Return the coefficients used to calculate the target body prime meridian.
Definition SpiceRotation.cpp:1483
virtual ~SpiceRotation()
Destructor for SpiceRotation object.
Definition SpiceRotation.cpp:200
void usePckPolynomial()
Set the coefficients of a polynomial fit to each of the three planet angles for the time period cover...
Definition SpiceRotation.cpp:1935
std::vector< double > TimeBasedRotation()
Return time-based 3x3 rotation CJ matrix as a quaternion.
Definition SpiceRotation.cpp:2902
Class for storing Table blobs information.
Definition Table.h:61
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16