Isis 3 Programmer Reference
Isis::SpiceRotation Class Reference

Obtain SPICE rotation information for a body. More...

#include <SpiceRotation.h>

Collaboration diagram for Isis::SpiceRotation:
Collaboration graph

Public Types

enum  Source {
  Spice , Nadir , Memcache , PolyFunction ,
  PolyFunctionOverSpice , PckPolyFunction
}
 The rotation can come from one of 3 places for an Isis cube. More...
 
enum  PartialType { WRT_RightAscension , WRT_Declination , WRT_Twist }
 This enumeration indicates whether the partial derivative is taken with respect to Right Ascension, Declination, or Twist (or Rotation). More...
 
enum  DownsizeStatus { Yes , Done , No }
 Status of downsizing the cache. More...
 
enum  FrameType {
  UNKNOWN = 0 , INERTL = 1 , PCK = 2 , CK = 3 ,
  TK = 4 , DYN = 5 , BPC = 6 , NOTJ2000PCK = 7
}
 Enumeration for the frame type of the rotation. More...
 

Public Member Functions

 SpiceRotation (int frameCode)
 Construct an empty SpiceRotation class using a valid Naif frame code to set up for getting rotation from Spice kernels.
 
 SpiceRotation (int frameCode, int targetCode)
 Construct an empty SpiceRotation object using valid Naif frame code and.
 
 SpiceRotation (const SpiceRotation &rotToCopy)
 Construct a SpiceRotation object by copying from an existing one.
 
virtual ~SpiceRotation ()
 Destructor for SpiceRotation object.
 
void SetFrame (int frameCode)
 Change the frame to the given frame code.
 
int Frame ()
 Accessor method that returns the frame code.
 
void SetTimeBias (double timeBias)
 Apply a time bias when invoking SetEphemerisTime method.
 
void SetEphemerisTime (double et)
 Return the J2000 to reference frame quaternion at given time.
 
double EphemerisTime () const
 Accessor method to get current ephemeris time.
 
std::vector< double > GetCenterAngles ()
 Return the camera angles at the center time of the observation.
 
std::vector< double > Matrix ()
 Return the full rotation TJ as a matrix.
 
std::vector< double > AngularVelocity ()
 Accessor method to get the angular velocity.
 
std::vector< double > ConstantRotation ()
 Return the constant 3x3 rotation TC matrix as a quaternion.
 
std::vector< double > & ConstantMatrix ()
 Return the constant 3x3 rotation TC matrix as a vector of length 9.
 
void SetConstantMatrix (std::vector< double > constantMatrix)
 Set the constant 3x3 rotation TC matrix from a vector of length 9.
 
std::vector< double > TimeBasedRotation ()
 Return time-based 3x3 rotation CJ matrix as a quaternion.
 
std::vector< double > & TimeBasedMatrix ()
 Return time-based 3x3 rotation CJ matrix as a vector of length 9.
 
void SetTimeBasedMatrix (std::vector< double > timeBasedMatrix)
 Set the time-based 3x3 rotation CJ matrix from a vector of length 9.
 
std::vector< double > J2000Vector (const std::vector< double > &rVec)
 Given a direction vector in the reference frame, return a J2000 direction.
 
std::vector< AnglepoleRaCoefs ()
 Return the coefficients used to calculate the target body pole ra.
 
std::vector< AnglepoleDecCoefs ()
 Return the coefficients used to calculate the target body pole dec.
 
std::vector< AnglepmCoefs ()
 Return the coefficients used to calculate the target body prime meridian.
 
std::vector< double > poleRaNutPrecCoefs ()
 Return the coefficients used to calculate the target body pole ra nut/prec coefficients.
 
std::vector< double > poleDecNutPrecCoefs ()
 Return the coefficients used to calculate the target body pole dec nut/prec coefficients.
 
std::vector< double > pmNutPrecCoefs ()
 Return the coefficients used to calculate the target body pm nut/prec coefficients.
 
std::vector< AnglesysNutPrecConstants ()
 Return the constants used to calculate the target body system nut/prec angles.
 
std::vector< AnglesysNutPrecCoefs ()
 Return the coefficients used to calculate the target body system nut/prec angles.
 
std::vector< double > ReferenceVector (const std::vector< double > &jVec)
 Given a direction vector in J2000, return a reference frame direction.
 
std::vector< double > EvaluatePolyFunction ()
 Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.
 
void loadPCFromSpice (int CenterBodyCode)
 Initialize planetary orientation constants from Spice PCK.
 
void loadPCFromTable (const PvlObject &Label)
 Initialize planetary orientation constants from an cube body rotation label.
 
void MinimizeCache (DownsizeStatus status)
 Set the downsize status to minimize cache.
 
void LoadCache (double startTime, double endTime, int size)
 Cache J2000 rotation quaternion over a time range.
 
void LoadCache (double time)
 Cache J2000 to frame rotation for a time.
 
void LoadCache (Table &table)
 Cache J2000 rotations using a table file.
 
void LoadCache (nlohmann::json &isd)
 Load the cached data from an ALE ISD.
 
Table LineCache (const QString &tableName)
 Return a table with J2000 to reference rotations.
 
void ReloadCache ()
 Cache J2000 rotation over existing cached time range using polynomials.
 
Table Cache (const QString &tableName)
 Return a table with J2000 to reference rotations.
 
void CacheLabel (Table &table)
 Add labels to a SpiceRotation table.
 
void LoadTimeCache ()
 Load the time 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.
 
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.
 
bool IsCached () const
 Checks if the cache is empty.
 
void SetPolynomial (const Source type=PolyFunction)
 Set the coefficients of a polynomial fit to each of the three camera angles for the time period covered by the cache, angle = a + bt + ct**2, where t = (time - p_baseTime)/ p_timeScale.
 
void SetPolynomial (const std::vector< double > &abcAng1, const std::vector< double > &abcAng2, const std::vector< double > &abcAng3, const Source type=PolyFunction)
 Set the coefficients of a polynomial fit to each of the three camera angles for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale, and n = p_degree.
 
void usePckPolynomial ()
 Set the coefficients of a polynomial fit to each of the three planet angles for the time period covered by the cache, ra = ra0 + ra1*t + ra2*t**2 + raTrig, dec = dec0 + dec1*t + dec2*t**2 + decTrig, pm = pm0 + pm1*d + pm2*t**2 + pmTrig, where t = time / (seconds per day).
 
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 covered by the cache, ra = ra0 + ra1*t + ra2*t**2 + raTrig, dec = dec0 + dec1*t + dec2*t**2 + decTrig, pm = pm0 + pm1*d + pm2*t**2 + pmTrig, where t = time / (seconds per day).
 
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 covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_basetime) / p_timeScale and n = p_degree.
 
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.
 
void SetPolynomialDegree (int degree)
 Set the degree of the polynomials to be fit to the three camera angles for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale, and n = p_degree.
 
Source GetSource ()
 Accessor method to get the rotation source.
 
void SetSource (Source source)
 Resets the source of the rotation to the given value.
 
void ComputeBaseTime ()
 Compute the base time using cached times.
 
FrameType getFrameType ()
 Accessor method to get the rotation frame type.
 
double GetBaseTime ()
 Accessor method to get the rotation base time.
 
double GetTimeScale ()
 Accessor method to get the rotation time scale.
 
void SetOverrideBaseTime (double baseTime, double timeScale)
 Set an override base time to be used with observations on scanners to allow all images in an observation to use the save base time and polynomials for the angles.
 
void SetCacheTime (std::vector< double > cacheTime)
 
double DPolynomial (const int coeffIndex)
 Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current time.
 
double DPckPolynomial (PartialType partialVar, const int coeffIndex)
 Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current time.
 
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 coefficients in the angle polynomial fit equation of a vector rotated from the reference frame to J2000.
 
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 of a vector rotated from J2000 to a reference frame.
 
void DCJdt (std::vector< double > &dRJ)
 Compute the derivative of the 3x3 rotation matrix CJ with respect to time.
 
double WrapAngle (double compareAngle, double angle)
 Wrap the input angle to keep it within 2pi radians of the angle to compare.
 
void SetAxes (int axis1, int axis2, int axis3)
 Set the axes of rotation for decomposition of a rotation matrix into 3 angles.
 
std::vector< double > GetFullCacheTime ()
 Return full listing (cache) of original time coverage requested.
 
void FrameTrace (double et)
 Compute frame trace chain from target frame to J2000.
 
std::vector< int > ConstantFrameChain ()
 Accessor method to get the frame chain for the constant part of the rotation (ends in target)
 
std::vector< int > TimeFrameChain ()
 Accessor method to get the frame chain for the rotation (begins in J2000).
 
void InitConstantRotation (double et)
 Initialize the constant rotation.
 
bool HasAngularVelocity ()
 Checks whether the rotation has angular velocities.
 
void ComputeAv ()
 Compute the angular velocity from the time-based functions fit to the pointing angles This method computes omega = angular velocity matrix, and extracts the angular velocity.
 
std::vector< double > Extrapolate (double timeEt)
 Extrapolate pointing for a given time assuming a constant angular velocity.
 
void checkForBinaryPck ()
 Check loaded pck to see if any are binary and set frame type to indicate binary pck.
 
int cacheSize ()
 

Protected Member Functions

void SetFullCacheParameters (double startTime, double endTime, int cacheSize)
 Set the full cache time parameters.
 
void setEphemerisTimeMemcache ()
 Updates rotation state based on the rotation cache.
 
void setEphemerisTimeNadir ()
 When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.
 
void setEphemerisTimeSpice ()
 When setting the ephemeris time, updates the rotation state based on data read directly from NAIF kernels using NAIF Spice routines.
 
void setEphemerisTimePolyFunction ()
 When setting the ephemeris time, updates the rotation according to a polynomial that defines the three camera angles and angular velocity, if available.
 
void setEphemerisTimePolyFunctionOverSpice ()
 When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kernel data.
 
void setEphemerisTimePckPolyFunction ()
 When setting the ephemeris time, updates the rotation state based on the PcK polynomial.
 

Protected Attributes

std::vector< double > p_cacheTime
 iTime for corresponding rotation
 
int p_degree
 Degree of fit polynomial for angles.
 
int p_axis1
 Axis of rotation for angle 1 of rotation.
 
int p_axis2
 Axis of rotation for angle 2 of rotation.
 
int p_axis3
 Axis of rotation for angle 3 of rotation.
 
ale::Orientations * m_orientation
 

Private Member Functions

