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. More...
 
 SpiceRotation (int frameCode, int targetCode)
 Construct an empty SpiceRotation object using valid Naif frame code and. More...
 
 SpiceRotation (const SpiceRotation &rotToCopy)
 Construct a SpiceRotation object by copying from an existing one. More...
 
virtual ~SpiceRotation ()
 Destructor for SpiceRotation object. More...
 
void SetFrame (int frameCode)
 Change the frame to the given frame code. More...
 
int Frame ()
 Accessor method that returns the frame code. More...
 
void SetTimeBias (double timeBias)
 Apply a time bias when invoking SetEphemerisTime method. More...
 
void SetEphemerisTime (double et)
 Return the J2000 to reference frame quaternion at given time. More...
 
double EphemerisTime () const
 Accessor method to get current ephemeris time. More...
 
std::vector< double > GetCenterAngles ()
 Return the camera angles at the center time of the observation. More...
 
std::vector< double > Matrix ()
 Return the full rotation TJ as a matrix. More...
 
std::vector< double > AngularVelocity ()
 Accessor method to get the angular velocity. More...
 
std::vector< double > ConstantRotation ()
 Return the constant 3x3 rotation TC matrix as a quaternion. More...
 
std::vector< double > & ConstantMatrix ()
 Return the constant 3x3 rotation TC matrix as a vector of length 9. More...
 
void SetConstantMatrix (std::vector< double > constantMatrix)
 Set the constant 3x3 rotation TC matrix from a vector of length 9. More...
 
std::vector< double > TimeBasedRotation ()
 Return time-based 3x3 rotation CJ matrix as a quaternion. More...
 
std::vector< double > & TimeBasedMatrix ()
 Return time-based 3x3 rotation CJ matrix as a vector of length 9. More...
 
void SetTimeBasedMatrix (std::vector< double > timeBasedMatrix)
 Set the time-based 3x3 rotation CJ matrix from a vector of length 9. More...
 
std::vector< double > J2000Vector (const std::vector< double > &rVec)
 Given a direction vector in the reference frame, return a J2000 direction. More...
 
std::vector< AnglepoleRaCoefs ()
 Return the coefficients used to calculate the target body pole ra. More...
 
std::vector< AnglepoleDecCoefs ()
 Return the coefficients used to calculate the target body pole dec. More...
 
std::vector< AnglepmCoefs ()
 Return the coefficients used to calculate the target body prime meridian. More...
 
std::vector< double > poleRaNutPrecCoefs ()
 Return the coefficients used to calculate the target body pole ra nut/prec coefficients. More...
 
std::vector< double > poleDecNutPrecCoefs ()
 Return the coefficients used to calculate the target body pole dec nut/prec coefficients. More...
 
std::vector< double > pmNutPrecCoefs ()
 Return the coefficients used to calculate the target body pm nut/prec coefficients. More...
 
std::vector< AnglesysNutPrecConstants ()
 Return the constants used to calculate the target body system nut/prec angles. More...
 
std::vector< AnglesysNutPrecCoefs ()
 Return the coefficients used to calculate the target body system nut/prec angles. More...
 
std::vector< double > ReferenceVector (const std::vector< double > &jVec)
 Given a direction vector in J2000, return a reference frame direction. More...
 
std::vector< double > EvaluatePolyFunction ()
 Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time. More...
 
void loadPCFromSpice (int CenterBodyCode)
 Initialize planetary orientation constants from Spice PCK. More...
 
void loadPCFromTable (const PvlObject &Label)
 Initialize planetary orientation constants from an cube body rotation label. More...
 
void MinimizeCache (DownsizeStatus status)
 Set the downsize status to minimize cache. More...
 
void LoadCache (double startTime, double endTime, int size)
 Cache J2000 rotation quaternion over a time range. More...
 
void LoadCache (double time)
 Cache J2000 to frame rotation for a time. More...
 
void LoadCache (Table &table)
 Cache J2000 rotations using a table file. More...
 
Table LineCache (const QString &tableName)
 Return a table with J2000 to reference rotations. More...
 
void ReloadCache ()
 Cache J2000 rotation over existing cached time range using polynomials. More...
 
Table Cache (const QString &tableName)
 Return a table with J2000 to reference rotations. More...
 
