File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis Developer Reference
|
Go to the documentation of this file. 1 #ifndef SpiceRotation_h
2 #define SpiceRotation_h
12 #include <nlohmann/json.hpp>
13 #include <ale/Orientations.h>
292 std::vector<double>
Matrix();
305 std::vector<double>
J2000Vector(
const std::vector<double> &rVec);
332 void LoadCache(
double startTime,
double endTime,
int size);
349 std::vector<double>
Angles(
int axis3,
int axis2,
int axis1);
350 void SetAngles(std::vector<double> angles,
int axis3,
int axis2,
int axis1);
357 const std::vector<double> &abcAng2,
358 const std::vector<double> &abcAng3,
363 const std::vector<Angle> &decCoeff,
364 const std::vector<Angle> &pmCoeff);
367 std::vector<double> &abcAng2,
368 std::vector<double> &abcAng3);
371 std::vector<Angle> &decCoeff,
372 std::vector<Angle> &pmCoeff);
390 std::vector<double>
toJ2000Partial(
const std::vector<double> &lookT,
394 void DCJdt(std::vector<double> &dRJ);
396 double WrapAngle(
double compareAngle,
double angle);
397 void SetAxes(
int axis1,
int axis2,
int axis3);
437 std::vector<int> p_constantFrames;
440 std::vector<int> p_timeFrames;
450 bool m_tOrientationAvailable;
463 bool p_degreeApplied;
466 std::vector<double> p_coefficients[3];
469 double p_overrideBaseTime;
470 double p_overrideTimeScale;
472 double p_fullCacheStartTime;
473 double p_fullCacheEndTime;
475 std::vector<double> p_TC;
478 std::vector<double> p_CJ;
480 std::vector<double> p_av;
481 bool p_hasAngularVelocity;
483 std::vector<double> StateTJ();
565 std::vector<Angle>m_raPole;
566 std::vector<Angle>m_decPole;
567 std::vector<Angle>m_pm ;
572 std::vector<double>m_raNutPrec;
573 std::vector<double>m_decNutPrec;
574 std::vector<double>m_pmNutPrec;
577 std::vector<Angle>m_sysNutPrec0;
578 std::vector<Angle>m_sysNutPrec1;
584 static const double m_centScale;
586 static const double m_dayScale;
double GetBaseTime()
Accessor method to get the rotation base time.
Definition: SpiceRotation.cpp:2423
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
int ck3sdn(double sdntol, bool avflag, int *nrec, double *sclkdp, double *quats, double *avvs, int nints, double *starts, double *dparr, int *intarr)
Definition: ck3sdn.cpp:21
void ComputeAv()
Compute the angular velocity from the time-based functions fit to the pointing angles This method com...
Definition: SpiceRotation.cpp:2982
double EphemerisTime() const
Accessor method to get current ephemeris time.
Definition: SpiceRotation.cpp:306
std::vector< Angle > sysNutPrecConstants()
Return the constants used to calculate the target body system nut/prec angles.
Definition: SpiceRotation.cpp:1565
const double HALFPI
The mathematical constant PI/2.
Definition: Constants.h:41
int moved_(doublereal *arrfrm, integer *ndim, doublereal *arrto)
@ BPC
Isis specific code for binary pck.
Definition: SpiceRotation.h:283
void checkForBinaryPck()
Check loaded pck to see if any are binary and set frame type to indicate binary pck.
Definition: SpiceRotation.cpp:3180
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
ale::Orientations * m_orientation
Definition: SpiceRotation.h:432
int Solve(Isis::LeastSquares::SolveMethod method=SVD)
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
Definition: LeastSquares.cpp:205
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
std::vector< double > ToMatrix()
Converts quaternion to 3x3 rotational matrix.
Definition: Quaternion.cpp:75
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Definition: SpiceRotation.cpp:242
std::vector< Angle > pmCoefs()
Return the coefficients used to calculate the target body prime meridian.
Definition: SpiceRotation.cpp:1496
int p_axis3
Axis of rotation for angle 3 of rotation.
Definition: SpiceRotation.h:431
int invstm_(doublereal *mat, doublereal *invmat)
void CacheLabel(Table &table)
Add labels to a SpiceRotation table.
Definition: SpiceRotation.cpp:1182
std::vector< double > GetFullCacheTime()
Return full listing (cache) of original time coverage requested.
Definition: SpiceRotation.cpp:2708
std::vector< double > EvaluatePolyFunction()
Evaluate the polynomial fit function for the three pointing angles for the current ephemeris time.
Definition: SpiceRotation.cpp:3398
FrameType
Enumeration for the frame type of the rotation.
Definition: SpiceRotation.h:276
static int c__4
Definition: ck3sdn.cpp:13
A single keyword-value pair.
Definition: PvlKeyword.h:82
int p_axis1
Axis of rotation for angle 1 of rotation.
Definition: SpiceRotation.h:429
std::vector< double > p_cacheTime
iTime for corresponding rotation
Definition: SpiceRotation.h:427
double Intercept()
Compute the intercept of the line.
Definition: LineEquation.cpp:87
DownsizeStatus
Status of downsizing the cache.
Definition: SpiceRotation.h:267
int ck3sdn(double sdntol, bool avflag, int *nrec, double *sclkdp, double *quats, double *avvs, int nints, double *starts, double *dparr, int *intarr)
Definition: ck3sdn.cpp:21
void SetCoefficients(const std::vector< double > &coefs)
Set the coefficients for the equation.
Definition: BasisFunction.cpp:42
PvlObject & Label()
The Table's label.
Definition: Table.cpp:260
int qmini(doublereal *init, doublereal *final, doublereal frac, doublereal *qintrp)
Definition: qmini.cpp:23
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
const double DEG2RAD
Multiplier for converting from degrees to radians.
Definition: Constants.h:43
Source
The rotation can come from one of 3 places for an Isis cube.
Definition: SpiceRotation.h:245
void loadPCFromTable(const PvlObject &Label)
Initialize planetary orientation constants from an cube body rotation label.
Definition: SpiceRotation.cpp:1103
std::vector< double > GetCenterAngles()
Return the camera angles at the center time of the observation.
Definition: SpiceRotation.cpp:1290
static doublereal c_b2
Definition: qmini.cpp:18
std::vector< Angle > poleRaCoefs()
Return the coefficients used to calculate the target body pole ra.
Definition: SpiceRotation.cpp:1457
Nth degree Polynomial with one variable.
Definition: PolynomialUnivariate.h:37
int refchg_(integer *frame1, integer *frame2, doublereal *et, doublereal *rotate)
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
int Fields() const
Returns the number of fields that are currently in the record.
Definition: TableRecord.cpp:78
std::vector< double > TimeBasedRotation()
Return time-based 3x3 rotation CJ matrix as a quaternion.
Definition: SpiceRotation.cpp:2915
Source GetSource()
Accessor method to get the rotation source.
Definition: SpiceRotation.cpp:2402
std::vector< Angle > poleDecCoefs()
Return the coefficients used to calculate the target body pole dec.
Definition: SpiceRotation.cpp:1477
Utility class for creating and using cartesean line equations.
Definition: LineEquation.h:29
void FrameTrace(double et)
Compute frame trace chain from target frame to J2000.
Definition: SpiceRotation.cpp:2740
@ CK
Definition: SpiceRotation.h:280
void SetFullCacheParameters(double startTime, double endTime, int cacheSize)
Set the full cache time parameters.
Definition: SpiceRotation.cpp:3165
int frmchg_(integer *frame1, integer *frame2, doublereal *et, doublereal *rotate)
@ PckPolyFunction
Quadratic polynomial function with linear trignometric terms.
Definition: SpiceRotation.h:251
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
void setEphemerisTimeMemcache()
Updates rotation state based on the rotation cache.
Definition: SpiceRotation.cpp:3268
Definition: TableRecord.h:38
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
@ Yes
Downsize the cache.
Definition: SpiceRotation.h:268
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
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
void MinimizeCache(DownsizeStatus status)
Set the downsize status to minimize cache.
Definition: SpiceRotation.cpp:336
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
Table Cache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition: SpiceRotation.cpp:868
std::vector< Angle > sysNutPrecCoefs()
Return the coefficients used to calculate the target body system nut/prec angles.
Definition: SpiceRotation.cpp:1583
void setEphemerisTimeSpice()
When setting the ephemeris time, updates the rotation state based on data read directly from NAIF ker...
Definition: SpiceRotation.cpp:3339
virtual ~SpiceRotation()
Destructor for SpiceRotation object.
Definition: SpiceRotation.cpp:200
int p_axis2
Axis of rotation for angle 2 of rotation.
Definition: SpiceRotation.h:430
#define J2000Code
This is free and unencumbered software released into the public domain.
Definition: SpiceRotation.h:22
void LoadCache(double startTime, double endTime, int size)
Cache J2000 rotation quaternion over a time range.
Definition: SpiceRotation.cpp:359
bool HasAngularVelocity()
Checks whether the rotation has angular velocities.
Definition: SpiceRotation.cpp:1396
int cacheSize()
Definition: SpiceRotation.h:412
@ INERTL
See Naif Frames.req document for.
Definition: SpiceRotation.h:278
@ DYN
Definition: SpiceRotation.h:282
void setEphemerisTimePolyFunctionOverSpice()
When setting the ephemeris time, updates the rotation state based on a polynomial fit over spice kern...
Definition: SpiceRotation.cpp:3482
Generic least square fitting class.
Definition: LeastSquares.h:99
int p_degree
Degree of fit polynomial for angles.
Definition: SpiceRotation.h:428
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
@ Memcache
From cached table.
Definition: SpiceRotation.h:248
@ No
Do not downsize the cache.
Definition: SpiceRotation.h:270
bool IsCached() const
Checks if the cache is empty.
Definition: SpiceRotation.cpp:326
void SetConstantMatrix(std::vector< double > constantMatrix)
Set the constant 3x3 rotation TC matrix from a vector of length 9.
Definition: SpiceRotation.cpp:2905
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
void LoadTimeCache()
Load the time cache.
Definition: SpiceRotation.cpp:2472
PartialType
This enumeration indicates whether the partial derivative is taken with respect to Right Ascension,...
Definition: SpiceRotation.h:258
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
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
std::vector< double > ConstantRotation()
Return the constant 3x3 rotation TC matrix as a quaternion.
Definition: SpiceRotation.cpp:2880
@ Double
The values in the field are 8 byte doubles.
Definition: TableField.h:54
nlohmann::json json
Definition: PvlObject.cpp:22
@ WRT_Declination
With respect to Declination.
Definition: SpiceRotation.h:260
Class for storing Table blobs information.
Definition: Table.h:61
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
@ UNKNOWN
Isis specific code for unknown frame type.
Definition: SpiceRotation.h:277
std::vector< double > AngularVelocity()
Accessor method to get the angular velocity.
Definition: SpiceRotation.cpp:1365
@ WRT_Twist
With respect to Twist or Prime Meridian Rotation.
Definition: SpiceRotation.h:261
void SetSource(Source source)
Resets the source of the rotation to the given value.
Definition: SpiceRotation.cpp:2412
@ PolyFunction
From nth degree polynomial.
Definition: SpiceRotation.h:249
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
void InitConstantRotation(double et)
Initialize the constant rotation.
Definition: SpiceRotation.cpp:2951
Isis exception class.
Definition: IException.h:91
std::vector< double > Extrapolate(double timeEt)
Extrapolate pointing for a given time assuming a constant angular velocity.
Definition: SpiceRotation.cpp:3136
@ NOTJ2000PCK
PCK frame not referenced to J2000.
Definition: SpiceRotation.h:284
Defines an angle and provides unit conversions.
Definition: Angle.h:45
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
@ Nadir
Nadir pointing.
Definition: SpiceRotation.h:247
Obtain SPICE information for a spacecraft.
Definition: Spice.h:283
int Frame()
Accessor method that returns the frame code.
Definition: SpiceRotation.cpp:225
Provide operations for quaternion arithmetic.
Definition: Quaternion.h:36
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
int qmini(double *init, double *final, double frac, double *qintrp)
Table LineCache(const QString &tableName)
Return a table with J2000 to reference rotations.
Definition: SpiceRotation.cpp:832
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
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
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
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Namespace for the standard library.
@ Done
Cache is downsized.
Definition: SpiceRotation.h:269
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
std::vector< double > & ConstantMatrix()
Return the constant 3x3 rotation TC matrix as a vector of length 9.
Definition: SpiceRotation.cpp:2895
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
std::vector< int > TimeFrameChain()
Accessor method to get the frame chain for the rotation (begins in J2000).
Definition: SpiceRotation.cpp:1386
double TimeBias() const
Accessor method to get current time bias.
Definition: SpiceRotation.cpp:316
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
Definition: SpiceRotation.cpp:2865
void setEphemerisTimePolyFunction()
When setting the ephemeris time, updates the rotation according to a polynomial that defines the thre...
Definition: SpiceRotation.cpp:3432
void ReloadCache()
Cache J2000 rotation over existing cached time range using polynomials.
Definition: SpiceRotation.cpp:741
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
void SetTimeBasedMatrix(std::vector< double > timeBasedMatrix)
Set the time-based 3x3 rotation CJ matrix from a vector of length 9.
Definition: SpiceRotation.cpp:2940
void loadPCFromSpice(int CenterBodyCode)
Initialize planetary orientation constants from Spice PCK.
Definition: SpiceRotation.cpp:991
@ WRT_RightAscension
With respect to Right Ascension.
Definition: SpiceRotation.h:259
void DCJdt(std::vector< double > &dRJ)
Compute the derivative of the 3x3 rotation matrix CJ with respect to time.
Definition: SpiceRotation.cpp:3027
double GetTimeScale()
Accessor method to get the rotation time scale.
Definition: SpiceRotation.cpp:2433
std::vector< double > poleRaNutPrecCoefs()
Return the coefficients used to calculate the target body pole ra nut/prec coefficients.
Definition: SpiceRotation.cpp:1514
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
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
void SetCacheTime(std::vector< double > cacheTime)
Definition: SpiceRotation.cpp:2117
static doublereal c_b3
Definition: qmini.cpp:19
@ TK
Definition: SpiceRotation.h:281
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Definition: PvlObject.cpp:177
@ PolyFunctionOverSpice
Kernels plus nth degree polynomial.
Definition: SpiceRotation.h:250
Adds specific functionality to C++ strings.
Definition: IString.h:165
double Slope()
Compute the slope of the line.
Definition: LineEquation.cpp:66
void AddKnown(const std::vector< double > &input, double expected, double weight=1.0)
Invoke this method for each set of knowns.
Definition: LeastSquares.cpp:96
std::vector< double > ReferenceVector(const std::vector< double > &jVec)
Given a direction vector in J2000, return a reference frame direction.
Definition: SpiceRotation.cpp:1700
int Records() const
Returns the number of records.
Definition: Table.cpp:313
std::vector< double > poleDecNutPrecCoefs()
Return the coefficients used to calculate the target body pole dec nut/prec coefficients.
Definition: SpiceRotation.cpp:1531
nlohmann::json json
This is free and unencumbered software released into the public domain.
Definition: SpiceRotation.cpp:33
@ Spice
Directly from the kernels.
Definition: SpiceRotation.h:246
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition: SpiceRotation.cpp:214
double Evaluate(const std::vector< double > &vars)
Compute the equation using the input variables.
Definition: BasisFunction.cpp:64
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
std::vector< double > & TimeBasedMatrix()
Return time-based 3x3 rotation CJ matrix as a vector of length 9.
Definition: SpiceRotation.cpp:2930
std::vector< double > pmNutPrecCoefs()
Return the coefficients used to calculate the target body pm nut/prec coefficients.
Definition: SpiceRotation.cpp:1548
void setEphemerisTimeNadir()
When setting the ephemeris time, uses spacecraft nadir source to update the rotation state.
Definition: SpiceRotation.cpp:3300
FrameType getFrameType()
Accessor method to get the rotation frame type.
Definition: SpiceRotation.cpp:2392
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
Definition: Angle.h:63
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
int Coefficients() const
Returns the number of coefficients for the equation.
Definition: BasisFunction.h:64
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
void SetEphemerisTime(double et)
Return the J2000 to reference frame quaternion at given time.
Definition: SpiceRotation.cpp:260
@ PCK
definitions
Definition: SpiceRotation.h:279
double Coefficient(int i) const
Returns the ith coefficient.
Definition: BasisFunction.h:107
void setEphemerisTimePckPolyFunction()
When setting the ephemeris time, updates the rotation state based on the PcK polynomial.
Definition: SpiceRotation.cpp:3528
Obtain SPICE rotation information for a body.
Definition: SpiceRotation.h:209
Class for storing an Isis::Table's field information.
Definition: TableField.h:47
void ComputeBaseTime()
Compute the base time using cached times.
Definition: SpiceRotation.cpp:2087
double radians() const
Convert an angle to a double.
Definition: Angle.h:226