Isis 3 Programmer Reference
SpiceRotation.h
1 #ifndef SpiceRotation_h
2 #define SpiceRotation_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 #include <string>
10 #include <vector>
11 
12 #include <nlohmann/json.hpp>
13 #include <ale/Orientations.h>
14 
15 #include "Angle.h"
16 #include "Table.h"
17 #include "PolynomialUnivariate.h"
18 #include "Quaternion.h"
19 
20 
21 
22 #define J2000Code 1
23 
24 namespace Isis {
210  public:
211  // Constructors
212  SpiceRotation(int frameCode);
213  /* SpiceRotation( int NaifCode );
214  We would like to call refchg instead to avoid the strings. Currently Naif does
215  not have refchg_c, but only the f2c'd refchg.c.*/
216  SpiceRotation(int frameCode, int targetCode);
217  SpiceRotation(const SpiceRotation &rotToCopy);
218 
219  // Destructor
220  virtual ~SpiceRotation();
221 
222  // Change the frame (has no effect if cached)
223  void SetFrame(int frameCode);
224  int Frame();
225 
226  void SetTimeBias(double timeBias);
227  double TimeBias() const;
228 
245  enum Source {
252  };
253 
258  enum PartialType {
261  WRT_Twist
262  };
263 
268  Yes,
270  No
271  };
272 
276  enum FrameType {
277  UNKNOWN = 0,
278  INERTL = 1,
279  PCK = 2,
280  CK = 3,
281  TK = 4,
282  DYN = 5,
283  BPC = 6,
284  NOTJ2000PCK = 7
285  };
286 
287  void SetEphemerisTime(double et);
288  double EphemerisTime() const;
289 
290  std::vector<double> GetCenterAngles();
291 
292  std::vector<double> Matrix();
293  std::vector<double> AngularVelocity();
294 
295  // TC
296  std::vector<double> ConstantRotation();
297  std::vector<double> &ConstantMatrix();
298  void SetConstantMatrix(std::vector<double> constantMatrix);
299 
300  // CJ
301  std::vector<double> TimeBasedRotation();
302  std::vector<double> &TimeBasedMatrix();
303  void SetTimeBasedMatrix(std::vector<double> timeBasedMatrix);
304 
305  std::vector<double> J2000Vector(const std::vector<double> &rVec);
306 
307  std::vector<Angle> poleRaCoefs();
308 
309  std::vector<Angle> poleDecCoefs();
310 
311  std::vector<Angle> pmCoefs();
312 
313  std::vector<double> poleRaNutPrecCoefs();
314 
315  std::vector<double> poleDecNutPrecCoefs();
316 
317  std::vector<double> pmNutPrecCoefs();
318 
319  std::vector<Angle> sysNutPrecConstants();
320 
321  std::vector<Angle> sysNutPrecCoefs();
322 
323  std::vector<double> ReferenceVector(const std::vector<double> &jVec);
324 
325  std::vector<double> EvaluatePolyFunction();
326 
327  void loadPCFromSpice(int CenterBodyCode);
328  void loadPCFromTable(const PvlObject &Label);
329 
330  void MinimizeCache(DownsizeStatus status);
331 
332  void LoadCache(double startTime, double endTime, int size);
333 
334  void LoadCache(double time);
335 
336  void LoadCache(Table &table);
337 
338  void LoadCache(nlohmann::json &isd);
339 
340  Table LineCache(const QString &tableName);
341 
342  void ReloadCache();
343 
344  Table Cache(const QString &tableName);
345  void CacheLabel(Table &table);
346 
347  void LoadTimeCache();
348 
349  std::vector<double> Angles(int axis3, int axis2, int axis1);
350  void SetAngles(std::vector<double> angles, int axis3, int axis2, int axis1);
351 
352  bool IsCached() const;
353 
354  void SetPolynomial(const Source type=PolyFunction);
355 
356  void SetPolynomial(const std::vector<double> &abcAng1,
357  const std::vector<double> &abcAng2,
358  const std::vector<double> &abcAng3,
359  const Source type = PolyFunction);
360 
361  void usePckPolynomial();
362  void setPckPolynomial(const std::vector<Angle> &raCoeff,
363  const std::vector<Angle> &decCoeff,
364  const std::vector<Angle> &pmCoeff);
365 
366  void GetPolynomial(std::vector<double> &abcAng1,
367  std::vector<double> &abcAng2,
368  std::vector<double> &abcAng3);
369 
370  void getPckPolynomial(std::vector<Angle> &raCoeff,
371  std::vector<Angle> &decCoeff,
372  std::vector<Angle> &pmCoeff);
373 
374  // Set the polynomial degree
375  void SetPolynomialDegree(int degree);
376  Source GetSource();
377  void SetSource(Source source);
378  void ComputeBaseTime();
380  double GetBaseTime();
381  double GetTimeScale();
382 
383  void SetOverrideBaseTime(double baseTime, double timeScale);
384  void SetCacheTime(std::vector<double> cacheTime);
385 
386  // Derivative methods
387  double DPolynomial(const int coeffIndex);
388  double DPckPolynomial(PartialType partialVar, const int coeffIndex);
389 
390  std::vector<double> toJ2000Partial(const std::vector<double> &lookT,
391  PartialType partialVar, int coeffIndex);
392  std::vector<double> ToReferencePartial(std::vector<double> &lookJ,
393  PartialType partialVar, int coeffIndex);
394  void DCJdt(std::vector<double> &dRJ);
395 
396  double WrapAngle(double compareAngle, double angle);
397  void SetAxes(int axis1, int axis2, int axis3);
398  std::vector<double> GetFullCacheTime();
399  void FrameTrace(double et);
400 
401  // Return the frame chain for the constant part of the rotation (ends in target)
402  std::vector<int> ConstantFrameChain();
403  std::vector<int> TimeFrameChain();
404  void InitConstantRotation(double et);
405  bool HasAngularVelocity();
406 
407  void ComputeAv();
408  std::vector<double> Extrapolate(double timeEt);
409 
410  void checkForBinaryPck();
411 
412  int cacheSize() {
413  if (m_orientation) {
414  return m_orientation->getRotations().size();
415  }
416  return 0;
417  }
418 
419  protected:
420  void SetFullCacheParameters(double startTime, double endTime, int cacheSize);
422  void setEphemerisTimeNadir();
423  void setEphemerisTimeSpice();
427  std::vector<double> p_cacheTime;
428  int p_degree;
429  int p_axis1;
430  int p_axis2;
431  int p_axis3;
432  ale::Orientations *m_orientation;
433 
434  private:
435  // method
436  void setFrameType();
437  std::vector<int> p_constantFrames;
440  std::vector<int> p_timeFrames;
443  double p_timeBias;
444 
445  double p_et;
449  bool p_matrixSet;
451 
452 
455  int p_axisP;
457  int p_axisV;
460 
461  double p_baseTime;
462  double p_timeScale;
466  std::vector<double> p_coefficients[3];
475  std::vector<double> p_TC;
478  std::vector<double> p_CJ;
480  std::vector<double> p_av;
483  std::vector<double> StateTJ();
485  // The remaining items are only used for PCK frame types. In this case the
486  // rotation is stored as a cache, but the coefficients are available for display
487  // or comparison, and the first three coefficient sets can be solved for and
488  // updated in jigsaw. The initial coefficient values are read from a Naif PCK.
489  //
490  // The general equation for the right ascension of the pole is
491  //
492  // raPole = raPole[0] + raPole[1]*Time + raPole[2]*Time**2 + raNutPrec,
493  // where
494  // raNutPrec = raNutPrec1[0]*sin(sysNutPrec[0][0] + sysNutPrec[0][1]*Time) +
495  // raNutPrec1[1]*sin(sysNutPrec[1][0] + sysNutPrec[1][1]*Time) + ...
496  // raNutPrec1[N-1]*sin(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time) +
497  // (optional for multiples of nutation precession angles)
498  // raNutPrec2[0]*sin(2*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
499  // raNutPrec2[1]*sin(2*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
500  // raNutPrec2[N-1]*sin(2*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time)) +
501  // raNutPrecM[0]*sin(M*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
502  // raNutPrecM[1]*sin(M*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
503  // raNutPrecM[N-1]*sin(M*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time)) +
504  //
505  // The general equation for the declination of the pole is
506  //
507  // decPole = p_decPole[0] + p_decPole[1]*Time + p_decPole[2]*Time**2 + decNutPrec,
508  // where
509  // decNutPrec = decNutPrec1[0]*cos(sysNutPrec[0][0] + sysNutPrec[0][1]*Time) +
510  // decNutPrec1[1]*cos(sysNutPrec[1][0] + sysNutPrec[1][1]*Time) + ...
511  // decNutPrec1[N-1]*cos(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time) +
512  // decNutPrec2[0]*cos(2*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
513  // decNutPrec2[1]*cos(2*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
514  // decNutPrec2[N-1]*cos(2*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time)) +
515  // (optional for multiples of nutation precession angles)
516  // decNutPrecM[0]*sin(M*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
517  // decNutPrecM[1]*sin(M*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
518  // decNutPrecM[N-1]*sin(M*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time))
519  //
520  // and Time is julian centuries since J2000.
521  //
522  // The general equation for the prime meridian rotation is
523  //
524  // pm = p_pm[0] + p_pm[1]*Dtime + p_pm[2]*Dtime**2 + pmNutPrec,
525  // where
526  // pmNutPrec = pmNutPrec1[0]*sin(sysNutPrec[0][0] + sysNutPrec[0][1]*Time) +
527  // pmNutPrec1[1]*sin(sysNutPrec[1][0] + sysNutPrec[1][1]*Time) + ...
528  // pmNutPrec1[N-1]*sin(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time) +
529  // (optional for multiples of nutation precession angles)
530  // pmNutPrec2[0]*sin(2*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
531  // pmNutPrec2[1]*sin(2*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
532  // pmNutPrec2[N-1]*sin(2*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time)) +
533  // pmNutPrecM[0]*sin(M*(sysNutPrec[0][0] + sysNutPrec[0][1]*Time)) +
534  // pmNutPrecM[1]*sin(M*(sysNutPrec[1][0] + sysNutPrec[1][1]*Time)) + ...
535  // pmNutPrecM[N-1]*sin(M*(sysNutPrec[N-1][0] + sysNutPrec[N-1][1]*Time))
536  //
537  // Time is interval in Julian centuries since the standard epoch,
538  // dTime is interval in days from the standard epoch (J2000),
539  //
540  // N is the number of nutation/precession terms for the planetary system of the target
541  // body, (possibly including multiple angles as unique terms,
542  // ie. 2*sysNutPrec[0][0] + sysNutPrec[][1]*Time).
543  //
544  // Many of the constants in this equation are 0. for a given body.
545  //
546  // M is included as an option for future improvements. M = highest multiple (period)
547  // of any of the nutation/precession angles included in the equations.
548  //
549  // ***NOTE*** Currently Naif stores multiples (amplitudes) as if they were additional
550  // nutation/precession terms (periods) in the equation. This method works as
551  // long as jigsaw does not solve for those values. In order to solve for
552  // those values, the multiples will need to be known so that the partial
553  // derivatives can be correctly calculated. Some possible ways of doing this
554  // are 1) Convince Naif to change their data format indicating the relation
555  // 2) Make an Isis version of the PCK data and have Isis software to
556  // calculate the rotation and partials.
557  // 3) Have an Isis addendum file that identifies the repeated periods
558  // and software to apply them when calculating the rotation and partials.
559  //
560  // For now this software will handle any terms with the same period and different
561  // amplitudes as unique terms in the equation (raNutPrec, decNutPrec,
562  // and pmNutPrec).
563  //
564  // The next three vectors will have length 3 (for a quadratic polynomial) if used.
565  std::vector<Angle>m_raPole;
566  std::vector<Angle>m_decPole;
567  std::vector<Angle>m_pm ;
568  //
569  // Currently multiples (terms with periods matching other terms but varying amplitudes)
570  // are handled as additional terms added to the end of the vector as Naif does (see
571  // comments in any of the standard Naif PCK.
572  std::vector<double>m_raNutPrec;
573  std::vector<double>m_decNutPrec;
574  std::vector<double>m_pmNutPrec;
575 
576  // The periods of bodies in the same system are modeled with a linear equation
577  std::vector<Angle>m_sysNutPrec0;
578  std::vector<Angle>m_sysNutPrec1;
579 
580  // The following scalars are used in the IAU equations to convert p_et to the appropriate time
581  // units for calculating target body ra, dec, and w. These need to be initialized in every
582  // constructor.
584  static const double m_centScale;
586  static const double m_dayScale;
587 
588  };
589 };
590 
591 #endif
Isis::SpiceRotation::GetBaseTime
double GetBaseTime()
Accessor method to get the rotation base time.
Definition: SpiceRotation.cpp:2423
Isis::SpiceRotation::p_fullCacheSize
int p_fullCacheSize
Initial requested cache size.
Definition: SpiceRotation.h:474
Isis::SpiceRotation::ComputeAv
void ComputeAv()
Compute the angular velocity from the time-based functions fit to the pointing angles This method com...
Definition: SpiceRotation.cpp:2982
Isis::SpiceRotation::EphemerisTime
double EphemerisTime() const
Accessor method to get current ephemeris time.
Definition: SpiceRotation.cpp:306
Isis::SpiceRotation::sysNutPrecConstants
std::vector< Angle > sysNutPrecConstants()
Return the constants used to calculate the target body system nut/prec angles.
Definition: SpiceRotation.cpp:1565
Isis::SpiceRotation::BPC
@ BPC
Isis specific code for binary pck.
Definition: SpiceRotation.h:283
Isis::SpiceRotation::checkForBinaryPck
void checkForBinaryPck()
Check loaded pck to see if any are binary and set frame type to indicate binary pck.
Definition: SpiceRotation.cpp:3180
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::SpiceRotation::SetTimeBias
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Definition: SpiceRotation.cpp:242
Isis::SpiceRotation::pmCoefs
std::vector< Angle > pmCoefs()
Return the coefficients used to calculate the target body prime meridian.
Definition: SpiceRotation.cpp:1496
Isis::SpiceRotation::p_axis3
int p_axis3
Axis of rotation for angle 3 of rotation.
Definition: SpiceRotation.h:431
Isis::SpiceRotation::CacheLabel
void CacheLabel(Table &table)
Add labels to a SpiceRotation table.
Definition: SpiceRotation.cpp:1182
Isis::SpiceRotation::GetFullCacheTime
std::vector< double > GetFullCacheTime()
Return full listing (cache) of original time coverage requested.
Definition: SpiceRotation.cpp:2708
Isis::SpiceRotation::EvaluatePolyFunction
std::vector< double > EvaluatePolyFunction()
Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.
Definition: SpiceRotation.cpp:3398
Isis::SpiceRotation::FrameType
FrameType
Enumeration for the frame type of the rotation.
Definition: SpiceRotation.h:276
Isis::SpiceRotation::p_quaternion
Quaternion p_quaternion
Quaternion for J2000 to reference rotation at et.
Definition: SpiceRotation.h:446
Isis::SpiceRotation::p_axis1
int p_axis1
Axis of rotation for angle 1 of rotation.
Definition: SpiceRotation.h:429
Isis::SpiceRotation::m_frameType
FrameType m_frameType
The type of rotation frame.
Definition: SpiceRotation.h:453
Isis::SpiceRotation::p_coefficients
std::vector< double > p_coefficients[3]
Coefficients defining functions fit to 3 pointing angles.
Definition: SpiceRotation.h:466
Isis::SpiceRotation::p_overrideBaseTime
double p_overrideBaseTime
Value set by caller to override computed base time.
Definition: SpiceRotation.h:469
Isis::SpiceRotation::p_timeBias
double p_timeBias
iTime bias when reading kernels
Definition: SpiceRotation.h:443
Isis::SpiceRotation::p_cacheTime
std::vector< double > p_cacheTime
iTime for corresponding rotation
Definition: SpiceRotation.h:427
Isis::SpiceRotation::DownsizeStatus
DownsizeStatus
Status of downsizing the cache.
Definition: SpiceRotation.h:267
Isis::SpiceRotation::setFrameType
void setFrameType()
Cached orientation information.
Definition: SpiceRotation.cpp:3216
Isis::SpiceRotation::p_baseTime
double p_baseTime
Base time used in fit equations.
Definition: SpiceRotation.h:461
Isis::SpiceRotation::p_constantFrames
std::vector< int > p_constantFrames
Chain of Naif frame codes in constant rotation TC.
Definition: SpiceRotation.h:437
Isis::SpiceRotation::SetPolynomialDegree
void SetPolynomialDegree(int degree)
Set the degree of the polynomials to be fit to the three camera angles for the time period covered by...
Definition: SpiceRotation.cpp:2343
Isis::SpiceRotation::p_matrixSet
bool p_matrixSet
Flag indicating p_TJ has been set.
Definition: SpiceRotation.h:449
Isis::SpiceRotation::Source
Source
The rotation can come from one of 3 places for an Isis cube.
Definition: SpiceRotation.h:245
Isis::SpiceRotation::loadPCFromTable
void loadPCFromTable(const PvlObject &Label)
Initialize planetary orientation constants from an cube body rotation label.
Definition: SpiceRotation.cpp:1103
Isis::SpiceRotation::GetCenterAngles
std::vector< double > GetCenterAngles()
Return the camera angles at the center time of the observation.
Definition: SpiceRotation.cpp:1290
Isis::SpiceRotation::poleRaCoefs
std::vector< Angle > poleRaCoefs()
Return the coefficients used to calculate the target body pole ra.
Definition: SpiceRotation.cpp:1457
Isis::SpiceRotation::SetPolynomial
void SetPolynomial(const Source type=PolyFunction)
Set the coefficients of a polynomial fit to each of the three camera angles for the time period cover...
Definition: SpiceRotation.cpp:1739
Isis::SpiceRotation::TimeBasedRotation
std::vector< double > TimeBasedRotation()
Return time-based 3x3 rotation CJ matrix as a quaternion.
Definition: SpiceRotation.cpp:2915
Isis::SpiceRotation::m_raNutPrec
std::vector< double > m_raNutPrec
Coefficients of pole right ascension nut/prec terms.
Definition: SpiceRotation.h:572
Isis::SpiceRotation::GetSource
Source GetSource()
Accessor method to get the rotation source.
Definition: SpiceRotation.cpp:2402
Isis::SpiceRotation::poleDecCoefs
std::vector< Angle > poleDecCoefs()
Return the coefficients used to calculate the target body pole dec.
Definition: SpiceRotation.cpp:1477
Isis::SpiceRotation::p_TC
std::vector< double > p_TC
Rotation matrix from first constant rotation (after all time-based rotations in frame chain from J200...
Definition: SpiceRotation.h:475
Isis::SpiceRotation::FrameTrace
void FrameTrace(double et)
Compute frame trace chain from target frame to J2000.
Definition: SpiceRotation.cpp:2740
Isis::SpiceRotation::SetFullCacheParameters
void SetFullCacheParameters(double startTime, double endTime, int cacheSize)
Set the full cache time parameters.
Definition: SpiceRotation.cpp:3165
Isis::SpiceRotation::PckPolyFunction
@ PckPolyFunction
Quadratic polynomial function with linear trignometric terms.
Definition: SpiceRotation.h:251
Isis::SpiceRotation::setEphemerisTimeMemcache
void setEphemerisTimeMemcache()
Updates rotation state based on the rotation cache.
Definition: SpiceRotation.cpp:3268
Isis::SpiceRotation::SetAngles
void SetAngles(std::vector< double > angles, int axis3, int axis2, int axis1)
Set the rotation angles (phi, delta, and w) for the current time to define the time-based matrix CJ.
Definition: SpiceRotation.cpp:1336
Isis::SpiceRotation::Yes
@ Yes
Downsize the cache.
Definition: SpiceRotation.h:268
Isis::SpiceRotation::J2000Vector
std::vector< double > J2000Vector(const std::vector< double > &rVec)
Given a direction vector in the reference frame, return a J2000 direction.
Definition: SpiceRotation.cpp:1408
Isis::SpiceRotation::MinimizeCache
void MinimizeCache(DownsizeStatus status)
Set the downsize status to minimize cache.
Definition: SpiceRotation.cpp:336
Isis::SpiceRotation::Angles
std::vector< double > Angles(int axis3, int axis2, int axis1)
Return the camera angles (right ascension, declination, and twist) for the time-based matrix CJ.
Definition: SpiceRotation.cpp:1309
Isis::SpiceRotation::Cache
Table Cache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition: SpiceRotation.cpp:868
Isis::SpiceRotation::sysNutPrecCoefs
std::vector< Angle > sysNutPrecCoefs()
Return the coefficients used to calculate the target body system nut/prec angles.
Definition: SpiceRotation.cpp:1583
Isis::SpiceRotation::setEphemerisTimeSpice
void setEphemerisTimeSpice()
When setting the ephemeris time, updates the rotation state based on data read directly from NAIF ker...
Definition: SpiceRotation.cpp:3339
Isis::SpiceRotation::m_decNutPrec
std::vector< double > m_decNutPrec
Coefficients of pole decliniation nut/prec terms.
Definition: SpiceRotation.h:573
Isis::SpiceRotation::~SpiceRotation
virtual ~SpiceRotation()
Destructor for SpiceRotation object.
Definition: SpiceRotation.cpp:200
Isis::SpiceRotation::StateTJ
std::vector< double > StateTJ()
State matrix (6x6) for rotating state vectors from J2000 to target frame.
Definition: SpiceRotation.cpp:3093
Isis::SpiceRotation::p_axis2
int p_axis2
Axis of rotation for angle 2 of rotation.
Definition: SpiceRotation.h:430
Isis::SpiceRotation::p_fullCacheStartTime
double p_fullCacheStartTime
Initial requested starting time of cache.
Definition: SpiceRotation.h:472
Isis::SpiceRotation::LoadCache
void LoadCache(double startTime, double endTime, int size)
Cache J2000 rotation quaternion over a time range.
Definition: SpiceRotation.cpp:359
Isis::SpiceRotation::p_av
std::vector< double > p_av
Angular velocity for rotation at time p_et.
Definition: SpiceRotation.h:480
Isis::SpiceRotation::p_axisV
int p_axisV
The axis defined by the velocity vector for defining a nadir rotation.
Definition: SpiceRotation.h:457
Isis::SpiceRotation::HasAngularVelocity
bool HasAngularVelocity()
Checks whether the rotation has angular velocities.
Definition: SpiceRotation.cpp:1396
Isis::SpiceRotation::p_CJ
std::vector< double > p_CJ
Rotation matrix from J2000 to first constant rotation.
Definition: SpiceRotation.h:478
Isis::SpiceRotation::p_timeFrames
std::vector< int > p_timeFrames
Chain of Naif frame codes in time-based rotation CJ.
Definition: SpiceRotation.h:440
Isis::SpiceRotation::INERTL
@ INERTL
See Naif Frames.req document for.
Definition: SpiceRotation.h:278
Isis::SpiceRotation::setEphemerisTimePolyFunctionOverSpice
void setEphemerisTimePolyFunctionOverSpice()
When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kern...
Definition: SpiceRotation.cpp:3482
Isis::SpiceRotation::m_sysNutPrec1
std::vector< Angle > m_sysNutPrec1
Linear terms of planetary system nut/prec periods.
Definition: SpiceRotation.h:578
Isis::SpiceRotation::p_degree
int p_degree
Degree of fit polynomial for angles.
Definition: SpiceRotation.h:428
Isis::SpiceRotation::m_dayScale
static const double m_dayScale
Seconds per day for scaling time in seconds to get target body w.
Definition: SpiceRotation.h:586
Isis::SpiceRotation::Memcache
@ Memcache
From cached table.
Definition: SpiceRotation.h:248
Isis::SpiceRotation::No
@ No
Do not downsize the cache.
Definition: SpiceRotation.h:270
Isis::SpiceRotation::p_noOverride
bool p_noOverride
Flag to compute base time;.
Definition: SpiceRotation.h:468
Isis::SpiceRotation::IsCached
bool IsCached() const
Checks if the cache is empty.
Definition: SpiceRotation.cpp:326
Isis::SpiceRotation::SetConstantMatrix
void SetConstantMatrix(std::vector< double > constantMatrix)
Set the constant 3x3 rotation TC matrix from a vector of length 9.
Definition: SpiceRotation.cpp:2905
Isis::SpiceRotation::LoadTimeCache
void LoadTimeCache()
Load the time cache.
Definition: SpiceRotation.cpp:2472
Isis::SpiceRotation::PartialType
PartialType
This enumeration indicates whether the partial derivative is taken with respect to Right Ascension,...
Definition: SpiceRotation.h:258
Isis::SpiceRotation::p_axisP
int p_axisP
The axis defined by the spacecraft vector for defining a nadir rotation.
Definition: SpiceRotation.h:455
Isis::SpiceRotation::ToReferencePartial
std::vector< double > ToReferencePartial(std::vector< double > &lookJ, PartialType partialVar, int coeffIndex)
Compute the derivative with respect to one of the coefficients in the angle polynomial fit equation o...
Definition: SpiceRotation.cpp:2232
Isis::SpiceRotation::ConstantRotation
std::vector< double > ConstantRotation()
Return the constant 3x3 rotation TC matrix as a quaternion.
Definition: SpiceRotation.cpp:2880
Isis::SpiceRotation::m_raPole
std::vector< Angle > m_raPole
Coefficients of a quadratic polynomial fitting pole ra.
Definition: SpiceRotation.h:565
Isis::SpiceRotation::WRT_Declination
@ WRT_Declination
With respect to Declination.
Definition: SpiceRotation.h:260
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
Isis::SpiceRotation::DPolynomial
double DPolynomial(const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
Definition: SpiceRotation.cpp:2137
Isis::SpiceRotation::m_sysNutPrec0
std::vector< Angle > m_sysNutPrec0
Constants of planetary system nut/prec periods.
Definition: SpiceRotation.h:577
Isis::SpiceRotation::UNKNOWN
@ UNKNOWN
Isis specific code for unknown frame type.
Definition: SpiceRotation.h:277
Isis::SpiceRotation::AngularVelocity
std::vector< double > AngularVelocity()
Accessor method to get the angular velocity.
Definition: SpiceRotation.cpp:1365
Isis::SpiceRotation::WRT_Twist
@ WRT_Twist
With respect to Twist or Prime Meridian Rotation.
Definition: SpiceRotation.h:261
Isis::SpiceRotation::SetSource
void SetSource(Source source)
Resets the source of the rotation to the given value.
Definition: SpiceRotation.cpp:2412
Isis::SpiceRotation::PolyFunction
@ PolyFunction
From nth degree polynomial.
Definition: SpiceRotation.h:249
Isis::SpiceRotation::ConstantFrameChain
std::vector< int > ConstantFrameChain()
Accessor method to get the frame chain for the constant part of the rotation (ends in target)
Definition: SpiceRotation.cpp:1376
Isis::SpiceRotation::p_et
double p_et
Current ephemeris time.
Definition: SpiceRotation.h:445
Isis::SpiceRotation::m_centScale
static const double m_centScale
Seconds per Julian century for scaling time in seconds.
Definition: SpiceRotation.h:584
Isis::SpiceRotation::InitConstantRotation
void InitConstantRotation(double et)
Initialize the constant rotation.
Definition: SpiceRotation.cpp:2951
Isis::SpiceRotation::Extrapolate
std::vector< double > Extrapolate(double timeEt)
Extrapolate pointing for a given time assuming a constant angular velocity.
Definition: SpiceRotation.cpp:3136
Isis::SpiceRotation::NOTJ2000PCK
@ NOTJ2000PCK
PCK frame not referenced to J2000.
Definition: SpiceRotation.h:284
Isis::SpiceRotation::WrapAngle
double WrapAngle(double compareAngle, double angle)
Wrap the input angle to keep it within 2pi radians of the angle to compare.
Definition: SpiceRotation.cpp:2315
Isis::SpiceRotation::Nadir
@ Nadir
Nadir pointing.
Definition: SpiceRotation.h:247
Isis::SpiceRotation::Frame
int Frame()
Accessor method that returns the frame code.
Definition: SpiceRotation.cpp:225
Isis::Quaternion
Provide operations for quaternion arithmetic.
Definition: Quaternion.h:36
Isis::SpiceRotation::DPckPolynomial
double DPckPolynomial(PartialType partialVar, const int coeffIndex)
Evaluate the derivative of the fit polynomial defined by the given coefficients with respect to the c...
Definition: SpiceRotation.cpp:2172
Isis::SpiceRotation::m_decPole
std::vector< Angle > m_decPole
Coefficients of a quadratic polynomial fitting pole dec.
Definition: SpiceRotation.h:566
Isis::SpiceRotation::LineCache
Table LineCache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition: SpiceRotation.cpp:832
Isis::SpiceRotation::usePckPolynomial
void usePckPolynomial()
Set the coefficients of a polynomial fit to each of the three planet angles for the time period cover...
Definition: SpiceRotation.cpp:1948
Isis::SpiceRotation::SetOverrideBaseTime
void SetOverrideBaseTime(double baseTime, double timeScale)
Set an override base time to be used with observations on scanners to allow all images in an observat...
Definition: SpiceRotation.cpp:2110
Isis::SpiceRotation::m_pm
std::vector< Angle > m_pm
Coefficients of a quadratic polynomial fitting pole pm.
Definition: SpiceRotation.h:567
Isis::SpiceRotation::getPckPolynomial
void getPckPolynomial(std::vector< Angle > &raCoeff, std::vector< Angle > &decCoeff, std::vector< Angle > &pmCoeff)
Return the coefficients of a polynomial fit to each of the three planet angles.
Definition: SpiceRotation.cpp:2073
Isis::SpiceRotation::p_targetCode
int p_targetCode
For computing Nadir rotation only.
Definition: SpiceRotation.h:459
Isis::SpiceRotation::Done
@ Done
Cache is downsized.
Definition: SpiceRotation.h:269
Isis::SpiceRotation::m_pmNutPrec
std::vector< double > m_pmNutPrec
Coefficients of prime meridian nut/prec terms.
Definition: SpiceRotation.h:574
Isis::SpiceRotation::GetPolynomial
void GetPolynomial(std::vector< double > &abcAng1, std::vector< double > &abcAng2, std::vector< double > &abcAng3)
Return the coefficients of a polynomial fit to each of the three camera angles for the time period co...
Definition: SpiceRotation.cpp:2051
Isis::SpiceRotation::ConstantMatrix
std::vector< double > & ConstantMatrix()
Return the constant 3x3 rotation TC matrix as a vector of length 9.
Definition: SpiceRotation.cpp:2895
Isis::SpiceRotation::p_degreeApplied
bool p_degreeApplied
Flag indicating whether or not a polynomial of degree p_degree has been created and used to fill the ...
Definition: SpiceRotation.h:463
Isis::SpiceRotation::toJ2000Partial
std::vector< double > toJ2000Partial(const std::vector< double > &lookT, PartialType partialVar, int coeffIndex)
Given a direction vector in the reference frame, compute the derivative with respect to one of the co...
Definition: SpiceRotation.cpp:1607
Isis::SpiceRotation::TimeFrameChain
std::vector< int > TimeFrameChain()
Accessor method to get the frame chain for the rotation (begins in J2000).
Definition: SpiceRotation.cpp:1386
Isis::SpiceRotation::m_tOrientationAvailable
bool m_tOrientationAvailable
Target orientation constants are available.
Definition: SpiceRotation.h:450
Isis::SpiceRotation::TimeBias
double TimeBias() const
Accessor method to get current time bias.
Definition: SpiceRotation.cpp:316
Isis::SpiceRotation::Matrix
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
Definition: SpiceRotation.cpp:2865
Isis::SpiceRotation::setEphemerisTimePolyFunction
void setEphemerisTimePolyFunction()
When setting the ephemeris time, updates the rotation according to a polynomial that defines the thre...
Definition: SpiceRotation.cpp:3432
Isis::SpiceRotation::ReloadCache
void ReloadCache()
Cache J2000 rotation over existing cached time range using polynomials.
Definition: SpiceRotation.cpp:741
Isis::SpiceRotation::SetTimeBasedMatrix
void SetTimeBasedMatrix(std::vector< double > timeBasedMatrix)
Set the time-based 3x3 rotation CJ matrix from a vector of length 9.
Definition: SpiceRotation.cpp:2940
Isis::SpiceRotation::loadPCFromSpice
void loadPCFromSpice(int CenterBodyCode)
Initialize planetary orientation constants from Spice PCK.
Definition: SpiceRotation.cpp:991
Isis::SpiceRotation::p_hasAngularVelocity
bool p_hasAngularVelocity
Flag indicating whether the rotation includes angular velocity.
Definition: SpiceRotation.h:481
Isis::SpiceRotation::WRT_RightAscension
@ WRT_RightAscension
With respect to Right Ascension.
Definition: SpiceRotation.h:259
Isis::SpiceRotation::DCJdt
void DCJdt(std::vector< double > &dRJ)
Compute the derivative of the 3x3 rotation matrix CJ with respect to time.
Definition: SpiceRotation.cpp:3027
Isis::SpiceRotation::p_timeScale
double p_timeScale
Time scale used in fit equations.
Definition: SpiceRotation.h:462
Isis::SpiceRotation::GetTimeScale
double GetTimeScale()
Accessor method to get the rotation time scale.
Definition: SpiceRotation.cpp:2433
Isis::SpiceRotation::poleRaNutPrecCoefs
std::vector< double > poleRaNutPrecCoefs()
Return the coefficients used to calculate the target body pole ra nut/prec coefficients.
Definition: SpiceRotation.cpp:1514
Isis::SpiceRotation::SpiceRotation
SpiceRotation(int frameCode)
Construct an empty SpiceRotation class using a valid Naif frame code to set up for getting rotation f...
Definition: SpiceRotation.cpp:58
Isis::SpiceRotation::SetAxes
void SetAxes(int axis1, int axis2, int axis3)
Set the axes of rotation for decomposition of a rotation matrix into 3 angles.
Definition: SpiceRotation.cpp:2450
Isis::SpiceRotation::PolyFunctionOverSpice
@ PolyFunctionOverSpice
Kernels plus nth degree polynomial.
Definition: SpiceRotation.h:250
Isis::SpiceRotation::p_overrideTimeScale
double p_overrideTimeScale
Value set by caller to override computed time scale.
Definition: SpiceRotation.h:470
Isis::SpiceRotation::ReferenceVector
std::vector< double > ReferenceVector(const std::vector< double > &jVec)
Given a direction vector in J2000, return a reference frame direction.
Definition: SpiceRotation.cpp:1700
Isis::SpiceRotation::poleDecNutPrecCoefs
std::vector< double > poleDecNutPrecCoefs()
Return the coefficients used to calculate the target body pole dec nut/prec coefficients.
Definition: SpiceRotation.cpp:1531
Isis::SpiceRotation::Spice
@ Spice
Directly from the kernels.
Definition: SpiceRotation.h:246
Isis::SpiceRotation::SetFrame
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition: SpiceRotation.cpp:214
Isis::SpiceRotation::setPckPolynomial
void setPckPolynomial(const std::vector< Angle > &raCoeff, const std::vector< Angle > &decCoeff, const std::vector< Angle > &pmCoeff)
Set the coefficients of a polynomial fit to each of the three planet angles for the time period cover...
Definition: SpiceRotation.cpp:2028
Isis::SpiceRotation::TimeBasedMatrix
std::vector< double > & TimeBasedMatrix()
Return time-based 3x3 rotation CJ matrix as a vector of length 9.
Definition: SpiceRotation.cpp:2930
Isis::SpiceRotation::pmNutPrecCoefs
std::vector< double > pmNutPrecCoefs()
Return the coefficients used to calculate the target body pm nut/prec coefficients.
Definition: SpiceRotation.cpp:1548
Isis::SpiceRotation::p_fullCacheEndTime
double p_fullCacheEndTime
Initial requested ending time of cache.
Definition: SpiceRotation.h:473
Isis::SpiceRotation::setEphemerisTimeNadir
void setEphemerisTimeNadir()
When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.
Definition: SpiceRotation.cpp:3300
Isis::SpiceRotation::getFrameType
FrameType getFrameType()
Accessor method to get the rotation frame type.
Definition: SpiceRotation.cpp:2392
Isis::SpiceRotation::p_minimizeCache
DownsizeStatus p_minimizeCache
Status of downsizing the cache (set to No to ignore)
Definition: SpiceRotation.h:471
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::SpiceRotation::SetEphemerisTime
void SetEphemerisTime(double et)
Return the J2000 to reference frame quaternion at given time.
Definition: SpiceRotation.cpp:260
Isis::SpiceRotation::PCK
@ PCK
definitions
Definition: SpiceRotation.h:279
Isis::SpiceRotation::p_source
Source p_source
The source of the rotation data.
Definition: SpiceRotation.h:454
Isis::SpiceRotation::setEphemerisTimePckPolyFunction
void setEphemerisTimePckPolyFunction()
When setting the ephemeris time, updates the rotation state based on the PcK polynomial.
Definition: SpiceRotation.cpp:3528
Isis::SpiceRotation
Obtain SPICE rotation information for a body.
Definition: SpiceRotation.h:209
Isis::SpiceRotation::ComputeBaseTime
void ComputeBaseTime()
Compute the base time using cached times.
Definition: SpiceRotation.cpp:2087