void CacheLabel (Table &table)
 Add labels to a SpiceRotation table. More...
 
void LoadTimeCache ()
 Load the time cache. More...
 
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. More...
 
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. More...
 
bool IsCached () const
 Checks if the cache is empty. More...
 
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. More...
 
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 + ... More...
 
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). More...
 
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). More...
 
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 + ... More...
 
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. More...
 
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 + ... More...
 
Source GetSource ()
 Accessor method to get the rotation source. More...
 
void SetSource (Source source)
 Resets the source of the rotation to the given value. More...
 
void ComputeBaseTime ()
 Compute the base time using cached times. More...
 
FrameType getFrameType ()
 Accessor method to get the rotation frame type. More...
 
double GetBaseTime ()
 Accessor method to get the rotation base time. More...
 
double GetTimeScale ()
 Accessor method to get the rotation time scale. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void DCJdt (std::vector< double > &dRJ)
 Compute the derivative of the 3x3 rotation matrix CJ with respect to time. More...
 
double WrapAngle (double compareAngle, double angle)
 Wrap the input angle to keep it within 2pi radians of the angle to compare. More...
 
void SetAxes (int axis1, int axis2, int axis3)
 Set the axes of rotation for decomposition of a rotation matrix into 3 angles. More...
 
std::vector< double > GetFullCacheTime ()
 Return full listing (cache) of original time coverage requested. More...
 
void FrameTrace (double et)
 Compute frame trace chain from target frame to J2000. More...
 
std::vector< int > ConstantFrameChain ()
 Accessor method to get the frame chain for the constant part of the rotation (ends in target) More...
 
std::vector< int > TimeFrameChain ()
 Accessor method to get the frame chain for the rotation (begins in J2000). More...
 
void InitConstantRotation (double et)
 Initialize the constant rotation. More...
 
bool HasAngularVelocity ()
 Checks whether the rotation has angular velocities. More...
 
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. More...
 
std::vector< double > Extrapolate (double timeEt)
 Extrapolate pointing for a given time assuming a constant angular velocity. More...
 
void checkForBinaryPck ()
 Check loaded pck to see if any are binary and set frame type to indicate binary pck. More...
 

Protected Member Functions

void SetFullCacheParameters (double startTime, double endTime, int cacheSize)
 Set the full cache time parameters. More...
 
void setEphemerisTimeMemcache ()
 Updates rotation state based on the rotation cache. More...
 
void setEphemerisTimeNadir ()
 When setting the ephemeris time, uses spacecraft nadir source to update the rotation state. More...
 
void setEphemerisTimeSpice ()
 When setting the ephemeris time, updates the rotation state based on data read directly from NAIF kernels using NAIF Spice routines. More...
 
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. More...
 
void setEphemerisTimePolyFunctionOverSpice ()
 When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kernel data. More...
 
void setEphemerisTimePckPolyFunction ()
 When setting the ephemeris time, updates the rotation state based on the PcK polynomial. More...
 

Protected Attributes

std::vector< double > p_cacheTime
 iTime for corresponding rotation More...
 
std::vector< std::vector< double > > p_cache
 Cached rotations, stored as rotation matrix from J2000 to 1st constant frame (CJ) or coefficients of polynomial fit to rotation angles. More...
 
int p_degree
 Degree of fit polynomial for angles. More...
 
int p_axis1
 Axis of rotation for angle 1 of rotation. More...
 
int p_axis2
 Axis of rotation for angle 2 of rotation. More...
 
int p_axis3
 Axis of rotation for angle 3 of rotation. More...
 

Private Member Functions

void setFrameType ()
 Set the frame type (m_frameType). More...
 
std::vector< double > StateTJ ()
 State matrix (6x6) for rotating state vectors from J2000 to target frame. More...
 

Private Attributes

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

Static Private Attributes

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

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 Isis3 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 223 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 280 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 289 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 271 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 258 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 51 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 85 of file SpiceRotation.cpp.

References _FILEINFO_, 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 186 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 1139 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 1180 of file SpiceRotation.cpp.

References p_av.

Referenced by ReloadCache().

◆ 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 710 of file SpiceRotation.cpp.

