Isis 3 Programmer Reference
IsisBody.cpp
1
5
6/* SPDX-License-Identifier: CC0-1.0 */
7#include "IsisBody.h"
8
9#include "SpiceRotation.h"
10
11using namespace std;
12
13namespace Isis {
18 m_rot = rot;
19 }
20
21
22 std::vector<double> IsisBody::rotation(double time) {
23 double oldTime = m_rot->EphemerisTime();
24 bool timeChanged = oldTime != time;
25 if (timeChanged) {
26 m_rot->SetEphemerisTime(time);
27 }
28 vector<double> bodyRotMat = m_rot->Matrix();
29 if (timeChanged) {
30 m_rot->SetEphemerisTime(oldTime);
31 }
32 // ISIS uses Km, so convert to meters
33 for (int i = 0; i < 9; i++ ){
34 bodyRotMat[i] = bodyRotMat[i] * 1000.0;
35 }
36 return bodyRotMat;
37 }
38
39 SensorUtilities::Vec IsisBody::fixedVector(SensorUtilities::Vec pos) {
40 std::vector<double> instPos(pos);
41 std::vector<double> sB = m_rot->ReferenceVector(instPos);
42
43 return {sB[0] * 1000.0, sB[1] * 1000.0, sB[2] * 1000.0};
44 }
45}
IsisBody(SpiceRotation *rot)
Create an IsisBody that wraps a SpiceRotation.
Definition IsisBody.cpp:17
Obtain SPICE rotation information for a body.
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
double EphemerisTime() const
Accessor method to get current ephemeris time.
void SetEphemerisTime(double et)
Return the J2000 to reference frame quaternion at given time.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.