Isis Developer Reference
|
#include <KernelDb.h>
Public Member Functions | |
KernelDb (const unsigned int allowedKernelTypes) | |
Constructs a new KernelDb object with a given integer value representing the Kernel::Type enumerations that are allowed. More... | |
KernelDb (const QString &dbName, const unsigned int allowedKernelTypes) | |
Constructs a new KernelDb object with the given file name and integer value representing the Kernel::Type enumerations that are allowed. More... | |
KernelDb (std::istream &dbStream, const unsigned int allowedKernelTypes) | |
Constructs a new KernelDb object from the given stream and integer value representing the Kernel::Type enumerations that are allowed. More... | |
~KernelDb () | |
Destructs KernelDb object. More... | |
Kernel | leapSecond (Pvl &lab) |
This method finds the top priority of all Leap Second kernels (lsk) identified by the database and the allowed kernel types. More... | |
Kernel | targetAttitudeShape (Pvl &lab) |
This method finds the highest version of all Target Attitude Shape kernels (pck) identified by the database and the allowed kernel types. More... | |
Kernel | targetPosition (Pvl &lab) |
This method finds the highest version of all Target Position kernels (tspk) identified by the database and the allowed kernel types. More... | |
QList< std::priority_queue< Kernel > > | spacecraftPointing (Pvl &lab) |
This method finds a list of the highest versions of all Spacecraft Pointing kernels (ck) identified by the databases and the allowed Kernel types. More... | |
Kernel | spacecraftClock (Pvl &lab) |
This method finds the highest version of all Spacecraft Clock kernels (sclk) identified by the database and the allowed kernel types. More... | |
Kernel | spacecraftPosition (Pvl &lab) |
This method finds the highest version of all Spacecraft Position kernels (spk) identified by the database and the allowed kernel types. More... | |
Kernel | instrument (Pvl &lab) |
This method finds the last Instrument kernel found that matches the (ik) criteria in the database and the allowed kernel types. More... | |
Kernel | frame (Pvl &lab) |
This method finds the highest version of all Frame kernels (fk) identified by the database and the allowed kernel types. More... | |
Kernel | instrumentAddendum (Pvl &lab) |
This method finds the highest version of all Instrument Addendum kernels (iak) identified by the database and the allowed kernel types. More... | |
Kernel | dem (Pvl &lab) |
This method finds the highest version of all Digital Terrain Models (DEMs) found that match the criteria in the database. More... | |
Kernel | findLast (const QString &entry, Pvl &lab) |
Finds the highest priority Kernel object for the given entry based on the allowed Kernel types. More... | |
QList< std::priority_queue< Kernel > > | findAll (const QString &entry, Pvl &lab) |
Finds all of the Kernel objects for the given entry value based on the allowed Kernel types. More... | |
void | loadSystemDb (const QString &mission, const Pvl &lab) |
Loads the appropriate kernel database files with the defined BASE and MISSION info for each type of kernel. More... | |
QList< FileName > | kernelDbFiles () |
Accessor method to retrieve the list of kernel database files that were read in when loadSystemDb() is called. More... | |
Static Public Member Functions | |
static bool | matches (const Pvl &lab, PvlGroup &kernelDbGrp, iTime timeToMatch, int cameraVersion) |
This static method determines whether the given cube label matches the given criteria. More... | |
KernelDb class.
This class handles kernel database files. Once the database files have been loaded into a Pvl, the highest version of each kernel can be found by calling methods with corresponding kernel names, as shown below.
KernelDb baseKernels(0);
baseKernels.loadSystemDb(mission, lab);
Kernel lk, pck, targetSpk, fk, ik, sclk, spk, iak, dem, exk; priority_queue< Kernel > ck; lk = baseKernels.leapSecond(lab); pck = baseKernels.targetAttitudeShape(lab); targetSpk = baseKernels.targetPosition(lab); ik = baseKernels.instrument(lab); sclk = baseKernels.spacecraftClock(lab); iak = baseKernels.instrumentAddendum(lab); fk = ckKernels.frame(lab); ck = ckKernels.spacecraftPointing(lab); spk = spkKernels.spacecraftPosition(lab);
Isis::KernelDb::KernelDb | ( | const unsigned int | allowedKernelTypes | ) |
Constructs a new KernelDb object with a given integer value representing the Kernel::Type enumerations that are allowed.
The filename is set to "None" if this constructor is used.
The allowed kernel types is stored as the sum of the enumerations of the allowed Kernel Types. The following enumeriations currently exist: 0001 = 1 = Predicted 0010 = 2 = Nadir 0100 = 4 = Reconstructed 1000 = 8 = Smithed
So, for example, if allowedKernelTypes is 11, then we can represent it as 1011. In this case, Predicted, Nadir, and Smithed kernels are allowed, but not Reconstructed.
allowedKernelTypes | Integer value representing Kernel::Type enumerations that are allowed. |
Isis::KernelDb::KernelDb | ( | const QString & | dbName, |
const unsigned int | allowedKernelTypes | ||
) |
Constructs a new KernelDb object with the given file name and integer value representing the Kernel::Type enumerations that are allowed.
The allowed kernel types is stored as the sum of the enumerations of the allowed Kernel Types. The following enumeriations currently exist: 0001 = 1 = Predicted 0010 = 2 = Nadir 0100 = 4 = Reconstructed 1000 = 8 = Smithed
So, for example, if allowedKernelTypes is 11, then we can represent it as 1011. In this case, Predicted, Nadir, and Smithed kernels are allowed, but not Reconstructed.
dbName | String containing the name of the kernel database |
allowedKernelTypes | Integer value representing Kernel::Type enumerations that are allowed. |
Isis::KernelDb::KernelDb | ( | std::istream & | dbStream, |
const unsigned int | allowedKernelTypes | ||
) |
Constructs a new KernelDb object from the given stream and integer value representing the Kernel::Type enumerations that are allowed.
The filename is set to "internal stream" if this constructor is used.
The allowed kernel types is stored as the sum of the enumerations of the allowed Kernel Types. The following enumeriations currently exist: 0001 = 1 = Predicted 0010 = 2 = Nadir 0100 = 4 = Reconstructed 1000 = 8 = Smithed
So, for example, if allowedKernelTypes is 11, then we can represent it as 1011. In this case, Predicted, Nadir, and Smithed kernels are allowed, but not Reconstructed.
dbStream | An input stream containing kernel database Pvl objects |
allowedKernelTypes | Integer value representing Kernel::Type enumerations that are allowed. |
Isis::KernelDb::~KernelDb | ( | ) |
Destructs KernelDb object.
This method finds the highest version of all Digital Terrain Models (DEMs) found that match the criteria in the database.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no DEM is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
Finds all of the Kernel objects for the given entry value based on the allowed Kernel types.
This method returns a list of priority queues. Each priority queue corresponds to a kernel db file object of the same name as the entry in the kernelData pvl.
entry | The name of the kernel, dem, or entry that will be searched for |
lab | The Pvl label containing an IsisCube object with times and instrument ID. |
References Isis::CameraFactory::CameraVersion(), Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlObject::group(), Isis::PvlObject::groups(), Isis::PvlObject::hasGroup(), Isis::PvlContainer::hasKeyword(), Isis::PvlObject::hasObject(), Isis::PvlContainer::isNamed(), Isis::PvlKeyword::isNamed(), Isis::PvlContainer::keywords(), matches(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::Kernel::typeEnum().
Referenced by findLast(), and spacecraftPointing().
Finds the highest priority Kernel object for the given entry based on the allowed Kernel types.
This method calls findAll() to get a list of priority queues. The top priority of the first queue is returned, if it exists. If not, an empty Kernel object is returned.
entry | The name of the kernel, dem, or other entry that will be searched for |
lab | The label containing the IsisCube object with times and instrument ID. |
References findAll().
Referenced by dem(), frame(), instrument(), instrumentAddendum(), leapSecond(), spacecraftClock(), spacecraftPosition(), targetAttitudeShape(), and targetPosition().
This method finds the highest version of all Frame kernels (fk) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no FK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
This method finds the last Instrument kernel found that matches the (ik) criteria in the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no IK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
This method finds the highest version of all Instrument Addendum kernels (iak) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no IAK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
Accessor method to retrieve the list of kernel database files that were read in when loadSystemDb() is called.
This method finds the top priority of all Leap Second kernels (lsk) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no LSK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
void Isis::KernelDb::loadSystemDb | ( | const QString & | mission, |
const Pvl & | lab | ||
) |
Loads the appropriate kernel database files with the defined BASE and MISSION info for each type of kernel.
This method always gets the following from the mission directory:
For the following, this method looks for appropriate kernels in the mission directory first, then if not found, uses the kernels in the base directory:
The following are always found in the base directory
To check which kernel database files have been loaded, file names may be accessed by calling kernelDbFiles().
mission | A QString containing the name of the mission whose kernel database files will be loaded. |
lab | Reference to the labels of a cube. This is used match the appropriate InstrumentId value, if needed. |
References Isis::FileName::fileExists(), Isis::PvlObject::findGroup(), and Isis::Preference::Preferences().
|
static |
This static method determines whether the given cube label matches the given criteria.
The method can check for three criteria types: (1) Time, (2) CameraVersion, and/or (3) the Match keyword values in the given PvlGroup. All three are optional. If any of the given criteria are not met, the method will return false.
(1) If the given PvlGroup does not have a "Time" keyword, then the time will not be compared.
(2) If the given PvlGroup does not have a "CameraTime" keyword, then the time will not be compared.
(3) If the given PvlGroup does not have a "Match" keyword, then individual keywords will not be compared. If the "Match" keyword exists in the given PvlGroup, it will have the form:
Object = ObjectName Group = grp Match = (MatchGroup, MatchKeyword, MatchKeywordValue) EndGroup EndObject
The first entry of the vector passed into the Match keyword of this Pvl represents the name of a group in the labels. This group will be searched for the keyword name passed in as the second entry of the Match keyword. This criteria is met if the keyword value in the labels matches the third entry of the Match keyword.
lab | The labels of an IsisCube to be searched, usually for times and InstrumentId. |
grp | A PvlGroup from the kernel database containing values to compare to the labels |
timeToMatch | The time value (if time is not being compared, "iTime()" may be passed in for this value) |
cameraVersion | The camera version to be matched with the cube labels (if camera version is not being compared, "1" may be passed in for this parameter) |
References Isis::PvlObject::findGroup(), Isis::PvlObject::findObject(), Isis::PvlContainer::hasKeyword(), Isis::PvlKeyword::isNamed(), Isis::PvlContainer::keywords(), Isis::PvlKeyword::size(), Isis::IString::ToInteger(), and Isis::IString::Token().
Referenced by findAll().
This method finds the highest version of all Spacecraft Clock kernels (sclk) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no SCLK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
This method finds a list of the highest versions of all Spacecraft Pointing kernels (ck) identified by the databases and the allowed Kernel types.
If no database file or stream was provided ot the constructor, the loadSystemDb() method should be called prior to this accessor.
If no CKs are found, and a list with one empty queue will be returned.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findAll().
This method finds the highest version of all Spacecraft Position kernels (spk) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no SPK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
This method finds the highest version of all Target Attitude Shape kernels (pck) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no PCK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().
This method finds the highest version of all Target Position kernels (tspk) identified by the database and the allowed kernel types.
If no database file or stream was provided to the constructor, the loadSystemDb() method should be called prior to this accessor.
If no TSPK is found, this method will return an empty Kernel object.
lab | Pvl label containing an IsisCube with needed times and IDs. |
References findLast().