References _FILEINFO_, CacheLabel(), Isis::TableField::Double, Isis::Quaternion::GetQuaternion(), LineCache(), LoadTimeCache(), Memcache, p_baseTime, p_cache, p_cacheAv, 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 Isis::DawnVirCamera::DawnVirCamera(), LineCache(), and Isis::RosettaVirtisCamera::RosettaVirtisCamera().

◆ 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 1012 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), Isis::Blob::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().

◆ 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 2977 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 2781 of file SpiceRotation.cpp.

References _FILEINFO_, 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 1903 of file SpiceRotation.cpp.

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

Referenced by 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 1191 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 2694 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 2679 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 2826 of file SpiceRotation.cpp.

References Angles(), Isis::NaifStatus::CheckErrors(), 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 1988 of file SpiceRotation.cpp.

References _FILEINFO_, 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 1953 of file SpiceRotation.cpp.

References _FILEINFO_, 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 288 of file SpiceRotation.cpp.

References p_et.

◆ 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 3229 of file SpiceRotation.cpp.

References Isis::BasisFunction::Evaluate(), p_baseTime, p_coefficients, p_degree, p_et, p_timeScale, and Isis::BasisFunction::SetCoefficients().

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 2935 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 207 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 2539 of file SpiceRotation.cpp.

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

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 2239 of file SpiceRotation.cpp.

References p_baseTime.

Referenced by Isis::BundleObservation::initializeExteriorOrientation().

◆ 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 1120 of file SpiceRotation.cpp.

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

◆ 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 2208 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 2507 of file SpiceRotation.cpp.

References _FILEINFO_, 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 1889 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 1867 of file SpiceRotation.cpp.

References p_coefficients.

Referenced by Isis::BundleObservation::initializeExteriorOrientation().

◆ GetSource()

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

Accessor method to get the rotation source.

Returns
SpiceRotation::Source The source of the rotation.

Definition at line 2218 of file SpiceRotation.cpp.

References p_source.

◆ GetTimeScale()

double Isis::SpiceRotation::GetTimeScale ( )

Accessor method to get the rotation time scale.

Returns
double The time scale for the rotation.

Definition at line 2249 of file SpiceRotation.cpp.

References p_timeScale.

Referenced by Isis::BundleObservation::initializeExteriorOrientation().

◆ HasAngularVelocity()

bool Isis::SpiceRotation::HasAngularVelocity ( )

Checks whether the rotation has angular velocities.

Returns
bool Indicates whether the rotation has angular velocities.

Definition at line 1211 of file SpiceRotation.cpp.

References p_hasAngularVelocity.

◆ InitConstantRotation()

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

Initialize the constant rotation.

Parameters
etEphemeris time.

Definition at line 2750 of file SpiceRotation.cpp.

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

Referenced by LoadCache(), and setEphemerisTimeNadir().

◆ IsCached()

bool Isis::SpiceRotation::IsCached ( ) const

Checks if the cache is empty.

Returns
bool Indicates whether this rotation is cached.

Definition at line 298 of file SpiceRotation.cpp.

References p_cache.

◆ 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 1223 of file SpiceRotation.cpp.

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

Referenced by Isis::Sensor::computeRaDec(), Isis::CameraGroundMap::GetdXYdPoint(), Isis::CameraGroundMap::GetXY(), Isis::Sensor::lookDirectionJ2000(), Isis::RadarGroundMap::SetFocalPlane(), and Isis::Sensor::SetLookDirection().

◆ 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 674 of file SpiceRotation.cpp.

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

Referenced by Cache().

◆ LoadCache() [1/3]

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 331 of file SpiceRotation.cpp.

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

Referenced by Isis::DawnVirCamera::DawnVirCamera(), LoadCache(), and Isis::RosettaVirtisCamera::RosettaVirtisCamera().

◆ LoadCache() [2/3]

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 400 of file SpiceRotation.cpp.

References LoadCache().

◆ LoadCache() [3/3]

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 429 of file SpiceRotation.cpp.

References Isis::PvlObject::hasKeyword(), Isis::Blob::Label(), p_cache, p_cacheAv, p_cacheTime, p_constantFrames, p_hasAngularVelocity, p_TC, p_timeFrames, Isis::PvlKeyword::size(), and Isis::toInt().

◆ 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 821 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 933 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, Isis::PvlKeyword::size(), and Isis::toDouble().