void setFrameType ()
 Cached orientation information.
 
std::vector< double > StateTJ ()
 State matrix (6x6) for rotating state vectors from J2000 to target frame.
 

Private Attributes

std::vector< int > p_constantFrames
 Chain of Naif frame codes in constant rotation TC.
 
std::vector< int > p_timeFrames
 Chain of Naif frame codes in time-based rotation CJ.
 
double p_timeBias
 iTime bias when reading kernels
 
double p_et
 Current ephemeris time.
 
Quaternion p_quaternion
 Quaternion for J2000 to reference rotation at et.
 
bool p_matrixSet
 Flag indicating p_TJ has been set.
 
bool m_tOrientationAvailable
 Target orientation constants are available.
 
FrameType m_frameType
 The type of rotation frame.
 
Source p_source
 The source of the rotation data.
 
int p_axisP
 The axis defined by the spacecraft vector for defining a nadir rotation.
 
int p_axisV
 The axis defined by the velocity vector for defining a nadir rotation.
 
int p_targetCode
 For computing Nadir rotation only.
 
double p_baseTime
 Base time used in fit equations.
 
double p_timeScale
 Time scale used in fit equations.
 
bool p_degreeApplied
 Flag indicating whether or not a polynomial of degree p_degree has been created and used to fill the cache.
 
std::vector< double > p_coefficients [3]
 Coefficients defining functions fit to 3 pointing angles.
 
bool p_noOverride
 Flag to compute base time;.
 
double p_overrideBaseTime
 Value set by caller to override computed base time.
 
double p_overrideTimeScale
 Value set by caller to override computed time scale.
 
DownsizeStatus p_minimizeCache
 Status of downsizing the cache (set to No to ignore)
 
double p_fullCacheStartTime
 Initial requested starting time of cache.
 
double p_fullCacheEndTime
 Initial requested ending time of cache.
 
int p_fullCacheSize
 Initial requested cache size.
 
std::vector< double > p_TC
 Rotation matrix from first constant rotation (after all time-based rotations in frame chain from J2000 to target) to the target frame.
 
std::vector< double > p_CJ
 Rotation matrix from J2000 to first constant rotation.
 
std::vector< double > p_av
 Angular velocity for rotation at time p_et.
 
bool p_hasAngularVelocity
 Flag indicating whether the rotation includes angular velocity.
 
std::vector< Anglem_raPole
 Coefficients of a quadratic polynomial fitting pole ra.
 
std::vector< Anglem_decPole
 Coefficients of a quadratic polynomial fitting pole dec.
 
std::vector< Anglem_pm
 Coefficients of a quadratic polynomial fitting pole pm.
 
std::vector< double > m_raNutPrec
 Coefficients of pole right ascension nut/prec terms.
 
std::vector< double > m_decNutPrec
 Coefficients of pole decliniation nut/prec terms.
 
std::vector< double > m_pmNutPrec
 Coefficients of prime meridian nut/prec terms.
 
std::vector< Anglem_sysNutPrec0
 Constants of planetary system nut/prec periods.
 
std::vector< Anglem_sysNutPrec1
 Linear terms of planetary system nut/prec periods.
 

Static Private Attributes

static const double m_centScale
 Seconds per Julian century for scaling time in seconds.
 
static const double m_dayScale
 Seconds per day for scaling time in seconds to get target body w.
 

Detailed Description

Obtain SPICE rotation information for a body.

This class will obtain the rotation from J2000 to a particular reference frame, for example the rotation from J2000 to MOC NA.

It is essentially used to convert position vectors from one frame to another, making it is a C++ wrapper to the NAIF routines pxform_c and mxv or mtxv. Therefore, appropriate NAIF kernels are expected to be loaded prior to using this class. A position can be returned in either the J2000 frame or the selected reference frame. See NAIF required reading for more information regarding this subject at ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/spk.html

An important functionality of this class is the ability to cache the rotations so they do not have to be constantly read from the NAIF kernels and they can be more conveniently updated. Once the data is cached, the NAIF kernels can be unloaded. If the rotation has a fixed part and a time- based part, the rotation is computed and stored in those two parts.

Author
2005-12-01 Debbie A. Cook
History

2005-12-01 Debbie A. Cook Original Version modified from SpicePosition class by Jeff Anderson

2006-03-23 Jeff Anderson modified SetEphemerisTime to return if the time did not change to improve speed.

2006-10-18 Debbie A. Cook Added method, WrapAngle, to wrap angles around 2 pi

2007-12-05 Debbie A. Cook added method SetPolynomialDegree to allow the degree of the polynomials fit to the camera angles to be changed. Also changed the polynomial from a fixed 2nd order polynomial to an nth degree polynomial with one independent variable. PartialType was revised and the calls to SetReferencePartial (has an added argument, coefficient index) and DPolynomial (argument type changed to int) were revised. The function was changed from Parabola to Polynomial1Variable, now called PolynomialUnivariate. New methods GetBaseTime and SetOverrideBaseTime were added

2008-02-15 Debbie A. Cook added a new error message to handle the case where the Naif reference frame code is not recognized.

2008-06-18 Unknown - Fixed documentation, added NaifStatus calls

2008-11-26 Debbie A. Cook Added method to set axes of rotation. Default axes are still 3,1,3 so existing software will not be affected by the change. Also added timeScale to the the class and made some parameters protected instead of private so they are available to inheriting classes.

2008-12-12 Debbie A. Cook Added method to return frame code

2009-01-26 Debbie A. Cook Added wrap of 3rd camera angle when crossing +-180

2009-04-21 Debbie A. Cook Added methods MinimizeCache and LoadTimeCache, variable p_minimizeCache, and enum constants DownsizeStatus

2009-06-29 Debbie A. Cook Fixed memory overwrite problem in LoadTimeCache when reading a type 3 ck

2009-07-24 Debbie A. Cook Removed downsizing for Nadir instrument pointing tables (LoadTimeCache) so that radar instruments will work. Current downsizing code requires sclk and radar has no sclk.

2009-10-01 Debbie A. Cook Divided the rotation into a constant (in time) part and a time-based part and added keywords listing the frame chains for both the constant part and the time-based part.

2009-10-09 Debbie A. Cook Added angular velocity when it is available

2009-10-30 Unknown - Modified J2000Vector and ReferenceVector to work on either length 3 vectors (position only) or lenght 6 vectors (position and velocity) and added private method StateTJ()

2009-12-03 Debbie A. Cook Modified tests in LoadTimeCache to allow observation to cross segment boundary for LRO

2010-03-19 Debbie A. Cook Revised ReloadCache including removing obsolete arguments. Added initialization of members p_fullCacheStartTime, p_fullCacheEndTime, and p_fullCacheSize. Added these same values to the table label in method Cache and the reading of these values to the method LoadCache(table). Improved error message in FrameTrace. Also corrected a comment in StateTJ

2010-09-23 Debbie A. Cook Revised to write out line cache for updated pointing when cache size is 1. If the original pointing had an angular velocity in this case, the original angular velocity is written out along with the updated quaternion. Also added method Extrapolate, to extrapolate pointing assuming a constant angular velocity. This method was designed to compute the pointing at the start and end of the exposure for framing cameras to create a ck that would cover a single framing observation.

2010-12-22 Debbie A. Cook Added new method SetFullCacheParameters to upgrade appjit to current instrument Rotation group labels.

2011-02-17 Debbie A. Cook Fixed bug in method LineCache and fixed computation of angular velocity in method DCJdt (derivative was with respect to scaled et instead of et)

2011-02-22 Debbie A. Cook - Corrected Extrapolation method

2011-03-25 Debbie A. Cook - Added method GetCenterAngles()

2011-07-20 Kris J Becker - Modified SpiceRotation::LoadCache(Table &table) to be reentrant. This mod was necessitated by the Dawn VIR instrument.

2012-05-28 Debbie A. Cook - Programmer notes - A new interpolation algorithm, PolyFunctionOverSpice, was added and new supporting methods: SetEphemerisTimePolyOverSpice, SetEphemerisTimeSpice, SetEphemerisTimeNadir, SetEphemerisTimeMemcache, and SetEphemerisTimePolyFunction. PolyFunctionOverSpice is never output, but is converted to a line cache and reduced. Methods LineCache and ReloadCache were modified to do the reduction and a copy constructor was added to support the reduction. Also an argument was added to SetPolynomial methods for function type, since PolyFunction is no longer the only function supported. These changes help the BundleAdjust applications to better fit line scan images where the pointing was not modeled well with a regular polynomial.

2012-10-25 Jeannie Backer - Brought class closer to Isis3 standards: Ordered includes in cpp file, replaced quotation marks with angle braces in 3rd party includes, fixed history indentation and line length. References #1181.

2013-03-27 Jeannie Backer - Added methods for MsiCamera. Brought class closer to Isis standards: moved method implementation to cpp file, fixed documentation. References #1248.

2013-11-12 Ken Edmundson Programmers notes - Commented out cout debug statements on lines 637 and 642 that appeared onscreen during jigsaw runs when images are updated. References #1521.

2014-03-11 Tracie Sucharski - In the LoadTimeCache method, do not throw error if if first segment in kernel is not type 3 or 5. As long as the segment needed is type 3 or 5, we're ok. This was changed for New Horizons which had ck's with both type 2 and type 3 segments.

2014-03-11 Stuart Sides - Programmers notes - Fixed a bug in the copy constructor that was going out of array bounds.

2015-02-20 Jeannie Backer - Improved error messages.

2015-07-21 Kristin Berry - Added additional NaifStatus::CheckErrors() calls to see if any NAIF errors were signaled. References #2248.

2015-08-05 Debbie A. Cook - Programmer notes - Modified LoadCache, and ComputeAv. Added new methods loadPCFromSpice, loadPCFromTable, toJ2000Partial, poleRaCoefs, poleDecCoefs, pmCoefs, poleRaNutPrecCoefs, poleDecNutPrecCoefs, pmNutPrecCoefs, sysNutPrecConstants, sysNutPrecCoefs, usePckPolynomial, setPckPolynomial(raCoef, decCoef, pmCoef), getPckPolynomial, setEphemerisTimePckPolyFunction, getFrameType and members m_frameType, m_tOrientationAvailable, m_raPole, m_decPole, m_pm, m_raNutPrec, m_decNutPrec, m_pmNutPrec, m_sysNutPrec0, m_sysNutPrec1, m_dscale, m_Tscale to support request for solving for target body parameters. Also added a new enumerated value for Source, PckPolyFunction, and PartialType, WRT_RotationRate.

