|
| Spice (Cube &cube) |
| Constructs a Spice object and loads SPICE kernels using information from the label object. More...
|
|
| Spice (Pvl &lab, nlohmann::json) |
| Constructs a Spice Object. More...
|
|
virtual | ~Spice () |
| Destroys the Spice object. More...
|
|
virtual void | setTime (const iTime &time) |
| Sets the ephemeris time and reads the spacecraft and sun position from the kernels at that instant in time. More...
|
|
void | instrumentPosition (double p[3]) const |
| Returns the spacecraft position in body-fixed frame km units. More...
|
|
virtual void | instrumentBodyFixedPosition (double p[3]) const |
| Returns the spacecraft position in body-fixed frame km units. More...
|
|
virtual void | sunPosition (double p[3]) const |
| Fills the input vector with sun position information, in either body-fixed or J2000 reference frame and km units. More...
|
|
virtual double | targetCenterDistance () const |
| Calculates and returns the distance from the spacecraft to the target center. More...
|
|
virtual double | sunToBodyDist () const |
|
virtual Longitude | solarLongitude () |
| Returns the solar longitude. More...
|
|
virtual void | instrumentBodyFixedVelocity (double v[3]) const |
| Returns the spacecraft velocity in body-fixed frame km/sec units. More...
|
|
iTime | time () const |
| Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions. More...
|
|
void | radii (Distance r[3]) const |
| Returns the radii of the body in km. More...
|
|
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. More...
|
|
virtual iTime | cacheStartTime () const |
| Accessor method for the cache start time. More...
|
|
virtual iTime | cacheEndTime () const |
| Accessor method for the cache end time. More...
|
|
virtual void | subSpacecraftPoint (double &lat, double &lon) |
| Returns the sub-spacecraft latitude/longitude in universal coordinates (0-360 positive east, ocentric) More...
|
|
virtual void | subSolarPoint (double &lat, double &lon) |
| Returns the sub-solar latitude/longitude in universal coordinates (0-360 positive east, ocentric) More...
|
|
virtual Target * | target () const |
| Returns a pointer to the target object. More...
|
|
QString | targetName () const |
| Returns the QString name of the target. More...
|
|
virtual iTime | getClockTime (QString clockValue, int sclkCode=-1, bool clockTicks=false) |
| This converts the spacecraft clock ticks value (clockValue) to an iTime. More...
|
|
SpiceDouble | getDouble (const QString &key, int index=0) |
| This returns a value from the NAIF text pool. More...
|
|
SpiceInt | getInteger (const QString &key, int index=0) |
| This returns a value from the NAIF text pool. More...
|
|
QString | getString (const QString &key, int index=0) |
| This returns a value from the NAIF text pool. More...
|
|
virtual SpicePosition * | sunPosition () const |
| Accessor method for the sun position. More...
|
|
virtual SpicePosition * | instrumentPosition () const |
| Accessor method for the instrument position. More...
|
|
virtual SpiceRotation * | bodyRotation () const |
| Accessor method for the body rotation. More...
|
|
virtual SpiceRotation * | instrumentRotation () const |
| Accessor method for the instrument rotation. More...
|
|
bool | isUsingAle () |
|
bool | hasKernels (Pvl &lab) |
| Returns true if the kernel group has kernel files. More...
|
|
bool | isTimeSet () |
| Returns true if time has been initialized. More...
|
|
SpiceInt | naifBodyCode () const |
| This returns the NAIF body code of the target indicated in the labels. More...
|
|
SpiceInt | naifSpkCode () const |
| This returns the NAIF SPK code to use when reading from SPK kernels. More...
|
|
SpiceInt | naifCkCode () const |
| This returns the NAIF CK code to use when reading from CK kernels. More...
|
|
SpiceInt | naifIkCode () const |
| This returns the NAIF IK code to use when reading from instrument kernels. More...
|
|
SpiceInt | naifSclkCode () const |
| This returns the NAIF SCLK code to use when reading from instrument kernels. More...
|
|
SpiceInt | naifBodyFrameCode () const |
| This returns the NAIF body frame code. More...
|
|
PvlObject | getStoredNaifKeywords () const |
| This returns the PvlObject that stores all of the requested Naif data and can be a replacement for furnishing text kernels. More...
|
|
virtual double | resolution () |
| Virtual method that returns the pixel resolution of the sensor in meters/pix. More...
|
|
Obtain SPICE information for a spacecraft.
This class initializes standard NAIF SPICE kernels in order to allow queries of a spacecraft's position and attitude at a given time. It also allows for access to the position of the sun and transformation matrices from J2000 to a body-fixed reference frame for a given target (e.g., Mars). The constructor for this class expects a PVL object with the following minimum information:
Group = Instrument
TargetName = Mars
EndGroup
Group = Kernels
NaifFrameCode = -94030
LeapSecond = naif0007.tls
TargetAttitudeShape = pck00006.tpc
TargetPosition = de405.bsp
InstrumentPointing = (mgs_sc_ab1.bc,
Instrument = moc13.ti
SpacecraftClock = MGS_SCLKSCET.00045.tsc
InstrumentPosition = mgs_ab1.bsp
InstrumentAddendum = mocAddendum.ti
EndGroup
This group is typically found in the image labels after it has been run through the program "spiceinit" It is recommended you read NAIF documentation to obtain a better understanding about the various types of SPICE kernels. The NAIF toolkit accesses information from kernels on a last-in-first-out (LIFO) basis. This means that the creation of a second object can cause problems with the first object. To alleviate this problem we have supplied the CreateCache method which should be invoked immediately after the object is constructed. This caches information (spacecraft position, pointing, etc) internally in the object and unloads all NAIF kernels.
- Author
- 2003-03-13 Jeff Anderson
- History:
- 2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
- History:
- 2003-10-15 Jeff Anderson - Added requirement for frame kernel in labels
- History:
- 2003-10-28 Jeff Anderson - Changed SpaceCraft to Spacecraft in labels and method names
- History:
- 2003-11-03 Jeff Anderson - Added SubSolarPoint and SubSpacecraftPoint methods
- History:
- 2003-11-12 Jeff Anderson - Added Target method
- History:
- 2004-01-14 Jeff Anderson - Changed how the SPK, CK, and Instrument codes where handled. The instrument code must be in the labels as NaifFrameCode and then the other two can be automatically computed.
- History:
- 2004-02-18 Jeff Anderson - Modified to ignore kernel labels which were blank
- History:
- 2004-03-25 Jeff Anderson - Modified NaifBodyCode method to convert Jupiter target code of 599 to 5
- History:
- 2004-03-25 Jeff Anderson - Fixed bug in destructor and added GetString method.
- History:
- 2005-02-15 Elizabeth Ribelin - Modified file to support Doxygen documentation
- History:
- 2005-02-24 Jeff Anderson - Modified SubSolarPoint and SubSpacecraftPoint to return positive longitudes only
- History:
- 2005-09-12 Jeff Anderson - Check for case-insensitive values for TargetName of SKY
- History:
- 2005-09-20 Jeff Anderson - Added IsSky method
- History:
- 2006-01-05 Debbie A. Cook - Added units to comments
- History:
- 2006-03-28 Jeff Anderson - Refactored using SpiceRotation and SpicePosition classes. Added Tables and nadir kernel information.
- History:
- 2006-03-31 Elizabeth Miller - Added TargetCenterDistance method
- History:
- 2006-04-19 Elizabeth Miller - Added SolarLongitude method
- History:
- 2007-01-30 Tracie Sucharski - Throw error in the load method before calling furnish if the file does not exist.
- History:
- 2007-07-09 Steven Lambright - Frame kernel is now optional, added Extra kernel support.
- History:
- 2007-07-10 Debbie A. Cook - Modified method ComputeSolarLongitude to use pxform instead of tipbod to get body-fixed to J2000 rotation matrix so that the correct frame will be used. If the frame is different from the default IAU frame, the correct frame should be set in the iak file (see frames.req). Also modified setting of m_bodyRotation frameCode. The old code forced the IAU_ frame. The new code uses the Naif routine cidfrm to get the frame associated with the body id. These change will recognize any frame changes made in the iak file.
- History:
- 2007-08-10 Steven Lambright - Added support for Nadir keyword in InstrumentPointing group to not be the first element in the PvlKeyword.
- History:
- 2007-08-24 Debbie A. Cook - Removed p_sB so it is recalculated every time it is used insuring that any updates to the position or rotation are applied. Also removed p_BP since it is no longer used
- History:
- 2008-02-13 Steven Lambright - Added StartPadding and EndPadding caching capabilties
- History:
- 2008-02-13 Steven Lambright - Added Support Check for StartPadding and EndPadding caching capabilties; An clarified exception is thrown if a framing camera tries to use time padding
- History:
- 2008-02-27 Kris Becker - Modified so that planetary ephemeris SPKs are loaded before spacecraft SPKs so that missions that augment planet ephemerides will take precidence.
- History:
- 2008-06-23 Steven Lambright - Added NaifStatus error checking
- History:
- 2008-06-25 Debbie A. Cook - Added method InstrumentVelocity to support miniRF
- History:
- 2008-11-28 Debbie A. Cook - Added method hasKernels()
- History:
- 2009-03-18 Tracie Sucharski - Cleaned up some unnecessary, obsolete code. Make sure the table is used if the kernel names follow the "Table" keyword value, due to change made to spiceinit to retain kernel names if the spice is written to blob.
- History:
- 2009-06-18 Debbie A. Cook - Modified to downsize instrument rotation table when loading cache
- History:
- 2009-07-01 Debbie A. Cook - Modified to downsize body rotation, and sun position tables when loading cache
- History:
- 2009-08-03 Debbie A. Cook - Added tolerance argument to method CreateCache to allow downsizing of instrument position Spice table.
- History:
- 2009-08-21 Kris Becker - Moved the NAIF code methods to public scope.
- History:
- 2010-01-29 Debbie A. Cook - Redid Tracie's change to make sure the table is loaded instead of the kernels if the kernel keyword value lists "Table" before the kernel files.
- History:
- 2010-03-19 Debbie A. Cook - Added constructor and moved common constructor initialization into new method Init. Also added parameter notab to method Load.
- History:
- 2010-04-09 Debbie A. Cook - Moved the loading of the "extra" kernel(s) from the middle of the loads to the end.
- History:
- 2011-02-08 Jeannie Walldren - Added documentation to methods and private variables. Commented out createCache(double,double) since it appears that this method is not needed. Initialize pointers to NULL in Init() method.
- History:
- 2011-02-09 Steven Lambright - Refactored to use iTime where possible. Changed p_radii to a Distance so the units are no longer ambiguous. These changes were meant for readability and reducing the likelyhood of future code having bugs due to unit mismatches.
- History:
- 2011-02-11 Jeannie Walldren - Changed documentation references to SetEphemerisTime() method (these were replaced with references to setTime()). Added missing documentation to new methods.
- History:
- 2011-05-03 Jeannie Walldren - Added Isis Disclaimer to files.
- History:
- 2011-05-25 Janet Barrett and Steven Lambright - Added API that stores naif values and arbitrary computations so that the text kernels do not have to be furnished. This makes the Camera instantiation much, much quicker. Text kernels are no longer furnished when their data has been stored in the labels.
- History:
- 2011-05-26 Debbie A. Cook - Put back the code for spkwriter that was checked in May 25 but disappeared in the May 26 build. This code turns aberration corrections off for the instrument position if the spk file was created by spkwriter.
- History:
- 2011-07-08 Jeff Anderson - Fixed Init method to record the integer body frame code in the labels of the cube. Vesta exposed this problem because it was not a instrinsic body in the NAIF toolkit version 63.
- History:
- 2011-07-11 Jeff Anderson - Added private copy constructors and operator= methods
- History:
- 2011-09-19 Debbie Cook - Added cubes with Ideal Cameras to the exclusion list for reading instrument keywords from the label. The Ideal Camera has variable values for the affine coefficients that are set in the camera itself and not read from a kernel. The camera puts these values into the Naif kernel pool.
- History:
- 2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.
- History:
- 2012-09-10 Steven Lambright - Undid Debbie's change from 2011-09-19 because the Ideal camera now supports putting those keywords in the label on the fly. References #1094.
- History:
- 2012-10-11 Debbie A. Cook - Deleted deprecated createCache code already commented out for over a year. Updated to use new Target and ShapeModel classes. Added resolution method needed for Target and its ShapeModel. Changed private member names from p_ to m_ to comply with coding standards. References Mantis tickets #775 and #1114.
- History:
- 2012-10-25 Jeannie Backer - Added accesssor method to return the BODY_FRAME_CODE value found in the init() method. Improved unitTest coverage in all areas. New method has 100% scope, line, function coverage. Improved padding around control statements and indentation of history entries to be more compliant with standards. Moved accessor method implementations to cpp file. Changed Resolution() method to lower camel case. Added documentation. Fixes #1181.
- History:
- 2012-10-31 Kris Becker - Added implementation for swapping of observer/target and light time correction to surface. Fixes (mostly) #0909, #1136 and #1223.
- History:
- 2012-12-10 Kris Becker - A newly designed class, SpacecraftPosition, is now being instantiated instead of SpicePosition specifically to properly order NAIF observer and target codes (to more accurately determine the target body position at the time the observation was initiated) and help determine light time correction to the surface of the target body instead of the center of the body. See the documention in SpacecraftPosition.h for a more detailed description of these changes. References #909, #1136 and #1223.
- History:
- 2013-01-09 Steven Lambright and Mathew Eis - Fixed a possible crash condition that never exhibited any problems, but valgrind caught it. This was discovered when adding support for Mac OSX 10.8. References #1354.
- History:
- 2013-09-26 Tracie Sucharski - If the Target is Saturn and the shape model is the ring plane, load an extra kernel, saturnRings_v001.tpc, which changes the prime meridian to {0, 0, 0}. This insures the longitude values are calculated in the inertial system relative to the ascending node of the ring plane. Fixes #1757.
- History:
- 2013-12-17 Janet Barrett - Added the instrumentBodyFixedPosition and instrumentBodyFixedVelocity methods. Fixes #1684.
- History:
- 2015-04-30 Stuart - Added an error check around the NAIF SPICE call scs2e_c in getClockTime. Avoids a segfault. Fixes #2247.
- History:
- 2015-07-21 Kristin Berry - Added additional NaifStatus::CheckErrors() to see if any NAIF errors were signaled. References #2248.
- History:
- 2016-05-18 Jeannie Backer and Stuart Sides - Moved the construction of the Target after the NAIF kernels have been loaded or the NAIF keywords have been pulled from the cube labels, so we can find target body codes that are defined in kernels and not just body codes build into spicelib. References #3934
- History:
- 2016-10-19 Kristin Berry - Added exception to Spice::time() to throw if m_et is NULL. Also added isTimeSet(), a function that will return true if m_et is set. References #4476.
- History:
- 2016-10-21 Jeannie Backer - Reorder method signatures and member variable declarations to fit ISIS coding standards. References #4476.
- History:
- 2018-06-07 Debbie A Cook - Added BODY_CODE to Naif keywords. This code is used in the target body radii keyword name. Isis retrieves this code from the standard PCK. Because target bodies new to Naif are not included in the standard PCK, missions create a special body-specific PCK to define the new body, including its body code. This PCK is only loaded in spiceinit so the code needs to be saved so that the radii keyword can be created to retrieve the target radii.
- History:
- 2019-04-16 Kristin Berry - Added a parameter to getClockTime called clockTicks which defaults to false. When set to true, this indicates that the input value is in encoded clock ticks, rather than a full spacecraft clock time string. As such, when used sct2e_c is used to convert to an ET rather than scs2e_c.
- History:
- 2021-02-17 Kristin Berry, Jesse Mapel, and Stuart Sides - Made several methods virtual, moved several member variables to protected, and added initialization path for a sensor model without SPICE data.
Definition at line 283 of file Spice.h.
void Isis::Spice::createCache |
( |
iTime |
startTime, |
|
|
iTime |
endTime, |
|
|
const int |
size, |
|
|
double |
tol |
|
) |
| |
|
virtual |
This method creates an internal cache of spacecraft and sun positions over a specified time range.
The SPICE kernels are then immediately unloaded. This allows multiple instances of the Spice object to be created as the NAIF toolkit can clash if multiple sets of SPICE kernels are loaded. Note that the cache size is specified as an argument. Therefore, times requested via setTime() which are not directly loaded in the cache will be interpolated. If the instrument position is not cached and cacheSize is greater than 3, the tolerance is passed to the SpicePosition Memcache2HermiteCache() method.
Note: Before this method is called, the private variables m_cacheSize, m_startTime and m_endTime must be set. This is done in the Camera classes using the methods SetCacheSize() and SetStartEndEphemerisTime().
- Parameters
-
startTime | Starting ephemeris time to cache |
endTime | Ending ephemeris time to cache |
size | Size of the cache. |
tol | Tolerance. |
- Exceptions
-
- History:
- 2011-04-10 Debbie A. Cook - Updated to only create cache for instrumentPosition if type is Spice.
Definition at line 649 of file Spice.cpp.
References Isis::iTime::Et(), and Isis::FileName::expanded().
Referenced by Isis::CrismCamera::CrismCamera(), Isis::Camera::LoadCache(), and Isis::MiniRF::MiniRF().