◆ 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 2288 of file SpiceRotation.cpp.

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

Referenced by Cache(), 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 2664 of file SpiceRotation.cpp.

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

◆ MinimizeCache()

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

Set the downsize status to minimize cache.

Parameters
statusThe DownsizeStatus enumeration value.

Definition at line 308 of file SpiceRotation.cpp.

References p_minimizeCache.

Referenced by Isis::DawnVirCamera::DawnVirCamera(), and Isis::RosettaVirtisCamera::RosettaVirtisCamera().

◆ 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 1313 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 1365 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 1294 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 1348 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 1274 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 1331 of file SpiceRotation.cpp.

References m_raNutPrec.

◆ ReferenceVector()

◆ 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 594 of file SpiceRotation.cpp.

References _FILEINFO_, AngularVelocity(), LoadTimeCache(), Memcache, No, p_av, p_cache, p_cacheAv, p_cacheTime, p_CJ, p_degree, p_et, p_fullCacheSize, p_hasAngularVelocity, p_minimizeCache, p_source, PolyFunction, PolyFunctionOverSpice, Isis::IException::Programmer, SetEphemerisTime(), and TimeBasedMatrix().

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 1166 of file SpiceRotation.cpp.

References p_cache, p_CJ, p_et, 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 2266 of file SpiceRotation.cpp.

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

◆ 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 2704 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 242 of file SpiceRotation.cpp.

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

Referenced by GetCenterAngles(), LoadCache(), ReloadCache(), SetAngles(), and SetPolynomial().

◆ 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 3065 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), p_av, p_cache, p_cacheAv, 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 3131 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 3354 of file SpiceRotation.cpp.

References Isis::DEG2RAD, 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, Isis::Angle::Radians, 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 3263 of file SpiceRotation.cpp.

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

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 3308 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 3170 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors().

Referenced by SetEphemerisTime().

◆ SetFrame()

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

◆ setFrameType()

void Isis::SpiceRotation::setFrameType ( )
private

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 3013 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 2962 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 1926 of file SpiceRotation.cpp.

References p_noOverride, p_overrideBaseTime, and p_overrideTimeScale.

Referenced by Isis::BundleObservation::initializeExteriorOrientation().

◆ 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 1844 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 1556 of file SpiceRotation.cpp.

References Isis::LeastSquares::AddKnown(), Angles(), Isis::NaifStatus::CheckErrors(), Isis::BasisFunction::Coefficient(), Isis::BasisFunction::Coefficients(), ComputeBaseTime(), Isis::LineEquation::Intercept(), p_axis1, p_axis2, p_axis3, p_baseTime, p_cache, p_cacheTime, p_degree, p_source, p_timeScale, PolyFunction, PolyFunctionOverSpice, SetEphemerisTime(), Isis::LineEquation::Slope(), Isis::LeastSquares::Solve(), and WrapAngle().

Referenced by Isis::BundleObservation::applyParameterCorrections(), Isis::BundleObservation::initializeExteriorOrientation(), 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 1707 of file SpiceRotation.cpp.

References Isis::NaifStatus::CheckErrors(), ComputeBaseTime(), p_coefficients, p_degree, p_degreeApplied, p_et, p_source, Isis::BasisFunction::SetCoefficients(), 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 2159 of file SpiceRotation.cpp.

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

Referenced by Isis::BundleObservation::initializeExteriorOrientation().

◆ 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 2228 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 2739 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 224 of file SpiceRotation.cpp.

References p_timeBias.

Referenced by Isis::MocNarrowAngleCamera::MocNarrowAngleCamera(), and Isis::MocWideAngleCamera::MocWideAngleCamera().

◆ 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 2892 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 1400 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 1382 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 2729 of file SpiceRotation.cpp.

References p_CJ.

Referenced by ReloadCache().

◆ 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 2714 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 1201 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 1424 of file SpiceRotation.cpp.

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

Referenced by Isis::CameraGroundMap::GetdXYdTOrientation().

◆ 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 2048 of file SpiceRotation.cpp.

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

Referenced by Isis::CameraGroundMap::GetdXYdOrientation().

◆ 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 1764 of file SpiceRotation.cpp.

References _FILEINFO_, 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 2131 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 594 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 596 of file SpiceRotation.h.