2016-02-15 Debbie A. Cook - Programmer notes - Added private method setFrameType to set the frame type. It also loads the planetary constants for a PCK type.

2016-06-28 Ian Humphrey - Updated documentation and coding standards. Added new tests to unit test. Fixes #3972.

2017-12-13 Ken Edmundson - Added "case DYN:" to methods ToReferencePartial and toJ2000Partial. Fixes #5251. This problem was found when trying to bundle M3 images that had been spiceinited with nadir pointing. The nadir frame is defined as a Dynamic Frame by Naif.

2018-04-21 Jesse Mapel - Modified frametype resolution to check if a body centered frame uses a CK or PCK definition. This only occurs for bodies where a pck cannot accurately define for the duration of a mission. The current example is the comet 67P/CHURYUMOV-GERASIMENKO imaged by Rosetta. Some future comet/astroid missions are expected to use a CK defined body fixed reference frame. Fixes #5408.

Todo

Downsize using Hermite cubic spline and allow Nadir tables to be downsized again.

Consider making this a base class with child classes based on frame type or storage type (polynomial, polynomial over cache, cache, etc.)

Definition at line 208 of file SpiceRotation.h.

Member Enumeration Documentation

◆ DownsizeStatus

Status of downsizing the cache.

Enumerator
Yes 

Downsize the cache.

Done 

Cache is downsized.

No 

Do not downsize the cache.

Definition at line 265 of file SpiceRotation.h.

◆ FrameType

Enumeration for the frame type of the rotation.

Enumerator
UNKNOWN 

Isis specific code for unknown frame type.

INERTL 

See Naif Frames.req document for.

PCK 

definitions

BPC 

Isis specific code for binary pck.

NOTJ2000PCK 

PCK frame not referenced to J2000.

Definition at line 274 of file SpiceRotation.h.

◆ PartialType

This enumeration indicates whether the partial derivative is taken with respect to Right Ascension, Declination, or Twist (or Rotation).

Enumerator
WRT_RightAscension 

With respect to Right Ascension.

WRT_Declination 

With respect to Declination.

WRT_Twist 

With respect to Twist or Prime Meridian Rotation.

Definition at line 256 of file SpiceRotation.h.

◆ Source

The rotation can come from one of 3 places for an Isis cube.

The class expects function to be after Memcache. Spice - the rotation is calculated by Naif Spice routines with data read directly from Naif kernels. Nadir - the rotation is calculated using the Naif routine twovec with the position and velocity vectors of the spacecraft. Memcache - the rotation is linearly interpolated from time-based values in a table. PolyFunction - the rotation is calculated from an nth degree polynomial in one variable (time in scaled seconds) PolyFunctionOverSpice - the rotation is calculated from an nth degree polynomial fit over the Naif Spice results. PckPolyFunction - The rotation is calculated using the IAU fit polynomials in one variable (time in Julian centuries and days).

Enumerator
Spice 

Directly from the kernels.

Nadir 

Nadir pointing.

Memcache 

From cached table.

PolyFunction 

From nth degree polynomial.

PolyFunctionOverSpice 

Kernels plus nth degree polynomial.

PckPolyFunction 

Quadratic polynomial function with linear trignometric terms.

Definition at line 243 of file SpiceRotation.h.

Constructor & Destructor Documentation

◆ SpiceRotation() [1/3]

Isis::SpiceRotation::SpiceRotation ( int frameCode)

Construct an empty SpiceRotation class using a valid Naif frame code to set up for getting rotation from Spice kernels.

See required reading ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html

Parameters
frameCodeValid naif frame code.

Definition at line 58 of file SpiceRotation.cpp.

References m_frameType, m_tOrientationAvailable, No, p_av, p_axis1, p_axis2, p_axis3, p_CJ, p_constantFrames, p_degree, p_degreeApplied, p_et, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_matrixSet, p_minimizeCache, p_noOverride, p_source, p_timeBias, Spice, and UNKNOWN.

◆ SpiceRotation() [2/3]

Isis::SpiceRotation::SpiceRotation ( int frameCode,
int targetCode )

Construct an empty SpiceRotation object using valid Naif frame code and.

body code to set up for computing nadir rotation. See required reading ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html

Parameters
frameCodeValid naif frame code.
targetCodeValid naif body code.
Exceptions
IException::Io"Cannot find [key] in text kernels"

Definition at line 93 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), Isis::IException::Io, m_frameType, m_tOrientationAvailable, Nadir, No, p_av, p_axis1, p_axis2, p_axis3, p_axisP, p_axisV, p_CJ, p_constantFrames, p_degree, p_degreeApplied, p_et, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_matrixSet, p_minimizeCache, p_noOverride, p_source, p_targetCode, p_timeBias, and Isis::toString().

◆ SpiceRotation() [3/3]

◆ ~SpiceRotation()

Isis::SpiceRotation::~SpiceRotation ( )
virtual

Destructor for SpiceRotation object.

Definition at line 200 of file SpiceRotation.cpp.

Member Function Documentation

◆ Angles()

std::vector< double > Isis::SpiceRotation::Angles ( int axis3,
int axis2,
int axis1 )

Return the camera angles (right ascension, declination, and twist) for the time-based matrix CJ.

Parameters
axis3The rotation axis for the third angle
axis2The rotation axis for the second angle
axis1The rotation axis for the first angle
Returns
vector<double> Camera angles (ra, dec, twist)

Definition at line 1296 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), and p_CJ.

Referenced by DCJdt(), GetCenterAngles(), setEphemerisTimePolyFunctionOverSpice(), SetPolynomial(), toJ2000Partial(), and ToReferencePartial().

◆ AngularVelocity()

std::vector< double > Isis::SpiceRotation::AngularVelocity ( )

Accessor method to get the angular velocity.

Returns
vector<double> Angular velocity

Definition at line 1352 of file SpiceRotation.cpp.

References p_av.

◆ Cache()

Table Isis::SpiceRotation::Cache ( const QString & tableName)

Return a table with J2000 to reference rotations.

Return a table containing the cached pointing with the given name. The table will have either five columns (for a list cache) of J2000 to reference quaternions and times, eight columns (if angular velocity is available), or three columns (for a coefficient cache), of J2000 to reference frame rotation angles defined by coefficients of a polynomial function (see SetPolynommial). In the coefficient cache the last row of the table is the base time, time scale, and polynomial degree. Note: In the case of the coefficient cache, the angular velocity is not written to the table since it can be calculated from the polynomials.

Parameters
tableNameName of the table to create and return
Exceptions
IException::Programmer"To create table source of data must be either Memcache or PolyFunction"
Returns
Table Table with given name that contains the cached pointing

Definition at line 855 of file SpiceRotation.cpp.

References CacheLabel(), Isis::TableField::Double, LineCache(), LoadTimeCache(), Memcache, p_baseTime, p_cacheTime, p_coefficients, p_degree, p_fullCacheSize, p_hasAngularVelocity, p_minimizeCache, p_source, p_timeScale, PolyFunction, PolyFunctionOverSpice, Isis::IException::Programmer, and Yes.

Referenced by LineCache().

◆ CacheLabel()

void Isis::SpiceRotation::CacheLabel ( Table & table)

Add labels to a SpiceRotation table.

Return a table containing the labels defining the rotation.

Parameters
TableTable to receive labels

Definition at line 1169 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), Isis::Table::Label(), m_decNutPrec, m_decPole, m_frameType, m_pm, m_pmNutPrec, m_raNutPrec, m_raPole, m_sysNutPrec0, m_sysNutPrec1, p_constantFrames, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_TC, p_timeFrames, PCK, and Isis::toString().

Referenced by Cache().

◆ cacheSize()

int Isis::SpiceRotation::cacheSize ( )
inline

Definition at line 410 of file SpiceRotation.h.

◆ checkForBinaryPck()

void Isis::SpiceRotation::checkForBinaryPck ( )

Check loaded pck to see if any are binary and set frame type to indicate binary pck.

This is strictly a local method to be called only when the source is Spice. Its purpose is to check loaded PCK to see if any are binary. If any loaded PCK is binary, the body rotation label keyword FrameTypeCode is set to BPC (6).

Definition at line 3167 of file SpiceRotation.cpp.

References BPC, and m_frameType.

Referenced by loadPCFromSpice().

◆ ComputeAv()

void Isis::SpiceRotation::ComputeAv ( )

Compute the angular velocity from the time-based functions fit to the pointing angles This method computes omega = angular velocity matrix, and extracts the angular velocity.

See comments in the Naif Spicelib routine xf2rav_c.c.

       _                     _
      |                       |
      |   0    -av[2]  av[1]  |
      |                       |

omega = | av[2] 0 -av[0] | | | | -av[1] av[0] 0 | |_ _|

Exceptions
IException::Programmer"The SpiceRotation pointing angles must be fit to polynomials in order to compute angular velocity."
IException::Programmer"Planetary angular velocity must be fit computed with PCK polynomials"

Definition at line 2969 of file SpiceRotation.cpp.

References BPC, Isis::NaifStatus::CheckErrors(), DCJdt(), INERTL, m_frameType, NOTJ2000PCK, p_av, p_CJ, p_source, PCK, PckPolyFunction, PolyFunction, Isis::IException::Programmer, and UNKNOWN.

Referenced by setEphemerisTimePolyFunction().

◆ ComputeBaseTime()

void Isis::SpiceRotation::ComputeBaseTime ( )

Compute the base time using cached times.

Definition at line 2074 of file SpiceRotation.cpp.

References p_baseTime, p_cacheTime, p_noOverride, p_overrideBaseTime, p_overrideTimeScale, and p_timeScale.

Referenced by SetPolynomial(), and SetPolynomial().

◆ ConstantFrameChain()

std::vector< int > Isis::SpiceRotation::ConstantFrameChain ( )

Accessor method to get the frame chain for the constant part of the rotation (ends in target)

Returns
vector<int> The frame chain for the constant part of the rotation.

Definition at line 1363 of file SpiceRotation.cpp.

References p_constantFrames.

◆ ConstantMatrix()

std::vector< double > & Isis::SpiceRotation::ConstantMatrix ( )

Return the constant 3x3 rotation TC matrix as a vector of length 9.

Returns
vector<double> Constant rotation matrix, TC.

Definition at line 2882 of file SpiceRotation.cpp.

References p_TC.

◆ ConstantRotation()

std::vector< double > Isis::SpiceRotation::ConstantRotation ( )

