15#include <getSpkAbCorrState.hpp>
19#include <nlohmann/json.hpp>
20using json = nlohmann::json;
25#include "EllipsoidShape.h"
26#include "EndianSwapper.h"
28#include "IException.h"
32#include "LightTimeCorrectionState.h"
33#include "NaifStatus.h"
34#include "ShapeModel.h"
35#include "SpacecraftPosition.h"
66 Pvl &lab = *cube.
label();
67 if (cube.
hasBlob(
"CSMState",
"String")) {
71 PvlGroup kernels = lab.findGroup(
"Kernels", Pvl::Traverse);
75 bool hasTables = (kernels[
"TargetPosition"][0] ==
"Table");
76 m_usingNaif = !lab.hasObject(
"NaifKeywords") || !hasTables;
81 std::ostringstream kernel_pvl;
82 kernel_pvl << kernels;
85 if (kernels[
"InstrumentPointing"][0].toUpper() ==
"NADIR") {
86 props[
"nadir"] =
true;
89 props[
"kernels"] = kernel_pvl.str();
91 json isd = ale::load(lab.fileName().toStdString(), props.dump(),
"ale",
false,
false,
true);
95 isdInit(cube, lab, isd);
98 init(cube, lab, !hasTables);
102 init(cube, lab, !hasTables);
121 isdInit(cube, lab, isd);
124 void Spice::isdInit(
Cube &cube, Pvl &lab, nlohmann::json isd) {
139 PvlGroup kernels = lab.findGroup(
"Kernels", Pvl::Traverse);
142 if (kernels.hasKeyword(
"StartPadding")) {
149 if (kernels.hasKeyword(
"EndPadding")) {
157 json aleNaifKeywords = isd[
"naif_keywords"];
161 load(kernels[
"LeapSecond"],
true);
162 if ( kernels.hasKeyword(
"SpacecraftClock")) {
163 load(kernels[
"SpacecraftClock"],
true);
166 catch(IException &e) {
167 QString msg =
"Failed to read naif_keywords from ISD";
168 throw IException(e, IException::Programmer, msg, _FILEINFO_);
182 if (
m_target->name().toUpper() ==
"SATURN" &&
m_target->shape()->name().toUpper() ==
"PLANE") {
183 PvlKeyword ringPck = PvlKeyword(
"RingPCK",
"$cassini/kernels/pck/saturnRings_v001.tpc");
202 QString trykey =
"NaifIkCode";
203 if (kernels.hasKeyword(
"NaifFrameCode")) trykey =
"NaifFrameCode";
204 *
m_ikCode = toInt(kernels[trykey][0]);
215 QVariant result =
m_target->naifBodyCode();
217 std::vector<Distance>
radii(3,Distance());
228 if (kernels.hasKeyword(
"NaifSpkCode")) {
229 *
m_spkCode = (int) kernels[
"NaifSpkCode"];
232 if (kernels.hasKeyword(
"NaifCkCode")) {
233 *
m_ckCode = (int) kernels[
"NaifCkCode"];
236 if (kernels.hasKeyword(
"NaifSclkCode")) {
241 if (kernels.hasKeyword(
"NaifSpkBodyCode")) {
256 catch(IException &e) {
257 QString msg =
"Unable to read BODY_FRAME_CODE from naifkeywords group";
258 throw IException(IException::Io, msg, _FILEINFO_);
269 LightTimeCorrectionState ltState(*
m_ikCode,
this);
270 ltState.checkSpkKernelsForAberrationCorrection();
272 vector<Distance> radius =
m_target->radii();
273 Distance targetRadius((radius[0] + radius[2])/2.0);
275 ltState, targetRadius);
280 if (kernels[
"TargetPosition"][0].toUpper() ==
"TABLE" &&
285 Table t2 = cube.
readTable(
"BodyRotation");
287 if (t2.Label().hasKeyword(
"SolarLongitude")) {
309 if (kernels[
"InstrumentPointing"].size() == 0) {
310 throw IException(IException::Unknown,
311 "No camera pointing available",
315 if (kernels[
"InstrumentPointing"][0].toUpper() ==
"TABLE" &&
316 cube.
hasTable(
"InstrumentPointing")) {
317 Table t = cube.
readTable(
"InstrumentPointing");
333 if (kernels[
"InstrumentPosition"].size() == 0) {
334 throw IException(IException::Unknown,
335 "No instrument position available",
339 if (kernels[
"InstrumentPosition"][0].toUpper() ==
"TABLE" &&
340 cube.
hasTable(
"InstrumentPosition")) {
341 Table t = cube.
readTable(
"InstrumentPosition");
434 PvlGroup kernels = lab.findGroup(
"Kernels", Pvl::Traverse);
437 if (kernels.hasKeyword(
"StartPadding")) {
444 if (kernels.hasKeyword(
"EndPadding")) {
457 load(kernels[
"TargetPosition"], noTables);
458 load(kernels[
"InstrumentPosition"], noTables);
459 load(kernels[
"InstrumentPointing"], noTables);
462 if (kernels.hasKeyword(
"Frame")) {
463 load(kernels[
"Frame"], noTables);
466 load(kernels[
"TargetAttitudeShape"], noTables);
467 if (kernels.hasKeyword(
"Instrument")) {
468 load(kernels[
"Instrument"], noTables);
471 if (kernels.hasKeyword(
"InstrumentAddendum")) {
472 load(kernels[
"InstrumentAddendum"], noTables);
476 load(kernels[
"LeapSecond"], noTables);
477 if ( kernels.hasKeyword(
"SpacecraftClock")) {
478 load(kernels[
"SpacecraftClock"], noTables);
483 if (kernels.hasKeyword(
"Extra")) {
484 load(kernels[
"Extra"], noTables);
498 if (
m_target->name().toUpper() ==
"SATURN" &&
m_target->shape()->name().toUpper() ==
"PLANE") {
499 PvlKeyword ringPck = PvlKeyword(
"RingPCK",
"$cassini/kernels/pck/saturnRings_v001.tpc");
500 load(ringPck, noTables);
529 QString trykey =
"NaifIkCode";
530 if (kernels.hasKeyword(
"NaifFrameCode")) trykey =
"NaifFrameCode";
531 *
m_ikCode = toInt(kernels[trykey][0]);
542 QVariant result =
m_target->naifBodyCode();
555 if (kernels.hasKeyword(
"NaifSpkCode")) {
556 *
m_spkCode = (int) kernels[
"NaifSpkCode"];
559 if (kernels.hasKeyword(
"NaifCkCode")) {
560 *
m_ckCode = (int) kernels[
"NaifCkCode"];
563 if (kernels.hasKeyword(
"NaifSclkCode")) {
568 if (kernels.hasKeyword(
"NaifSpkBodyCode")) {
584 cidfrm_c(*
m_spkBodyCode,
sizeof(frameName), &frameCode, frameName, &found);
587 QString naifTarget =
"IAU_" +
m_target->name().toUpper();
588 namfrm_c(naifTarget.toLatin1().data(), &frameCode);
589 if (frameCode == 0) {
590 QString msg =
"Can not find NAIF BODY_FRAME_CODE for target ["
592 throw IException(IException::Io, msg, _FILEINFO_);
596 QVariant result = (int)frameCode;
603 catch(IException &e) {
604 QString msg =
"Unable to read BODY_FRAME_CODE from naifkeywords group";
605 throw IException(IException::Io, msg, _FILEINFO_);
620 vector<Distance> radius =
m_target->radii();
621 Distance targetRadius((radius[0] + radius[2])/2.0);
623 ltState, targetRadius);
630 if (kernels[
"TargetPosition"][0].toUpper() ==
"TABLE") {
634 Table t2 = cube.
readTable(
"BodyRotation");
636 if (t2.Label().hasKeyword(
"SolarLongitude")) {
651 if (kernels[
"InstrumentPointing"].size() == 0) {
652 throw IException(IException::Unknown,
653 "No camera pointing available",
659 if (kernels[
"InstrumentPointing"][0].toUpper() ==
"NADIR") {
667 else if (kernels[
"InstrumentPointing"][0].toUpper() ==
"TABLE") {
668 Table t = cube.
readTable(
"InstrumentPointing");
673 if (kernels[
"InstrumentPosition"].size() == 0) {
674 throw IException(IException::Unknown,
675 "No instrument position available",
679 if (kernels[
"InstrumentPosition"][0].toUpper() ==
"TABLE") {
680 Table t = cube.
readTable(
"InstrumentPosition");
699 for (
int i = 0; i < key.size(); i++) {
700 if (key[i] ==
"")
continue;
701 if (key[i].toUpper() ==
"NULL")
break;
702 if (key[i].toUpper() ==
"NADIR")
break;
703 if (key[i].toUpper() ==
"TABLE" && !noTables)
break;
704 if (key[i].toUpper() ==
"TABLE" && noTables)
continue;
705 FileName file(key[i]);
706 if (!file.fileExists()) {
707 QString msg =
"Spice file does not exist [" + file.expanded() +
"]";
708 throw IException(IException::Io, msg, _FILEINFO_);
710 QString fileName = file.expanded();
711 SpiceQL::load(fileName.toLatin1().data());
817 QString fileName = file.expanded();
818 unload_c(fileName.toLatin1().data());
860 int cacheSize,
double tol) {
864 if (cacheSize <= 0) {
865 QString msg =
"Argument cacheSize must be greater than zero";
866 throw IException(IException::Programmer, msg, _FILEINFO_);
869 if (startTime > endTime) {
870 QString msg =
"Argument startTime must be less than or equal to endTime";
871 throw IException(IException::Programmer, msg, _FILEINFO_);
875 QString msg =
"A cache has already been created";
876 throw IException(IException::Programmer, msg, _FILEINFO_);
880 QString msg =
"This instrument does not support time padding";
881 throw IException(IException::User, msg, _FILEINFO_);
885 if (getSpkAbCorrState(abcorr)) {
889 iTime avgTime((startTime.
Et() + endTime.
Et()) / 2.0);
894 int bodyRotationCacheSize = cacheSize;
895 if (cacheSize > 2) bodyRotationCacheSize = 2;
899 bodyRotationCacheSize);
919 if (aleCacheSize > 3) {
926 int sunPositionCacheSize = cacheSize;
927 if (cacheSize > 2) sunPositionCacheSize = 2;
931 sunPositionCacheSize);
941 for (
int i = 0; i <
m_kernels->size(); i++) {
943 QString fileName = file.expanded();
944 unload_c(fileName.toLatin1().data());
1009 && getSpkAbCorrState(abcorr)) {
1054 QString msg =
"Unable to retrieve instrument's body fixed position."
1055 " Spice::SetTime must be called first.";
1056 throw IException(IException::Programmer, msg, _FILEINFO_);
1072 QString msg =
"Unable to retrieve instrument's body fixed velocity."
1073 " Spice::SetTime must be called first.";
1074 throw IException(IException::Programmer, msg, _FILEINFO_);
1077 std::vector<double> state;
1103 QString msg =
"Unable to retrieve the time."
1104 " Spice::SetTime must be called first.";
1105 throw IException(IException::Programmer, msg, _FILEINFO_);
1121 QString msg =
"Unable to retrieve sun's position."
1122 " Spice::SetTime must be called first.";
1123 throw IException(IException::Programmer, msg, _FILEINFO_);
1137 return sqrt(pow(sB[0], 2) + pow(sB[1], 2) + pow(sB[2], 2));
1148 for (
int i = 0; i < 3; i++)
1159 return (
int)
m_target->naifBodyCode();
1271 if (sclkCode == -1) {
1277 QString key =
"CLOCK_ET_" +
Isis::toString(sclkCode) +
"_" + clockValue;
1280 if (storedClockTime.isNull()) {
1281 SpiceDouble timeOutput;
1284 sct2e_c(sclkCode, (SpiceDouble) clockValue.toDouble(), &timeOutput);
1287 scs2e_c(sclkCode, clockValue.toLatin1().data(), &timeOutput);
1290 storedClockTime = timeOutput;
1294 result = storedClockTime.toDouble();
1317 SpiceBoolean found =
false;
1321 SpiceInt numValuesRead;
1324 SpiceDouble kernelValue;
1325 gdpool_c(key.toLatin1().data(), (SpiceInt)index, 1,
1326 &numValuesRead, &kernelValue, &found);
1328 if (found && numValuesRead > 0)
1329 result = kernelValue;
1332 char kernelValue[512];
1333 gcpool_c(key.toLatin1().data(), (SpiceInt)index, 1,
sizeof(kernelValue),
1334 &numValuesRead, kernelValue, &found);
1336 if (found && numValuesRead > 0)
1337 result = QString(kernelValue);
1340 SpiceInt kernelValue;
1341 gipool_c(key.toLatin1().data(), (SpiceInt)index, 1, &numValuesRead,
1342 &kernelValue, &found);
1344 if (found && numValuesRead > 0)
1345 result = (int)kernelValue;
1349 QString msg =
"Can not find [" + key +
"] in text kernels";
1350 throw IException(IException::Io, msg, _FILEINFO_);
1352 else if (numValuesRead == 0){
1353 QString msg =
"Found " + key +
"] in text kernels, but no values were identified and read.";
1354 throw IException(IException::Io, msg, _FILEINFO_);
1357 storeValue(key, index, type, result);
1362 result = readStoredValue(key, type, index);
1364 if (result.isNull()) {
1365 QString msg =
"The camera is requesting spice data [" + key +
"] that "
1366 "was not attached, please re-run spiceinit";
1367 throw IException(IException::Unknown, msg, _FILEINFO_);
1375 void Spice::storeResult(QString name, SpiceValueType type, QVariant value) {
1379 double doubleVal = value.toDouble();
1380 doubleVal = swapper.Double(&doubleVal);
1381 QByteArray byteCode((
char *) &doubleVal,
sizeof(
double));
1386 storeValue(name +
"_COMPUTED", 0, type, value);
1390 QVariant Spice::getStoredResult(QString name, SpiceValueType type) {
1391 bool wasDouble =
false;
1398 QVariant stored = readStoredValue(name +
"_COMPUTED", type, 0);
1400 if (wasDouble && !stored.isNull()) {
1401 EndianSwapper swapper(
"LSB");
1402 double doubleVal = swapper.Double((
void *)QByteArray::fromHex(
1403 stored.toByteArray()).data());
1411 void Spice::storeValue(QString key,
int index, SpiceValueType type,
1419 while(index >= storedKey.size()) {
1420 storedKey.addValue(
"");
1424 storedKey[index] = QString(value.toByteArray().toHex().data());
1427 storedKey[index] = value.toString();
1430 storedKey[index] =
toString(value.toDouble());
1433 storedKey[index] =
toString(value.toInt());
1436 QString msg =
"Unable to store variant in labels for key [" + key +
"]";
1437 throw IException(IException::Unknown, msg, _FILEINFO_);
1442 QVariant Spice::readStoredValue(QString key, SpiceValueType type,
1452 result = toDouble(storedKeyword[index]);
1455 result = storedKeyword[index];
1458 result = storedKeyword[index].toLatin1();
1461 result = toInt(storedKeyword[index]);
1464 catch(IException &e) {
1504 QString msg =
"Unable to retrieve subspacecraft position."
1505 " Spice::SetTime must be called first.";
1506 throw IException(IException::Programmer, msg, _FILEINFO_);
1509 SpiceDouble usB[3], dist;
1515 unorm_c(sB, usB, &dist);
1518 SpiceDouble a =
radii[0].kilometers();
1519 SpiceDouble b =
radii[1].kilometers();
1520 SpiceDouble c =
radii[2].kilometers();
1522 SpiceDouble originB[3];
1523 originB[0] = originB[1] = originB[2] = 0.0;
1526 SpiceDouble subB[3];
1528 surfpt_c(originB, usB, a, b, c, subB, &found);
1530 SpiceDouble mylon, mylat;
1531 reclat_c(subB, &a, &mylon, &mylat);
1532 lat = mylat * 180.0 / PI;
1533 lon = mylon * 180.0 / PI;
1534 if (lon < 0.0) lon += 360.0;
1555 QString msg =
"Unable to retrieve subsolar point."
1556 " Spice::SetTime must be called first.";
1557 throw IException(IException::Programmer, msg, _FILEINFO_);
1560 SpiceDouble uuB[3], dist;
1561 unorm_c(
m_uB, uuB, &dist);
1564 SpiceDouble a =
radii[0].kilometers();
1565 SpiceDouble b =
radii[1].kilometers();
1566 SpiceDouble c =
radii[2].kilometers();
1568 SpiceDouble originB[3];
1569 originB[0] = originB[1] = originB[2] = 0.0;
1572 SpiceDouble subB[3];
1573 surfpt_c(originB, uuB, a, b, c, subB, &found);
1575 SpiceDouble mylon, mylat;
1576 reclat_c(subB, &a, &mylon, &mylat);
1578 lat = mylat * 180.0 / PI;
1579 lon = mylon * 180.0 / PI;
1580 if (lon < 0.0) lon += 360.0;
1605 double Spice::sunToBodyDist()
const {
1609 double sunPosFromTarget[3];
1612 return vnorm_c(sunPosFromTarget);
1640 ucrss_c(&sunPos[0], &sunVel[0], sunAv);
1643 for (
int i = 0; i < 3; i++) {
1644 npole[i] = bodyRotMat[6+i];
1647 double x[3], y[3], z[3];
1649 ucrss_c(npole, z, x);
1653 for (
int i = 0; i < 3; i++) {
1660 mxv_c(trans, &sunPos[0], pos);
1662 double radius, ls, lat;
1663 reclat_c(pos, &radius, &ls, &lat);
1675 double tipm[3][3], npole[3];
1680 cidfrm_c(*
m_spkBodyCode,
sizeof(frameName), &frameCode, frameName, &found);
1683 pxform_c(
"J2000", frameName, et.
Et(), tipm);
1689 for (
int i = 0; i < 3; i++) {
1690 npole[i] = tipm[2][i];
1693 double state[6], lt;
1697 ucrss_c(state, &state[3], uavel);
1699 double x[3], y[3], z[3];
1701 ucrss_c(npole, z, x);
1705 for (
int i = 0; i < 3; i++) {
1714 mxv_c(trans, state, pos);
1716 double radius, ls, lat;
1717 reclat_c(pos, &radius, &ls, &lat);
1751 PvlGroup kernels = lab.findGroup(
"Kernels", Pvl::Traverse);
1752 std::vector<string> keywords;
1753 keywords.push_back(
"TargetPosition");
1755 if (kernels.hasKeyword(
"SpacecraftPosition")) {
1756 keywords.push_back(
"SpacecraftPosition");
1759 keywords.push_back(
"InstrumentPosition");
1762 if (kernels.hasKeyword(
"SpacecraftPointing")) {
1763 keywords.push_back(
"SpacecraftPointing");
1766 keywords.push_back(
"InstrumentPointing");
1769 if (kernels.hasKeyword(
"Frame")) {
1770 keywords.push_back(
"Frame");
1773 if (kernels.hasKeyword(
"Extra")) {
1774 keywords.push_back(
"Extra");
1778 for (
int ikey = 0; ikey < (int) keywords.size(); ikey++) {
1779 key = kernels[ikey];
1781 for (
int i = 0; i < key.size(); i++) {
1782 if (key[i] ==
"")
return false;
1783 if (key[i].toUpper() ==
"NULL")
return false;
1784 if (key[i].toUpper() ==
"NADIR")
return false;
1785 if (key[i].toUpper() ==
"TABLE")
return false;
1800 return !(
m_et == NULL);
1848 bool Spice::isUsingAle(){
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
IO Handler for Isis Cubes.
bool hasTable(const QString &name)
Check to see if the cube contains a pvl table by the provided name.
bool hasBlob(const QString &name, const QString &type)
Check to see if the cube contains a BLOB.
Table readTable(const QString &name)
Read a Table from the cube.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Distance measurement, usually in meters.
@ Kilometers
The distance is being specified in kilometers.
Provides interface to user configurable Light Time correction feature.
bool checkSpkKernelsForAberrationCorrection()
Check for light time/stellar aberration tag in SPK comments.
This class is designed to encapsulate the concept of a Longitude.
Longitude force360Domain() const
This returns a longitude that is constricted to 0-360 degrees.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Provides swap observer/target and improved light time correction.
virtual void setTime(const iTime &time)
Sets the ephemeris time and reads the spacecraft and sun position from the kernels at that instant in...
void init(Cube &cube, Pvl &pvl, bool noTables)
Initialization of Spice object.
QString getString(const QString &key, int index=0)
This returns a value from the NAIF text pool.
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
SpiceDouble * m_startTimePadding
Kernels pvl group StartPadding keyword value.
Target * m_target
Target of the observation.
bool m_usingNaif
Indicates whether we are reading values from the NaifKeywords PvlObject in cube.
QVariant readValue(QString key, SpiceValueType type, int index=0)
This should be used for reading ALL text naif kernel values.
Longitude * m_solarLongitude
Body rotation solar longitude value.
bool m_usingAle
Indicate whether we are reading values from an ISD returned from ALE.
virtual Longitude solarLongitude()
Returns the solar longitude.
Spice(Cube &cube)
Constructs a Spice object and loads SPICE kernels using information from the label object.
SpiceInt * m_ikCode
Instrument kernel (IK) code.
virtual void instrumentBodyFixedVelocity(double v[3]) const
Returns the spacecraft velocity in body-fixed frame km/sec units.
SpiceRotation * m_instrumentRotation
Instrument spice rotation.
SpiceInt * m_sclkCode
Spacecraft clock correlation kernel (SCLK) code.
void csmInit(Cube &cube, Pvl label)
Initialize the Spice object for a CSMCamera.
virtual void computeSolarLongitude(iTime et)
Computes the solar longitude for the given ephemeris time.
SpicePosition * m_instrumentPosition
Instrument spice position.
bool m_allowDownsizing
Indicates whether to allow downsizing.
SpiceDouble * m_endTimePadding
Kernels pvl group EndPadding keyword value.
SpicePosition * m_sunPosition
Sun spice position.
SpiceInt * m_bodyFrameCode
Naif's BODY_FRAME_CODE value.
virtual SpiceRotation * bodyRotation() const
Accessor method for the body rotation.
virtual double targetCenterDistance() const
Calculates and returns the distance from the spacecraft to the target center.
virtual void subSolarPoint(double &lat, double &lon)
Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east,...
virtual void createCache(iTime startTime, iTime endTime, const int size, double tol)
This method creates an internal cache of spacecraft and sun positions over a specified time range.
virtual iTime cacheEndTime() const
Accessor method for the cache end time.
virtual ~Spice()
Destroys the Spice object.
void radii(Distance r[3]) const
Returns the radii of the body in km.
SpiceValueType
NAIF value primitive type.
@ SpiceByteCodeType
SpiceByteCode type.
@ SpiceIntType
SpiceInt type.
@ SpiceStringType
SpiceString type.
@ SpiceDoubleType
SpiceDouble type.
PvlObject * m_naifKeywords
NaifKeywords PvlObject from cube.
SpiceInt naifBodyCode() const
This returns the NAIF body code of the target indicated in the labels.
SpiceInt naifSpkCode() const
This returns the NAIF SPK code to use when reading from SPK kernels.
virtual void instrumentBodyFixedPosition(double p[3]) const
Returns the spacecraft position in body-fixed frame km units.
PvlObject getStoredNaifKeywords() const
This returns the PvlObject that stores all of the requested Naif data and can be a replacement for fu...
SpiceInt naifCkCode() const
This returns the NAIF CK code to use when reading from CK kernels.
virtual Target * target() const
Returns a pointer to the target object.
SpiceInt * m_spkBodyCode
Spacecraft and planet ephemeris kernel (SPK) body code.
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
SpiceInt * m_ckCode
Camera kernel (CK) code.
SpiceInt * m_spkCode
Spacecraft and planet ephemeris kernel (SPK) code.
bool hasKernels(Pvl &lab)
Returns true if the kernel group has kernel files.
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
SpiceDouble * m_cacheSize
Cache size. Note: This value is 1 for Framing cameras.
void defaultInit()
Default initialize the members of the SPICE object.
virtual SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
SpiceInt naifSclkCode() const
This returns the NAIF SCLK code to use when reading from instrument kernels.
QString targetName() const
Returns the QString name of the target.
SpiceInt naifBodyFrameCode() const
This returns the NAIF body frame code.
void load(PvlKeyword &key, bool notab)
Loads/furnishes NAIF kernel(s)
SpiceDouble m_uB[3]
This contains the sun position (u) in the bodyfixed reference frame (B).
virtual iTime cacheStartTime() const
Accessor method for the cache start time.
iTime * m_endTime
Corrected end (shutter close) time of the observation.
iTime * m_et
Ephemeris time (read NAIF documentation for a detailed description)
bool isTimeSet()
Returns true if time has been initialized.
QVector< QString > * m_kernels
Vector containing kernels filenames.
SpiceRotation * m_bodyRotation
Body spice rotation.
iTime * m_startTime
Corrected start (shutter open) time of the observation.
virtual SpicePosition * sunPosition() const
Accessor method for the sun position.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
SpiceInt getInteger(const QString &key, int index=0)
This returns a value from the NAIF text pool.
virtual void subSpacecraftPoint(double &lat, double &lon)
Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east,...
virtual double resolution()
Virtual method that returns the pixel resolution of the sensor in meters/pix.
Obtain SPICE position information for a body.
@ Memcache
Object is reading from cached table.
virtual const std::vector< double > & Coordinate()
Return the current J2000 position.
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Obtain SPICE rotation information for a body.
std::vector< double > Matrix()
Return the full rotation TJ as a matrix.
@ Done
Cache is downsized.
@ Memcache
From cached table.
This class is used to create and store valid Isis targets.
std::vector< Distance > radii() const
Returns the radii of the body in km.
Parse and return pieces of a time string.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
This is free and unencumbered software released into the public domain.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.