◆ m_decNutPrec

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

Coefficients of pole decliniation nut/prec terms.

Definition at line 583 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 576 of file SpiceRotation.h.

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

◆ m_frameType

FrameType Isis::SpiceRotation::m_frameType
private

◆ m_pm

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

Coefficients of a quadratic polynomial fitting pole pm.

Definition at line 577 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 584 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 582 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 575 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 587 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 588 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 458 of file SpiceRotation.h.

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

◆ p_av

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

◆ p_axis1

int Isis::SpiceRotation::p_axis1
protected

◆ p_axis2

int Isis::SpiceRotation::p_axis2
protected

◆ p_axis3

int Isis::SpiceRotation::p_axis3
protected

◆ p_axisP

int Isis::SpiceRotation::p_axisP
private

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

Definition at line 463 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), 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 465 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), and SpiceRotation().

◆ p_baseTime

double Isis::SpiceRotation::p_baseTime
private

◆ p_cache

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

Cached rotations, stored as rotation matrix from J2000 to 1st constant frame (CJ) or coefficients of polynomial fit to rotation angles.

Definition at line 432 of file SpiceRotation.h.

Referenced by Cache(), IsCached(), LoadCache(), LoadTimeCache(), ReloadCache(), SetAngles(), setEphemerisTimeMemcache(), SetPolynomial(), and SpiceRotation().

◆ p_cacheAv

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

Cached angular velocities for corresponding rotactions in p_cache.

Definition at line 488 of file SpiceRotation.h.

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

◆ 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 474 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 445 of file SpiceRotation.h.

Referenced by CacheLabel(), ConstantFrameChain(), Frame(), FrameTrace(), InitConstantRotation(), LoadCache(), LoadTimeCache(), setEphemerisTimeNadir(), SetFrame(), setFrameType(), 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 471 of file SpiceRotation.h.

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

◆ p_et

◆ p_fullCacheEndTime

double Isis::SpiceRotation::p_fullCacheEndTime
private

Initial requested ending time of cache.

Definition at line 481 of file SpiceRotation.h.

Referenced by CacheLabel(), GetCenterAngles(), GetFullCacheTime(), LoadCache(), LoadTimeCache(), SetFullCacheParameters(), and SpiceRotation().

◆ p_fullCacheSize

int Isis::SpiceRotation::p_fullCacheSize
private

◆ p_fullCacheStartTime

double Isis::SpiceRotation::p_fullCacheStartTime
private

Initial requested starting time of cache.

Definition at line 480 of file SpiceRotation.h.

Referenced by CacheLabel(), GetCenterAngles(), GetFullCacheTime(), LoadCache(), LoadTimeCache(), SetFullCacheParameters(), and SpiceRotation().

◆ 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 457 of file SpiceRotation.h.

Referenced by SpiceRotation().

◆ p_minimizeCache

DownsizeStatus Isis::SpiceRotation::p_minimizeCache
private

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

Definition at line 479 of file SpiceRotation.h.

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

◆ p_noOverride

bool Isis::SpiceRotation::p_noOverride
private

Flag to compute base time;.

Definition at line 476 of file SpiceRotation.h.

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

◆ p_overrideBaseTime

double Isis::SpiceRotation::p_overrideBaseTime
private

Value set by caller to override computed base time.

Definition at line 477 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 478 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 454 of file SpiceRotation.h.

Referenced by SpiceRotation().

◆ p_source

Source Isis::SpiceRotation::p_source
private

◆ p_targetCode

int Isis::SpiceRotation::p_targetCode
private

For computing Nadir rotation only.

Definition at line 467 of file SpiceRotation.h.

Referenced by setEphemerisTimeNadir(), 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 483 of file SpiceRotation.h.

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

◆ p_timeBias

double Isis::SpiceRotation::p_timeBias
private

iTime bias when reading kernels

Definition at line 451 of file SpiceRotation.h.

Referenced by LoadTimeCache(), SetTimeBias(), 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 448 of file SpiceRotation.h.

Referenced by CacheLabel(), InitConstantRotation(), LoadCache(), setEphemerisTimeNadir(), SpiceRotation(), and TimeFrameChain().

◆ p_timeScale

double Isis::SpiceRotation::p_timeScale
private

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