Return the constant 3x3 rotation TC matrix as a quaternion.

Returns
vector<double> Constant rotation quaternion, TC.

Definition at line 2867 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), and p_TC.

◆ DCJdt()

void Isis::SpiceRotation::DCJdt ( std::vector< double > & dCJ)

Compute the derivative of the 3x3 rotation matrix CJ with respect to time.

The derivative is computed based on p_CJ (J2000 to first constant frame).

Parameters
[out]dCJDerivative of p_CJ

Definition at line 3014 of file SpiceRotation.cpp.

References Angles(), Isis::NaifStatus::CheckErrors(), Isis::PolynomialUnivariate::DerivativeVar(), p_axis1, p_axis2, p_axis3, p_baseTime, p_coefficients, p_degree, p_et, p_timeScale, and Isis::BasisFunction::SetCoefficients().

Referenced by ComputeAv().

◆ DPckPolynomial()

double Isis::SpiceRotation::DPckPolynomial ( SpiceRotation::PartialType partialVar,
const int coeffIndex )

Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current time.

Parameters
partialVarVariable derivative is to be with respect to
coeffIndexThe index of the coefficient to differentiate
Exceptions
IException::Programmer"Unable to evaluate the derivative of the SPICE rotation fit polynomial for the given coefficient index. Index is negative or exceeds degree of polynomial"
Returns
double The derivative evaluated at the current time.

Definition at line 2159 of file SpiceRotation.cpp.

References p_degree, p_et, Isis::IException::Programmer, Isis::toString(), WRT_Declination, WRT_RightAscension, and WRT_Twist.

Referenced by toJ2000Partial(), and ToReferencePartial().

◆ DPolynomial()

double Isis::SpiceRotation::DPolynomial ( const int coeffIndex)

Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the coefficient at the given index, at the current time.

Parameters
coeffIndexThe index of the coefficient to differentiate
Exceptions
IException::Programmer"Unable to evaluate the derivative of the SPICE rotation fit polynomial for the given coefficient index. Index is negative or exceeds degree of polynomial"
Returns
double The derivative evaluated at the current time.

Definition at line 2124 of file SpiceRotation.cpp.

References p_baseTime, p_degree, p_et, p_timeScale, Isis::IException::Programmer, and Isis::toString().

Referenced by toJ2000Partial(), and ToReferencePartial().

◆ EphemerisTime()

double Isis::SpiceRotation::EphemerisTime ( ) const

Accessor method to get current ephemeris time.

Returns
double The current ephemeris time.

Definition at line 306 of file SpiceRotation.cpp.

References p_et.

Referenced by Isis::Spice::computeSolarLongitude().

◆ EvaluatePolyFunction()

std::vector< double > Isis::SpiceRotation::EvaluatePolyFunction ( )

Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.

Returns
vector<double> Vector containing the three rotation angles.

Definition at line 3385 of file SpiceRotation.cpp.

References p_baseTime, p_coefficients, p_degree, p_et, and p_timeScale.

Referenced by setEphemerisTimePolyFunctionOverSpice().

◆ Extrapolate()

std::vector< double > Isis::SpiceRotation::Extrapolate ( double timeEt)

Extrapolate pointing for a given time assuming a constant angular velocity.

The pointing and angular velocity at the current time will be used to extrapolate pointing at the input time. If angular velocity does not exist, the value at the current time will be output.

Parameters
[in]timeEtThe time of the pointing to be extrapolated
Returns
vector<double> A quaternion defining the rotation at the input time.

Definition at line 3123 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_av, p_CJ, p_et, and p_hasAngularVelocity.

◆ Frame()

int Isis::SpiceRotation::Frame ( )

Accessor method that returns the frame code.

This is the first value of the constant frames member variable.

Returns
int An integer value indicating the frame code.

Definition at line 225 of file SpiceRotation.cpp.

References p_constantFrames.

◆ FrameTrace()

void Isis::SpiceRotation::FrameTrace ( double et)

Compute frame trace chain from target frame to J2000.

Parameters
etEphemeris time
Exceptions
IException::Programmer"The frame is not supported by Naif"
IException::Programmer"The ck rotation from frame can not be found due to no pointing available at request time or a problem with the frame"
IException::Programmer"The frame has a type not supported by your version of Naif Spicelib. You need to update."

Definition at line 2727 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), INERTL, Nadir, p_constantFrames, p_source, p_timeFrames, PCK, Isis::IException::Programmer, and Isis::toString().

Referenced by InitConstantRotation().

◆ GetBaseTime()

double Isis::SpiceRotation::GetBaseTime ( )

Accessor method to get the rotation base time.

Returns
double The base time for the rotation.

Definition at line 2410 of file SpiceRotation.cpp.

References p_baseTime.

◆ GetCenterAngles()

std::vector< double > Isis::SpiceRotation::GetCenterAngles ( )

Return the camera angles at the center time of the observation.

Returns
vector<double> Camera angles at center time

Definition at line 1277 of file SpiceRotation.cpp.

References Angles(), p_axis1, p_axis2, p_axis3, p_fullCacheEndTime, p_fullCacheStartTime, and SetEphemerisTime().

Referenced by Isis::IsisBundleObservation::bundleOutputFetchData().

◆ getFrameType()

SpiceRotation::FrameType Isis::SpiceRotation::getFrameType ( )

Accessor method to get the rotation frame type.

Returns
SpiceRotation::FrameType The frame type of the rotation.

Definition at line 2379 of file SpiceRotation.cpp.

References m_frameType.

◆ GetFullCacheTime()

std::vector< double > Isis::SpiceRotation::GetFullCacheTime ( )

Return full listing (cache) of original time coverage requested.

Exceptions
IException::User"Time cache not availabe -- rerun spiceinit"
Returns
vector<double> Cache of original time coverage.

Definition at line 2695 of file SpiceRotation.cpp.

References p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, and Isis::IException::User.

◆ getPckPolynomial()

void Isis::SpiceRotation::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.

See SetPckPolynomial() for more information on the polynomial.

TODO??? Should the other coefficients be returned as well???

Parameters
[out]raCoeffQuadratic coefficients of fit to ra
[out]decCoeffQuadratic coefficients of fit to dec
[out]pmcoeffQuadratic coefficients of fit to pm

Definition at line 2060 of file SpiceRotation.cpp.

References m_decPole, m_pm, and m_raPole.

◆ GetPolynomial()

void Isis::SpiceRotation::GetPolynomial ( std::vector< double > & coeffAng1,
std::vector< double > & coeffAng2,
std::vector< double > & coeffAng3 )

Return the coefficients of a polynomial fit to each of the three camera angles for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_basetime) / p_timeScale and n = p_degree.

Parameters
[out]coeffAng1Coefficients of fit to Angle 1
[out]coeffAng2Coefficients of fit to Angle 2
[out]coeffAng3Coefficients of fit to Angle 3

Definition at line 2038 of file SpiceRotation.cpp.

References p_coefficients.

Referenced by Isis::IsisBundleObservation::applyParameterCorrections(), and Isis::IsisBundleObservation::bundleOutputFetchData().

◆ GetSource()

SpiceRotation::Source Isis::SpiceRotation::GetSource ( )

Accessor method to get the rotation source.

Returns
SpiceRotation::Source The source of the rotation.

Definition at line 2389 of file SpiceRotation.cpp.

References p_source.

Referenced by Isis::Spice::createCache().

◆ GetTimeScale()

double Isis::SpiceRotation::GetTimeScale ( )

Accessor method to get the rotation time scale.

Returns
double The time scale for the rotation.

Definition at line 2420 of file SpiceRotation.cpp.

References p_timeScale.

◆ HasAngularVelocity()

bool Isis::SpiceRotation::HasAngularVelocity ( )

Checks whether the rotation has angular velocities.

Returns
bool Indicates whether the rotation has angular velocities.

Definition at line 1383 of file SpiceRotation.cpp.

References p_hasAngularVelocity.

◆ InitConstantRotation()

void Isis::SpiceRotation::InitConstantRotation ( double et)

Initialize the constant rotation.

Parameters
etEphemeris time.

Definition at line 2938 of file SpiceRotation.cpp.

References FrameTrace(), p_constantFrames, p_TC, and p_timeFrames.

Referenced by LoadCache(), setEphemerisTimeNadir(), and setEphemerisTimeSpice().

◆ IsCached()

bool Isis::SpiceRotation::IsCached ( ) const

Checks if the cache is empty.

Returns
bool Indicates whether this rotation is cached.

Definition at line 316 of file SpiceRotation.cpp.

Referenced by Isis::Spice::computeSolarLongitude(), and Isis::Spice::createCache().

◆ J2000Vector()

std::vector< double > Isis::SpiceRotation::J2000Vector ( const std::vector< double > & rVec)

Given a direction vector in the reference frame, return a J2000 direction.

Parameters
[in]rVecA direction vector in the reference frame
Returns
vector<double> A direction vector in J2000 frame.

Definition at line 1395 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_CJ, p_hasAngularVelocity, p_TC, and StateTJ().

◆ LineCache()

Table Isis::SpiceRotation::LineCache ( const QString & tableName)

Return a table with J2000 to reference rotations.

Return a table containing the cached pointing with the given name. The table will have eight columns, quaternion, angular velocity, and time of J2000 to reference frame rotation.

Parameters
tableNameName of the table to create and return
Exceptions
IException::Programmer"Only cached rotations can be returned as a line cache of quaternions and time"
Returns
Table Table with given name that contains the cached pointing

Definition at line 819 of file SpiceRotation.cpp.

References Cache(), Memcache, p_source, PolyFunction, Isis::IException::Programmer, and ReloadCache().

Referenced by Cache().

◆ LoadCache() [1/4]

void Isis::SpiceRotation::LoadCache ( double startTime,
double endTime,
int size )

Cache J2000 rotation quaternion over a time range.

This method will load an internal cache with frames over a time range. This prevents the NAIF kernels from being read over-and-over again and slowing an application down due to I/O performance. Once the cache has been loaded then the kernels can be unloaded from the NAIF system.

Parameters
startTimeStarting ephemeris time in seconds for the cache
endTimeEnding ephemeris time in seconds for the cache
sizeNumber of frames to keep in the cache
Exceptions
IException::Programmer"Argument cacheSize must not be less than or equal to zero"
IException::Programmer"Argument startTime must be less than or equal to endTime"
IException::Programmer"Cache size must be more than 1 if startTime and endTime differ"
IException::Programmer"A SpiceRotation cache has already men

Definition at line 349 of file SpiceRotation.cpp.

References InitConstantRotation(), LoadTimeCache(), Memcache, p_av, p_cacheTime, p_CJ, p_constantFrames, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_minimizeCache, p_source, p_TC, p_timeFrames, Isis::IException::Programmer, SetEphemerisTime(), setFrameType(), and Yes.

Referenced by Isis::Spice::createCache(), Isis::Spice::init(), and LoadCache().

◆ LoadCache() [2/4]

void Isis::SpiceRotation::LoadCache ( double time)

Cache J2000 to frame rotation for a time.

This method will load an internal cache with a rotation for a single time (e.g. useful for framing cameras). This prevents the NAIF kernels from being read over-and-over again and slowing a application down due to I/O performance. Once the cache has been loaded then the kernels can be unloaded from the NAIF system. This calls the LoadCache(stime,etime,size) method using the time as both the starting and ending time with a size of 1.

Parameters
timesingle ephemeris time in seconds to cache

Definition at line 440 of file SpiceRotation.cpp.

References LoadCache().

◆ LoadCache() [3/4]

void Isis::SpiceRotation::LoadCache ( nlohmann::json & isd)

Load the cached data from an ALE ISD.

The SpiceRotation object must be set to a SPICE source before loading the cache.

Parameters
isdRotThe ALE ISD as a JSON object.

Definition at line 454 of file SpiceRotation.cpp.

References m_frameType, Memcache, p_cacheTime, p_constantFrames, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_source, p_TC, p_timeFrames, Isis::IException::Programmer, and SetEphemerisTime().

◆ LoadCache() [4/4]

void Isis::SpiceRotation::LoadCache ( Table & table)

Cache J2000 rotations using a table file.

This method will load either an internal cache with rotations (quaternions) or coefficients (for 3 polynomials defining the camera angles) from an ISIS table file. In the first case, the table must have 5 columns and at least one row. The 5 columns contain the following information, J2000 to reference quaternion (q0, q1, q2, q3) and the ephemeris time of that position. If there are multiple rows, it is assumed the quaternions between the rows can be interpolated. In the second case, the table must have three columns and at least two rows. The three columns contain the coefficients for each of the three camera angles. Row one of the table contains coefficient 0 (constant term) for angles 1, 2, and 3. If the degree of the fit equation is greater than 1, row 2 contains coefficient 1 (linear) for each of the three angles. Row n contains coefficient n-1 and the last row contains the time parameters, base time, and time scale, and the degree of the polynomial.

Parameters
tableAn ISIS table blob containing valid J2000 to reference quaternion/time values
Exceptions
IException::Programmer"Expecting either three, five, or eight fields in the SpiceRotation table"

Definition at line 537 of file SpiceRotation.cpp.

References Isis::PvlObject::clear(), Isis::PvlObject::findKeyword(), Isis::PvlObject::hasKeyword(), Isis::Table::Label(), loadPCFromTable(), m_frameType, Memcache, p_cacheTime, p_constantFrames, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_source, p_TC, p_timeFrames, PCK, PolyFunction, Isis::IException::Programmer, Isis::Table::Records(), SetOverrideBaseTime(), SetPolynomial(), SetPolynomialDegree(), Isis::toDouble(), Isis::toInt(), and UNKNOWN.

◆ loadPCFromSpice()

void Isis::SpiceRotation::loadPCFromSpice ( int centerBody)

Initialize planetary orientation constants from Spice PCK.

Retrieve planetary orientation constants from a Spice PCK and store them in the class.

Parameters
centerBodyNAIF id for the planetary body to retrieve the PCK for

Definition at line 978 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), checkForBinaryPck(), Isis::Angle::Degrees, m_decNutPrec, m_decPole, m_frameType, m_pm, m_pmNutPrec, m_raNutPrec, m_raPole, m_sysNutPrec0, m_sysNutPrec1, m_tOrientationAvailable, NOTJ2000PCK, PCK, and Isis::toString().

Referenced by setFrameType().

◆ loadPCFromTable()

void Isis::SpiceRotation::loadPCFromTable ( const PvlObject & label)

Initialize planetary orientation constants from an cube body rotation label.

Retrieve planetary orientation constants from a cube body rotation label if they are present.

Parameters
labelconst reference to the cube body rotation pvl label

Definition at line 1090 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), Isis::Angle::Degrees, Isis::PvlObject::hasKeyword(), m_decNutPrec, m_decPole, m_pm, m_pmNutPrec, m_raNutPrec, m_raPole, m_sysNutPrec0, m_sysNutPrec1, m_tOrientationAvailable, and Isis::toDouble().

Referenced by LoadCache().

◆ LoadTimeCache()

void Isis::SpiceRotation::LoadTimeCache ( )

Load the time cache.

This method should works with the LoadCache(startTime, endTime, size) method to load the time cache.

Exceptions
IException::Programmer"Full cache size does NOT match cache size in LoadTimeCache -- should never happen"
IException::Programmer"Observation crosses segment boundary--unable to interpolate pointing"
IException::User"No camera kernels loaded...Unable to determine time cache to downsize"

Definition at line 2459 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), Done, Memcache, Nadir, No, p_cacheTime, p_constantFrames, p_fullCacheEndTime, p_fullCacheSize, p_fullCacheStartTime, p_hasAngularVelocity, p_minimizeCache, p_source, p_TC, p_timeBias, p_timeFrames, Isis::IException::Programmer, Isis::IException::User, and Yes.

Referenced by Cache(), Isis::Spice::init(), LoadCache(), and ReloadCache().

◆ Matrix()

std::vector< double > Isis::SpiceRotation::Matrix ( )

Return the full rotation TJ as a matrix.

Returns
vector<double> Returned matrix.

Definition at line 2852 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_CJ, and p_TC.

Referenced by Isis::Spice::computeSolarLongitude().

◆ MinimizeCache()

void Isis::SpiceRotation::MinimizeCache ( DownsizeStatus status)

Set the downsize status to minimize cache.

Parameters
statusThe DownsizeStatus enumeration value.

Definition at line 326 of file SpiceRotation.cpp.

References p_minimizeCache.

Referenced by Isis::Spice::createCache(), and Isis::Spice::init().

◆ pmCoefs()

std::vector< Angle > Isis::SpiceRotation::pmCoefs ( )

Return the coefficients used to calculate the target body prime meridian.

Return the coefficients used to calculate the target body prime meridian without nutation/precession. The model is a standard quadratic polynomial in time in days from the standard epoch (usually J2000). To match the Naif PCK prime meridian, (usually the same as the most recent IAU Report) the trignometric terms to account for nutation/precession need to be added.

pm = pm0 + pm1*d + pm2*d**2 + sum(pmcoef[i]i*sin(angle[i]))

Returns
vector<double> A vector of length 3 containing the prime meridian coefficients.

Definition at line 1483 of file SpiceRotation.cpp.

References m_pm.

◆ pmNutPrecCoefs()

std::vector< double > Isis::SpiceRotation::pmNutPrecCoefs ( )

Return the coefficients used to calculate the target body pm nut/prec coefficients.

Return the coefficients used to calculate the target body prime meridian nutation/precession contribution. The model is the sum of the products of the coefficients returned by this method with the sin of the corresponding angles associated with the barycenter related to the target body.

prime meridian = pm0 + pm1*T + pm2*d**2 + sum(pmCoef[i]i*sin(angle[i]))

Returns
vector<double> A vector containing the pm nut/prec coeffcients.

Definition at line 1535 of file SpiceRotation.cpp.

References m_pmNutPrec.

◆ poleDecCoefs()

std::vector< Angle > Isis::SpiceRotation::poleDecCoefs ( )

Return the coefficients used to calculate the target body pole dec.

Return the coefficients used to calculate the target body declination without nutation/precession. The model is a standard quadratic polynomial in time in Julian centuries (36525 days) from the standard epoch (usually J2000). To match the Naif PCK pole declination (usually the same as the most recent IAU Report) the trignometric terms to account for nutation/precession need to be added.

pole dec = dec0 + dec1*T + dec2*T**2 + sum(racoef[i]i*sin(angle[i]))

Returns
vector<double> A vector of length 3 containing the pole declination coefficients.

Definition at line 1464 of file SpiceRotation.cpp.

References m_decPole.

◆ poleDecNutPrecCoefs()

std::vector< double > Isis::SpiceRotation::poleDecNutPrecCoefs ( )

Return the coefficients used to calculate the target body pole dec nut/prec coefficients.

Return the coefficients used to calculate the target body declination nutation/precession contribution. The model is the sum of the products of the coefficients returned by this method with the sin of the corresponding angles associated with the barycenter related to the target body.

pole dec = dec0 + dec1*T + dec2*T**2 + sum(decCoef[i]i*sin(angle[i]))

Returns
vector<double> A vector containing the pole dec nut/prec coeffcients.

Definition at line 1518 of file SpiceRotation.cpp.

References m_decNutPrec.

◆ poleRaCoefs()

std::vector< Angle > Isis::SpiceRotation::poleRaCoefs ( )

Return the coefficients used to calculate the target body pole ra.

Return the coefficients used to calculate the target body right ascension without nutation/precession. The model is a standard quadratic polynomial in time in Julian centuries (36525 days) from the standard epoch (usually J2000). To match the Naif PCK pole right ascension (usually the same as the most recent IAU Report) the trignometric terms to account for nutation/precession need to be added.

pole ra = ra0 + ra1*T + ra2*T**2 + sum(racoef[i]i*sin(angle[i]))

Returns
vector<double> A vector of length 3 containing the pole ra coefficients

Definition at line 1444 of file SpiceRotation.cpp.

References m_raPole.

◆ poleRaNutPrecCoefs()

std::vector< double > Isis::SpiceRotation::poleRaNutPrecCoefs ( )

Return the coefficients used to calculate the target body pole ra nut/prec coefficients.

Return the coefficients used to calculate the target body right ascension nutation/precession contribution. The model is the sum of the products of the coefficients returned by this method with the sin of the corresponding angles associated with the barycenter related to the target body.

pole ra = ra0 + ra1*T + ra2*T**2 + sum(raCoef[i]i*sin(angle[i]))

Returns
vector<double> A vector containing the pole ra nut/prec coefficients.

Definition at line 1501 of file SpiceRotation.cpp.

References m_raNutPrec.

◆ ReferenceVector()

std::vector< double > Isis::SpiceRotation::ReferenceVector ( const std::vector< double > & jVec)

Given a direction vector in J2000, return a reference frame direction.

Parameters
[in]jVecA direction vector in J2000
Returns
vector<double> A direction vector in reference frame.

Definition at line 1687 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_CJ, p_hasAngularVelocity, p_TC, and StateTJ().

Referenced by Isis::Spice::instrumentBodyFixedPosition(), Isis::Spice::instrumentBodyFixedVelocity(), Isis::RadarGroundMap::SetFocalPlane(), Isis::RadarGroundMap::SetGround(), Isis::Spice::setTime(), Isis::Spice::subSpacecraftPoint(), and Isis::Spice::targetCenterDistance().

◆ ReloadCache()

void Isis::SpiceRotation::ReloadCache ( )

Cache J2000 rotation over existing cached time range using polynomials.

This method will reload an internal cache with matrices formed from rotation angles fit to functions over a time range.

Exceptions
IException::Programmer"The SpiceRotation has not yet been fit to a function"

Definition at line 728 of file SpiceRotation.cpp.

References LoadTimeCache(), Memcache, No, p_av, p_cacheTime, p_CJ, p_constantFrames, p_et, p_fullCacheSize, p_hasAngularVelocity, p_minimizeCache, p_source, p_TC, p_timeFrames, PolyFunction, PolyFunctionOverSpice, Isis::IException::Programmer, and SetEphemerisTime().

Referenced by LineCache().

◆ SetAngles()

void Isis::SpiceRotation::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.

This method was created for unitTests and should not be used otherwise. It only works for cached data with a cache size of 1.

Parameters
[in]anglesThe angles defining the rotation (phi, delta, and w) in radians
[in]axis3The rotation axis for the third angle
[in]axis2The rotation axis for the second angle
[in]axis1The rotation axis for the first angle

Definition at line 1323 of file SpiceRotation.cpp.

References p_cacheTime, p_CJ, p_constantFrames, p_et, p_TC, p_timeFrames, and SetEphemerisTime().

◆ SetAxes()

void Isis::SpiceRotation::SetAxes ( int axis1,
int axis2,
int axis3 )

Set the axes of rotation for decomposition of a rotation matrix into 3 angles.

Parameters
[in]axis1Axes of rotation of first angle applied (right rotation)
[in]axis2Axes of rotation of second angle applied (center rotation)
[in]axis3Axes of rotation of third angle applied (left rotation)
Exceptions
IException::Programmer"A rotation axis is outside the valid range of 1 to 3"
Returns
double Wrapped angle.

Definition at line 2437 of file SpiceRotation.cpp.

References p_axis1, p_axis2, p_axis3, and Isis::IException::Programmer.

◆ SetCacheTime()

void Isis::SpiceRotation::SetCacheTime ( std::vector< double > cacheTime)

Definition at line 2104 of file SpiceRotation.cpp.

◆ SetConstantMatrix()

void Isis::SpiceRotation::SetConstantMatrix ( std::vector< double > constantMatrix)

Set the constant 3x3 rotation TC matrix from a vector of length 9.

Parameters
constantMatrixConstant rotation matrix, TC.

Definition at line 2892 of file SpiceRotation.cpp.

References p_TC.

◆ SetEphemerisTime()

void Isis::SpiceRotation::SetEphemerisTime ( double et)

Return the J2000 to reference frame quaternion at given time.

This method returns the J2000 to reference frame rotational matrix at a given et in seconds. The quaternion is obtained from either valid NAIF ck and/or fk, or alternatively from an internal cache loaded from an ISIS Table object. In the first case, the kernels must contain the rotation for the frame specified in the constructor at the given time (as well as all the intermediate frames going from the reference frame to J2000) and they must be loaded using the SpiceKernel class.

Parameters
etephemeris time in seconds

Definition at line 260 of file SpiceRotation.cpp.

References Memcache, p_et, p_source, PckPolyFunction, PolyFunction, PolyFunctionOverSpice, setEphemerisTimeMemcache(), setEphemerisTimeNadir(), setEphemerisTimePckPolyFunction(), setEphemerisTimePolyFunction(), setEphemerisTimePolyFunctionOverSpice(), and setEphemerisTimeSpice().

Referenced by Isis::Spice::computeSolarLongitude(), GetCenterAngles(), LoadCache(), LoadCache(), ReloadCache(), SetAngles(), SetPolynomial(), SetPolynomial(), and Isis::Spice::setTime().

◆ setEphemerisTimeMemcache()

void Isis::SpiceRotation::setEphemerisTimeMemcache ( )
protected

Updates rotation state based on the rotation cache.

When setting the ephemeris time, this method is used to update the rotation state by reading from the rotation cache

See also
SpiceRotation::SetEphemerisTime

Definition at line 3255 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_av, p_cacheTime, p_CJ, p_et, and p_hasAngularVelocity.

Referenced by SetEphemerisTime(), and setEphemerisTimePolyFunctionOverSpice().

◆ setEphemerisTimeNadir()

void Isis::SpiceRotation::setEphemerisTimeNadir ( )
protected

When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.

See also
SpiceRotation::SetEphemerisTime

Definition at line 3287 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), InitConstantRotation(), p_axisP, p_axisV, p_CJ, p_constantFrames, p_et, p_targetCode, and p_timeFrames.

Referenced by SetEphemerisTime().

◆ setEphemerisTimePckPolyFunction()

void Isis::SpiceRotation::setEphemerisTimePckPolyFunction ( )
protected

When setting the ephemeris time, updates the rotation state based on the PcK polynomial.

See also
SpiceRotation::SetEphemerisTime

Definition at line 3515 of file SpiceRotation.cpp.

References Isis::DEG2RAD, Isis::Angle::Degrees, Isis::Angle::degrees(), Isis::HALFPI, m_decNutPrec, m_decPole, m_pm, m_pmNutPrec, m_raNutPrec, m_raPole, m_sysNutPrec0, m_sysNutPrec1, p_av, p_axis1, p_axis2, p_axis3, p_CJ, p_et, and Isis::Angle::Radians.

Referenced by SetEphemerisTime(), and setPckPolynomial().

◆ setEphemerisTimePolyFunction()

void Isis::SpiceRotation::setEphemerisTimePolyFunction ( )
protected

When setting the ephemeris time, updates the rotation according to a polynomial that defines the three camera angles and angular velocity, if available.

See also
SpiceRotatation::SetEphemerisTime

Definition at line 3419 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), ComputeAv(), p_av, p_axis1, p_axis2, p_axis3, p_baseTime, p_CJ, p_coefficients, p_degree, p_et, p_hasAngularVelocity, and p_timeScale.

Referenced by SetEphemerisTime(), and setEphemerisTimePolyFunctionOverSpice().

◆ setEphemerisTimePolyFunctionOverSpice()

void Isis::SpiceRotation::setEphemerisTimePolyFunctionOverSpice ( )
protected

When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kernel data.

See also
SpiceRotation::SetEphemerisTime

Definition at line 3469 of file SpiceRotation.cpp.

References Angles(), Isis::NaifStatus::CheckErrors(), EvaluatePolyFunction(), p_av, p_axis1, p_axis2, p_axis3, p_CJ, setEphemerisTimeMemcache(), and setEphemerisTimePolyFunction().

Referenced by SetEphemerisTime().

◆ setEphemerisTimeSpice()

void Isis::SpiceRotation::setEphemerisTimeSpice ( )
protected

When setting the ephemeris time, updates the rotation state based on data read directly from NAIF kernels using NAIF Spice routines.

Exceptions
IException::Io"[framecode] is an unrecognized reference frame code. Has the mission frames kernel been loaded?"
IException::Io"No pointing is availabe at request time for frame code"
See also
SpiceRotation::SetEphemerisTime

Definition at line 3326 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), InitConstantRotation(), Isis::IException::Io, p_av, p_CJ, p_constantFrames, p_et, p_hasAngularVelocity, p_timeBias, and p_timeFrames.

Referenced by SetEphemerisTime().

◆ SetFrame()

void Isis::SpiceRotation::SetFrame ( int frameCode)

Change the frame to the given frame code.

This method has no effect if spice is cached.

Parameters
frameCodeThe integer-valued frame code

Definition at line 214 of file SpiceRotation.cpp.

References p_constantFrames.

◆ setFrameType()

void Isis::SpiceRotation::setFrameType ( )
private

Cached orientation information.

Set the frame type (m_frameType).

This is strictly a local method to be called only when the source is Spice. Its purpose is to determine the frame type. If the frame type is PCK, this method also loads the planetary constants. See SpiceRotation.h to see the valid frame types.

Definition at line 3203 of file SpiceRotation.cpp.

References INERTL, loadPCFromSpice(), m_frameType, p_constantFrames, PCK, and UNKNOWN.

Referenced by LoadCache().

◆ SetFullCacheParameters()

void Isis::SpiceRotation::SetFullCacheParameters ( double startTime,
double endTime,
int cacheSize )
protected

Set the full cache time parameters.

Parameters
[in]startTimeThe earliest time of the full cache coverage
[in]endTimeThe latest time of the full cache coverage
[in]cacheSizeThe number of epochs in the full (line) cache

Definition at line 3152 of file SpiceRotation.cpp.

References p_fullCacheEndTime, p_fullCacheSize, and p_fullCacheStartTime.

◆ SetOverrideBaseTime()

void Isis::SpiceRotation::SetOverrideBaseTime ( double baseTime,
double timeScale )

Set an override base time to be used with observations on scanners to allow all images in an observation to use the save base time and polynomials for the angles.

Parameters
[in]baseTimeThe base time to use and override the computed base time
[in]timeScaleThe time scale to use and override the computed time scale

Definition at line 2097 of file SpiceRotation.cpp.

References p_noOverride, p_overrideBaseTime, and p_overrideTimeScale.

Referenced by LoadCache().

◆ setPckPolynomial()

void Isis::SpiceRotation::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 covered by the cache, ra = ra0 + ra1*t + ra2*t**2 + raTrig, dec = dec0 + dec1*t + dec2*t**2 + decTrig, pm = pm0 + pm1*d + pm2*t**2 + pmTrig, where t = time / (seconds per day).

for time = et d = t / (days per Julian century), and the trig terms are of the form sum(i = 0, numTerms) tcoef[i] * sin(constant[i] + lcoef[i]*t) for ra and pm and sum(i = 0, numTerms) tcoef[i] * cos(constant[i] + lcoef[i]*t) for dec.

Parameters
[in]raCoeffpole ra coefficients to set
[in]decCoeffpole dec coefficients to set
[in]pmCoeffpole pm coefficients to set
History
2012-05-01 Debbie A. Cook - Original version.

Definition at line 2015 of file SpiceRotation.cpp.

References m_decPole, m_pm, m_raPole, setEphemerisTimePckPolyFunction(), and usePckPolynomial().

◆ SetPolynomial() [1/2]

void Isis::SpiceRotation::SetPolynomial ( const Source type = PolyFunction)

Set the coefficients of a polynomial fit to each of the three camera angles for the time period covered by the cache, angle = a + bt + ct**2, where t = (time - p_baseTime)/ p_timeScale.

Parameters
typeRotation source type
History
2012-05-01 Debbie A. Cook - Added type argument to allow other function types beyond PolyFunction.

< Basis function fit to 1st rotation angle

< Basis function fit to 2nd rotation angle

< Basis function fit to 3rd rotation angle

Definition at line 1726 of file SpiceRotation.cpp.

References Angles(), Isis::NaifStatus::CheckErrors(), ComputeBaseTime(), p_axis1, p_axis2, p_axis3, p_baseTime, p_cacheTime, p_degree, p_source, p_timeScale, PolyFunction, PolyFunctionOverSpice, SetEphemerisTime(), SetPolynomial(), and WrapAngle().

Referenced by Isis::IsisBundleObservation::applyParameterCorrections(), LoadCache(), SetPolynomial(), and SetPolynomialDegree().

◆ SetPolynomial() [2/2]

void Isis::SpiceRotation::SetPolynomial ( const std::vector< double > & coeffAng1,
const std::vector< double > & coeffAng2,
const std::vector< double > & coeffAng3,
const Source type = PolyFunction )

Set the coefficients of a polynomial fit to each of the three camera angles for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale, and n = p_degree.

Parameters
[in]coeffAng1Coefficients of fit to Angle 1
[in]coeffAng2Coefficients of fit to Angle 2
[in]coeffAng3Coefficients of fit to Angle 3
[in]typeRotation source type
History
2012-05-01 Debbie A. Cook - Added type argument to allow other function types.

Definition at line 1878 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), ComputeBaseTime(), p_coefficients, p_degree, p_degreeApplied, p_et, p_source, and SetEphemerisTime().

◆ SetPolynomialDegree()

void Isis::SpiceRotation::SetPolynomialDegree ( int degree)

Set the degree of the polynomials to be fit to the three camera angles for the time period covered by the cache, angle = c0 + c1*t + c2*t**2 + ... + cn*t**n, where t = (time - p_baseTime) / p_timeScale, and n = p_degree.

Parameters
[in]degreeDegree of the polynomial to be fit
History
2011-03-22 Debbie A. Cook - Fixed bug in second branch where existing degree is greater than new degree.

Definition at line 2330 of file SpiceRotation.cpp.

References p_coefficients, p_degree, p_degreeApplied, p_fullCacheSize, p_source, and SetPolynomial().

Referenced by LoadCache().

◆ SetSource()

void Isis::SpiceRotation::SetSource ( Source source)

Resets the source of the rotation to the given value.

Parameters
sourceThe rotation source to be set.

Definition at line 2399 of file SpiceRotation.cpp.

References p_source.

◆ SetTimeBasedMatrix()

void Isis::SpiceRotation::SetTimeBasedMatrix ( std::vector< double > timeBasedMatrix)

Set the time-based 3x3 rotation CJ matrix from a vector of length 9.

Parameters
timeBasedMatrixTime-based rotation matrix, TC.

Definition at line 2927 of file SpiceRotation.cpp.

References p_CJ.

◆ SetTimeBias()

void Isis::SpiceRotation::SetTimeBias ( double timeBias)

Apply a time bias when invoking SetEphemerisTime method.

The bias is used only when reading from NAIF kernels. It is added to the ephermeris time passed into SetEphemerisTime and then the body position is read from the NAIF kernels and returned. When the cache is loaded from a table the bias is ignored as it is assumed to have already been applied. If this method is never called the default bias is 0.0 seconds.

Parameters
timeBiastime bias in seconds

Definition at line 242 of file SpiceRotation.cpp.

References p_timeBias.

◆ StateTJ()

std::vector< double > Isis::SpiceRotation::StateTJ ( )
private

State matrix (6x6) for rotating state vectors from J2000 to target frame.

Compute & return the rotation matrix that rotates vectors from J2000 to the targeted frame.

Returns
vector<double> Returned rotation matrix.

Definition at line 3080 of file SpiceRotation.cpp.

References p_av, p_CJ, and p_TC.

Referenced by J2000Vector(), and ReferenceVector().

◆ sysNutPrecCoefs()

std::vector< Angle > Isis::SpiceRotation::sysNutPrecCoefs ( )

Return the coefficients used to calculate the target body system nut/prec angles.

Return the linear coefficients used to calculate the target body system (barycenter) nutation/precession angles (periods). The model for the angles is linear in time in Julian centuries since the standard epoch (usually J2000). angles associated with the barycenter related to the target body.

angle[i] = constant[i] + coef[i]*T

Returns
vector<Angle> A vector containing the system nut/prec linear coefficients.

Definition at line 1570 of file SpiceRotation.cpp.

References m_sysNutPrec1.

◆ sysNutPrecConstants()

std::vector< Angle > Isis::SpiceRotation::sysNutPrecConstants ( )

Return the constants used to calculate the target body system nut/prec angles.

Return the constant terms used to calculate the target body system (barycenter) nutation/precession angles (periods). The model for the angles is linear in time in Julian centuries since the standard epoch (usually J2000). angles associated with the barycenter related to the target body.

angle[i] = constant[i] + coef[i]*T

Returns
vector<Angle> A vector containing the system nut/prec constant terms.

Definition at line 1552 of file SpiceRotation.cpp.

References m_sysNutPrec0.

◆ TimeBasedMatrix()

std::vector< double > & Isis::SpiceRotation::TimeBasedMatrix ( )

Return time-based 3x3 rotation CJ matrix as a vector of length 9.

Returns
vector<double> Time-based rotation matrix, CJ.

Definition at line 2917 of file SpiceRotation.cpp.

References p_CJ.

◆ TimeBasedRotation()

std::vector< double > Isis::SpiceRotation::TimeBasedRotation ( )

Return time-based 3x3 rotation CJ matrix as a quaternion.

Returns
vector<double> Time-based rotation quaternion, CJ.

Definition at line 2902 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), and p_CJ.

◆ TimeFrameChain()

std::vector< int > Isis::SpiceRotation::TimeFrameChain ( )

Accessor method to get the frame chain for the rotation (begins in J2000).

Returns
vector<int> The frame chain for the rotation.

Definition at line 1373 of file SpiceRotation.cpp.

References p_timeFrames.

◆ toJ2000Partial()

std::vector< double > Isis::SpiceRotation::toJ2000Partial ( const std::vector< double > & lookT,
SpiceRotation::PartialType partialVar,
int coeffIndex )

Given a direction vector in the reference frame, compute the derivative with respect to one of the coefficients in the angle polynomial fit equation of a vector rotated from the reference frame to J2000.

TODO - merge this method with ToReferencePartial

Parameters
[in]lookTA direction vector in the targeted reference frame
[in]partialVarVariable derivative is to be with respect to
[in]coeffIndexCoefficient index in the polynomial fit to the variable (angle)
Exceptions
IException::User"Body rotation uses a binary PCK. Solutions for this model are not supported"
IException::User"Body rotation uses a PCK not referenced to J2000. Solutions for this model are not supported"
IException::User"Solutions are not supported for this frame type."
Returns
vector<double> A direction vector rotated by derivative of reference to J2000 rotation.

Definition at line 1594 of file SpiceRotation.cpp.

References Angles(), BPC, Isis::NaifStatus::CheckErrors(), DPckPolynomial(), DPolynomial(), m_frameType, NOTJ2000PCK, p_axis1, p_axis2, p_axis3, p_TC, PCK, and Isis::IException::User.

◆ ToReferencePartial()

std::vector< double > Isis::SpiceRotation::ToReferencePartial ( std::vector< double > & lookJ,
SpiceRotation::PartialType partialVar,
int coeffIndex )

Compute the derivative with respect to one of the coefficients in the angle polynomial fit equation of a vector rotated from J2000 to a reference frame.

The polynomial equation is of the form angle = c0 + c1*t + c2*t**2 + ... cn*t**n, where t = (time - p_basetime) / p_timeScale and n = p_degree (the degree of the equation)

Parameters
[in]lookJLook vector in J2000 frame
[in]partialVarVariable derivative is to be with respect to
[in]coeffIndexCoefficient index in the polynomial fit to the variable (angle)
Exceptions
IException::Programmer"Only CK, DYN, and PCK partials can be calculated"
Returns
vector<double> Vector rotated by derivative of J2000 to reference rotation.

Definition at line 2219 of file SpiceRotation.cpp.

References Angles(), Isis::NaifStatus::CheckErrors(), DPckPolynomial(), DPolynomial(), m_frameType, p_axis1, p_axis2, p_axis3, p_TC, PCK, Isis::IException::Programmer, and UNKNOWN.

◆ usePckPolynomial()

void Isis::SpiceRotation::usePckPolynomial ( )

Set the coefficients of a polynomial fit to each of the three planet angles for the time period covered by the cache, ra = ra0 + ra1*t + ra2*t**2 + raTrig, dec = dec0 + dec1*t + dec2*t**2 + decTrig, pm = pm0 + pm1*d + pm2*t**2 + pmTrig, where t = time / (seconds per day).

for time = et d = t / (days per Julian century), and the trig terms are of the form sum(i = 0, numTerms) tcoef[i] * sin(constant[i] + lcoef[i]*t) for ra and pm and sum(i = 0, numTerms) tcoef[i] * cos(constant[i] + lcoef[i]*t) for dec.

Exceptions
IException::User"Target body orientation information not available. Rerun spiceinit."
History
2015-07-01 Debbie A. Cook - Original version.

Definition at line 1935 of file SpiceRotation.cpp.

References m_tOrientationAvailable, p_degreeApplied, p_hasAngularVelocity, p_source, PckPolyFunction, and Isis::IException::User.

Referenced by setPckPolynomial().

◆ WrapAngle()

double Isis::SpiceRotation::WrapAngle ( double compareAngle,
double angle )

Wrap the input angle to keep it within 2pi radians of the angle to compare.

Parameters
[in]compareAngleLook vector in J2000 frame
[in]angleAngle to be wrapped if needed
Returns
double Wrapped angle.

Definition at line 2302 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors().

Referenced by SetPolynomial().

Member Data Documentation

◆ m_centScale

const double Isis::SpiceRotation::m_centScale
staticprivate

Seconds per Julian century for scaling time in seconds.

Definition at line 582 of file SpiceRotation.h.

◆ m_dayScale

const double Isis::SpiceRotation::m_dayScale
staticprivate

Seconds per day for scaling time in seconds to get target body w.

Definition at line 584 of file SpiceRotation.h.

◆ m_decNutPrec

std::vector<double> Isis::SpiceRotation::m_decNutPrec
private

Coefficients of pole decliniation nut/prec terms.

Definition at line 571 of file SpiceRotation.h.

Referenced by CacheLabel(), loadPCFromSpice(), loadPCFromTable(), poleDecNutPrecCoefs(), and setEphemerisTimePckPolyFunction().

◆ m_decPole

std::vector<Angle> Isis::SpiceRotation::m_decPole
private

Coefficients of a quadratic polynomial fitting pole dec.

Definition at line 564 of file SpiceRotation.h.

Referenced by CacheLabel(), getPckPolynomial(), loadPCFromSpice(), loadPCFromTable(), poleDecCoefs(), setEphemerisTimePckPolyFunction(), and setPckPolynomial().

◆ m_frameType

FrameType Isis::SpiceRotation::m_frameType
private

◆ m_orientation

ale::Orientations* Isis::SpiceRotation::m_orientation
protected

Definition at line 430 of file SpiceRotation.h.

◆ m_pm

std::vector<Angle> Isis::SpiceRotation::m_pm
private

Coefficients of a quadratic polynomial fitting pole pm.

Definition at line 565 of file SpiceRotation.h.

Referenced by CacheLabel(), getPckPolynomial(), loadPCFromSpice(), loadPCFromTable(), pmCoefs(), setEphemerisTimePckPolyFunction(), and setPckPolynomial().

◆ m_pmNutPrec

std::vector<double> Isis::SpiceRotation::m_pmNutPrec
private

Coefficients of prime meridian nut/prec terms.

Definition at line 572 of file SpiceRotation.h.

Referenced by CacheLabel(), loadPCFromSpice(), loadPCFromTable(), pmNutPrecCoefs(), and setEphemerisTimePckPolyFunction().

◆ m_raNutPrec

std::vector<double> Isis::SpiceRotation::m_raNutPrec
private

Coefficients of pole right ascension nut/prec terms.

Definition at line 570 of file SpiceRotation.h.

Referenced by CacheLabel(), loadPCFromSpice(), loadPCFromTable(), poleRaNutPrecCoefs(), and setEphemerisTimePckPolyFunction().

◆ m_raPole

std::vector<Angle> Isis::SpiceRotation::m_raPole
private

Coefficients of a quadratic polynomial fitting pole ra.

Definition at line 563 of file SpiceRotation.h.

Referenced by CacheLabel(), getPckPolynomial(), loadPCFromSpice(), loadPCFromTable(), poleRaCoefs(), setEphemerisTimePckPolyFunction(), and setPckPolynomial().

◆ m_sysNutPrec0

std::vector<Angle> Isis::SpiceRotation::m_sysNutPrec0
private

Constants of planetary system nut/prec periods.

Definition at line 575 of file SpiceRotation.h.

Referenced by CacheLabel(), loadPCFromSpice(), loadPCFromTable(), setEphemerisTimePckPolyFunction(), and sysNutPrecConstants().

◆ m_sysNutPrec1

std::vector<Angle> Isis::SpiceRotation::m_sysNutPrec1
private

Linear terms of planetary system nut/prec periods.

Definition at line 576 of file SpiceRotation.h.

Referenced by CacheLabel(), loadPCFromSpice(), loadPCFromTable(), setEphemerisTimePckPolyFunction(), and sysNutPrecCoefs().

◆ m_tOrientationAvailable

bool Isis::SpiceRotation::m_tOrientationAvailable
private

Target orientation constants are available.

Definition at line 448 of file SpiceRotation.h.

Referenced by loadPCFromSpice(), loadPCFromTable(), SpiceRotation(), SpiceRotation(), and usePckPolynomial().

◆ p_av

◆ p_axis1

◆ p_axis2

◆ p_axis3

◆ p_axisP

int Isis::SpiceRotation::p_axisP
private

The axis defined by the spacecraft vector for defining a nadir rotation.

Definition at line 453 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), SpiceRotation(), and SpiceRotation().

◆ p_axisV

int Isis::SpiceRotation::p_axisV
private

The axis defined by the velocity vector for defining a nadir rotation.

Definition at line 455 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), SpiceRotation(), and SpiceRotation().

◆ p_baseTime

double Isis::SpiceRotation::p_baseTime
private

◆ p_cacheTime

std::vector<double> Isis::SpiceRotation::p_cacheTime
protected

◆ p_CJ

◆ p_coefficients

std::vector<double> Isis::SpiceRotation::p_coefficients[3]
private

Coefficients defining functions fit to 3 pointing angles.

Definition at line 464 of file SpiceRotation.h.

Referenced by Cache(), DCJdt(), EvaluatePolyFunction(), GetPolynomial(), setEphemerisTimePolyFunction(), SetPolynomial(), SetPolynomialDegree(), and SpiceRotation().

◆ p_constantFrames

std::vector<int> Isis::SpiceRotation::p_constantFrames
private

Chain of Naif frame codes in constant rotation TC.

The first entry will always be the target frame code

Definition at line 435 of file SpiceRotation.h.

Referenced by CacheLabel(), ConstantFrameChain(), Frame(), FrameTrace(), InitConstantRotation(), LoadCache(), LoadCache(), LoadCache(), LoadTimeCache(), ReloadCache(), SetAngles(), setEphemerisTimeNadir(), setEphemerisTimeSpice(), SetFrame(), setFrameType(), SpiceRotation(), SpiceRotation(), and SpiceRotation().

◆ p_degree

int Isis::SpiceRotation::p_degree
protected

◆ p_degreeApplied

bool Isis::SpiceRotation::p_degreeApplied
private

Flag indicating whether or not a polynomial of degree p_degree has been created and used to fill the cache.

Definition at line 461 of file SpiceRotation.h.

Referenced by SetPolynomial(), SetPolynomialDegree(), SpiceRotation(), SpiceRotation(), SpiceRotation(), and usePckPolynomial().

◆ p_et

◆ p_fullCacheEndTime

double Isis::SpiceRotation::p_fullCacheEndTime
private

◆ p_fullCacheSize

int Isis::SpiceRotation::p_fullCacheSize
private

◆ p_fullCacheStartTime

double Isis::SpiceRotation::p_fullCacheStartTime
private

◆ p_hasAngularVelocity

bool Isis::SpiceRotation::p_hasAngularVelocity
private

◆ p_matrixSet

bool Isis::SpiceRotation::p_matrixSet
private

Flag indicating p_TJ has been set.

Definition at line 447 of file SpiceRotation.h.

Referenced by SpiceRotation(), SpiceRotation(), and SpiceRotation().

◆ p_minimizeCache

DownsizeStatus Isis::SpiceRotation::p_minimizeCache
private

Status of downsizing the cache (set to No to ignore)

Definition at line 469 of file SpiceRotation.h.

Referenced by Cache(), LoadCache(), LoadTimeCache(), MinimizeCache(), ReloadCache(), SpiceRotation(), SpiceRotation(), and SpiceRotation().

◆ p_noOverride

bool Isis::SpiceRotation::p_noOverride
private

Flag to compute base time;.

Definition at line 466 of file SpiceRotation.h.

Referenced by ComputeBaseTime(), SetOverrideBaseTime(), SpiceRotation(), SpiceRotation(), and SpiceRotation().

◆ p_overrideBaseTime

double Isis::SpiceRotation::p_overrideBaseTime
private

Value set by caller to override computed base time.

Definition at line 467 of file SpiceRotation.h.

Referenced by ComputeBaseTime(), SetOverrideBaseTime(), and SpiceRotation().

◆ p_overrideTimeScale

double Isis::SpiceRotation::p_overrideTimeScale
private

Value set by caller to override computed time scale.

Definition at line 468 of file SpiceRotation.h.

Referenced by ComputeBaseTime(), SetOverrideBaseTime(), and SpiceRotation().

◆ p_quaternion

Quaternion Isis::SpiceRotation::p_quaternion
private

Quaternion for J2000 to reference rotation at et.

Definition at line 444 of file SpiceRotation.h.

Referenced by SpiceRotation().

◆ p_source

◆ p_targetCode

int Isis::SpiceRotation::p_targetCode
private

For computing Nadir rotation only.

Definition at line 457 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), SpiceRotation(), and SpiceRotation().

◆ p_TC

std::vector<double> Isis::SpiceRotation::p_TC
private

Rotation matrix from first constant rotation (after all time-based rotations in frame chain from J2000 to target) to the target frame.

Definition at line 473 of file SpiceRotation.h.

Referenced by CacheLabel(), ConstantMatrix(), ConstantRotation(), InitConstantRotation(), J2000Vector(), LoadCache(), LoadCache(), LoadCache(), LoadTimeCache(), Matrix(), ReferenceVector(), ReloadCache(), SetAngles(), SetConstantMatrix(), SpiceRotation(), StateTJ(), toJ2000Partial(), and ToReferencePartial().

◆ p_timeBias

double Isis::SpiceRotation::p_timeBias
private

iTime bias when reading kernels

Definition at line 441 of file SpiceRotation.h.

Referenced by LoadTimeCache(), setEphemerisTimeSpice(), SetTimeBias(), SpiceRotation(), SpiceRotation(), and SpiceRotation().

◆ p_timeFrames

std::vector<int> Isis::SpiceRotation::p_timeFrames
private

Chain of Naif frame codes in time-based rotation CJ.

The last entry will always be 1 (J2000 code)

Definition at line 438 of file SpiceRotation.h.

Referenced by CacheLabel(), FrameTrace(), InitConstantRotation(), LoadCache(), LoadCache(), LoadCache(), LoadTimeCache(), ReloadCache(), SetAngles(), setEphemerisTimeNadir(), setEphemerisTimeSpice(), SpiceRotation(), and TimeFrameChain().

◆ p_timeScale

double Isis::SpiceRotation::p_timeScale
private

The documentation for this class was generated from the following files: