Isis 3 Programmer Reference
|
Determine SPICE kernels defined in an ISIS file. More...
#include <Kernels.h>
Classes | |
struct | KernelFile |
Public Member Functions | |
Kernels () | |
Default Constructor. More... | |
Kernels (const Kernels &kernels) | |
Initialize new Kernels from state of existing one. More... | |
Kernels (const QString &filename) | |
Construct using an ISIS file name. More... | |
Kernels (Cube &cube) | |
Construct using an ISIS Cube object. More... | |
Kernels (Pvl &pvl) | |
Construct from an ISIS label. More... | |
virtual | ~Kernels () |
Destructor always unloads the kernels from the pool. More... | |
Kernels & | operator= (const Kernels &kernels) |
Copy constructor for existing Kernels objecr. More... | |
int | size () const |
Returns the number of kernels found and/or loaded. More... | |
int | Missing () const |
Return count of missing kernel files. More... | |
void | Init (Pvl &pvl) |
Determine Spice kernels in an ISIS label. More... | |
bool | Add (const QString &kfile) |
Add a new kernel to the list. More... | |
void | Clear () |
Remove all kernel files from internal list. More... | |
int | Discover () |
Determine which NAIF kernels are currently loaded in the pool. More... | |
void | Manage () |
Set each kernels management status to managed. More... | |
void | UnManage () |
Set each kernels' management state to unmanaged. More... | |
bool | IsManaged () const |
Determine if all kernels are managed by this object. More... | |
void | InitializeNaifKernelPool () |
Initialize the NAIF kernel keeper pool. More... | |
int | Load (const QString &ktype) |
Load all kernels with one more types. More... | |
int | Load () |
Load all kernels in list. More... | |
int | UnLoad (const QString &ktype) |
Unloads all kernels of a specific type. More... | |
int | UnLoad () |
Unloads all kernels from the NAIF pool. More... | |
int | UpdateLoadStatus () |
Determine the load status of all kernels known to this object. More... | |
int | Merge (const Kernels &other) |
Merge the contents of another Kernels object. More... | |
QStringList | getKernelTypes () const |
Return list of types in kernel list. More... | |
QStringList | getKernelList (const QString &ktype="") const |
Provide a list of all the kernels found. More... | |
QStringList | getLoadedList (const QString &ktypes="") const |
Returns list of kernel currently loaded according to status. More... | |
QStringList | getMissingList () const |
Returns list of kernels that were not found to exist. More... | |
int | CameraVersion () const |
Returns the ISIS camera model version number. More... | |
Private Types | |
typedef std::vector< KernelFile > | KernelList |
typedef std::vector< KernelFile * > | KernelFileList |
typedef CollectorMap< QString, KernelFileList > | TypeList |
Private Member Functions | |
bool | Load (KernelFile &kfile) |
Load a kernel file. More... | |
bool | UnLoad (KernelFile &kfile) |
Unloads a kernel from the NAIF kernel pool. More... | |
QStringList | getTypes (const QString &ktypes) const |
Get a vector of comma separated types from a string. More... | |
QString | resolveType (const QString &kfile) const |
Determines type of NAIF/ISIS kernel we're dealing with. More... | |
QString | resolveTypeByExt (const QString &kfile, const QString &iktype="UNKNOWN") const |
Check kernel type by file extension and special ISIS kernels. More... | |
bool | IsNaifType (const QString &ktype) const |
Determine if the type is a NAIF supported kernel type. More... | |
KernelFile | examine (const QString &fname, const bool &manage=true) const |
Determine type of NAIF kernel file. More... | |
int | UpdateManagedStatus () |
Update the managed state of the kernel file list. More... | |
std::vector< KernelFile > | findKernels (Pvl &pvl, const QString &kname, const bool &manage=true) |
Retrieve contents of keyword. More... | |
KernelFile * | findByName (const QString &kfile) |
Search kernel file list of a particular pattern. More... | |
TypeList | categorizeByType () const |
Categorizes the kernel list by type. More... | |
void | addKernels (const KernelList &klist) |
Add a list of kernel files to internal storage. More... | |
QString | getKernelType (const QString &kname) const |
void | loadKernel (const QString &ktype="") |
int | getCameraVersion (Pvl &pvl) const |
Determine the ISIS camera model version number. More... | |
Private Attributes | |
KernelList | _kernels |
int | _camVersion |
Determine SPICE kernels defined in an ISIS file.
This class determines all SPICE kernels associated with an ISIS cube file and optionally/selectively loads them using the NAIF toolkit. This creates the kernel pool as it was when spiceinit determined all the kernels and it initialized the file for geometric operations.
Note that because NAIF kernel management is global in nature, careful thought and planning should preceed use of this class. You can get yourself into trouble if you take over management of kernels and inadvertantly unload them without regard for use by other resources. Methods are provided in this implementation to help minimize problems related to management of this global resource.
Note that ISIS caches some of the voluminous NAIF kernels, extracting only what is required from the SPK and CK (generally) kernels for a given observation. After this occurs, these kernels are no longer loaded by the ISIS Spice class hierarchy. This class provides that environment so that further NAIF operations can occur, such as velocity vector and instrument timing manipulations.
This class can be used instead of instantiating an ISIS Spice object. The recommended usage is as follows:
The implications of this code segment are: 1) All the kernels pertinent to an individual ISIS file are identified upon Kernels instantiation, 2) their load status is determined using the UpdateLoadStatus() method, 3) kernels already loaded are flagged as unmanaged, meaning they cannot be unloaded unless management is an explicit "hostile takeover" provided via the Manage() method (don't do it unless you absolutely have to), 4) after checking load status, and kernels you load are managed by your instantiation, and 5) when you UnLoad() or the object is destroyed, all managed kernels are unloaded - unmanaged kernels are not unloaded.
This class can be used in lieu of the Spice class with liberal use of the UpdateLoadStatus() and Discover() methods of this class.
It is possible to double load NAIF kernels, so be sure to maintain load status via UpdateLoadStatus() and proper usage techniques.
2010-12-29 Kris Becker - added resolveTypeByExt() method to find non-compliant NAIF file type identifiers kernels
2011-02-07 Kris Becker Corrected typo in Kernels/Extra (was Extras)
2011-02-28 Kris Becker - When using the examine() method, if the kernel is found to be loaded, its management state is set to unmanaged
2011-03-27 Kris Becker - Added copy constructor and assignment operator
2015-03-05 Kris Becker - Added support for DSK and meta kernels types. References #2035
2015-07-21 Kristin Berry - Added NaifStatus::CheckErrors() to see if any NAIF errors were signaled. References #2248.
Isis::Kernels::Kernels | ( | ) |
Default Constructor.
Default constructor simple initialization.
Definition at line 49 of file Kernels.cpp.
Isis::Kernels::Kernels | ( | const Kernels & | kernels | ) |
Initialize new Kernels from state of existing one.
Initialize new Kernels object from the state of an existing one while preserving the state of one copied. Each kernel file state is copied to this new one. It ensures that ones that are already opened are set to an unmanaged state from the source. It also checks the current open state and will set ones found to be open as unmanaged as well. All other kernels files can be managed by this new instance.
kernels | Source kernels object |
Definition at line 69 of file Kernels.cpp.
Isis::Kernels::Kernels | ( | const QString & | filename | ) |
Construct using an ISIS file name.
filename | Name of ISIS cube file |
Definition at line 109 of file Kernels.cpp.
Isis::Kernels::Kernels | ( | Cube & | cube | ) |
Construct using an ISIS Cube object.
cube | Cube object of ISIS file |
Definition at line 119 of file Kernels.cpp.
References Isis::Cube::label().
Isis::Kernels::Kernels | ( | Pvl & | pvl | ) |
Construct from an ISIS label.
pvl | ISIS label to get kernel information from |
Definition at line 128 of file Kernels.cpp.
|
inlinevirtual |
bool Isis::Kernels::Add | ( | const QString & | kfile | ) |
Add a new kernel to the list.
This method is provided to add individual NAIF kernels directly. Files names must contain a path to the file. ISIS "shortcuts" as defined in the DataDirectory group in the IsisPreferences files (e.g., "$base/kernels/lsk/naif0009.tls") are supported as well.
Note that if the file already exists, it is not added. This situation is indicated with a return value of false.
Files added in this way are set to manageable status.
kfile | Name of kernel file to add with valid directory path |
Definition at line 195 of file Kernels.cpp.
Referenced by Isis::PushFrameCameraCcdLayout::addKernel().
|
private |
Add a list of kernel files to internal storage.
Specialized inserter of images into exist container.
klist | List to add to existing collection |
Definition at line 898 of file Kernels.cpp.
|
inline |
|
private |
Categorizes the kernel list by type.
This method creates essentially a kernel type map with a pointer list to each KernelFile structure of that type.
Definition at line 985 of file Kernels.cpp.
References Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::add(), Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::exists(), and Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::get().
void Isis::Kernels::Clear | ( | ) |
Remove all kernel files from internal list.
This method will clear out the kernel file list without any regard for its current state. This does not unload any kernels that are unloaded. One must Unload() prior to calling this method in order to gracefully close out the existing state of the kernel pool.
Definition at line 212 of file Kernels.cpp.
int Isis::Kernels::Discover | ( | ) |
Determine which NAIF kernels are currently loaded in the pool.
This method queries the NAIF KEEPER system/pool for all loaded kernels and adds them to the list in this object. It only knows about kernels that are loaded by the NAIF furnsh_c routine. If no kernels are loaded there will be no kernels discovered by this routine.
Upon entry into this method, the current list is discarded without unloading them. Hence, any kernels in this list are discard, whether they are loaded and managed by this class or not. If they are loaded according to the internal state as determined by previous activity in this class, and no additional NAIF activity has occured that unloads them, they should be found again by this method.
Note that ALL kernels discovered by this routine are marked as unmanaged, meaning you cannot unload the kernels without exerting management upon them via the Manage() method. See the Manage() documentation for more details and potential issues with this feature.
This method should not be used to update the load nature of an established kernel list. See the UpdateLoadStatus() method for this feature.
Here is a short coding example showing use of this method. It assumes there are some kernels already loaded (although it is entirely possible that no kernels are loaded). It will take over management of these kernels as well:
Definition at line 252 of file Kernels.cpp.
Referenced by Isis::LightTimeCorrectionState::checkSpkKernelsForAberrationCorrection().
|
private |
Determine type of NAIF kernel file.
This method will determine the type of kernel contained in the file specified by the kfile parameter.
The file specified by the kfile parameter is assumed to conform to NAIF kernel file conventions (i.e., binary kernels are created using the NAIF toolkit, text kernels conform to NAIF standards). There are, however, two exceptions that must be considered. ISIS DEMs are cubes and do not follow the NAIF convention for obvious reasons. ISIS IAK kernels also do not typically follow NAIF identification standards. These two cases are handled special.
To determine a NAIF standard conforming file type, the first eight characters of the file given will be inspected to determine the NAIF kernel type. If this fails to produce a known type, then it is assumed to be an ISIS DEM or IAK kernel.
For valid NAIF kernels, the NAIF routine kinfo_c is used to acquire additional information such as if it is loaded.
For files where the type cannot be determined, the type is set to "UNKNOWN". ISIS DEMs are set to the type "DEM". ISIS IAKs are set to "IAK". Other types are set as follows:
CK SPK DAF (may be SPKs) PCK EK META IK FK SCLK
kfile | Name of kernel file to inspect |
manage | Default state to assign to kernel. Note that this only retains effect if the kernel is not loaded. If it is loaded, its state is set to unmanaged. You must explicitly exert management upon kernels that are already loaded. Optional argument so the default is true. |
Definition at line 1061 of file Kernels.cpp.
References Isis::FileName::expanded(), Isis::FileName::fileExists(), Isis::FileName::name(), Isis::IString::ToQt(), and Isis::IString::UpCase().
|
private |
Search kernel file list of a particular pattern.
This method will compare the file, kfile, to each kernel contained in the internal list and return a pointer to the internal file entry structure for it if it exists.
There are three possible forms of the filename that are maintained by this routine. The kernel name as extracted from the Kernels group in the label of an ISIS file. These filenames will typically have an ISIS "environment" variable included in the full file name, such as "$base/kernels/lsk/naif0009.tls". When a new file is added, the complete path is stripped off and just the base filename itself is stored, such as "naif0009.tls". The third form is the fully expanded version of the file, which may look like "/usgs/cpkgs/isis3/data/base/kernels/lsk/naif0009.tls". All three forms of the filename are checked and only one has to match.
kfile | Name of file to find. It can be any one of the three stored forms. |
Definition at line 966 of file Kernels.cpp.
|
private |
Retrieve contents of keyword.
This method retrieves the contents of a keyword. It is specifically designed to handle Kernel group keywords. As such, any value of "Table" found in the keyword is not added to the kernel list.
pvl | ISIS label containing the Kernels group. |
kname | Name of keyword to extract |
manage | Default management state to assign to kernels. The default is to manage the kernels that are found. See examine() for full disclosure of how this is set. |
Definition at line 920 of file Kernels.cpp.
References Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), Isis::PvlKeyword::isNull(), and Isis::PvlKeyword::size().
|
private |
Determine the ISIS camera model version number.
This method looks for the "CameraVersion" keyword in the Kernels group of an ISIS label. If found, it returns this number, otherwise it returns 0 (this is indicative of an older file).
pvl | ISIS label |
Definition at line 1265 of file Kernels.cpp.
References Isis::PvlObject::findGroup(), Isis::PvlContainer::hasKeyword(), and Isis::IString::ToInteger().
QStringList Isis::Kernels::getKernelList | ( | const QString & | ktypes = "" | ) | const |
Provide a list of all the kernels found.
This method will return all the kernel file references as found in the ISIS label.
ktypes | Optional list of kernel types to return in the list. This can be any type found in the internal list as returned by getKernelTypes(). If empty, returns all kernels. |
Definition at line 689 of file Kernels.cpp.
Referenced by Isis::LightTimeCorrectionState::checkSpkKernelsForAberrationCorrection(), Isis::RosettaVirtisCamera::hasArticulationKernel(), and Isis::DawnVirCamera::hasArticulationKernel().
QStringList Isis::Kernels::getKernelTypes | ( | ) | const |
Return list of types in kernel list.
This method determines what types of kernels are currently in the internal list and returns them in alphabetical order. An empty list is returned if there are no kernels. The list may contain "UNKNOWN" which is the default type assigned when the type of the kernel file cannot be determined. These kernels are excluded from any loading/unloading.
The list of known types are:
CK SPK DAF (synonymous for SPKs as well so load both) PCK EK META IK FK SCLK IAK (ISIS specific) DSK
Kernel types are determined by inspecting the first 8 characters of a kernel file and extracting the contents there. The actual type is the string value after the last '/' character. This is typically the value that is also returned by the NAIF kinfo_c utility.
Definition at line 667 of file Kernels.cpp.
References Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::key(), and Isis::CollectorMap< K, T, ComparePolicy, RemovalPolicy, CopyPolicy >::size().
QStringList Isis::Kernels::getLoadedList | ( | const QString & | ktypes = "" | ) | const |
Returns list of kernel currently loaded according to status.
This method returns a list of kernel filenames that are loaded according to internal status. If the load status is in question, used UpdateLoadStatus() prior to calling this method.
Users can restrict the list to loaded kernels of a specific type. For example, to get a list of all CKs and SPKs loaded, the following code can be used:
ktypes | Optional string containing comma separated list of types to return if loaded. If empty, returns all types of kernels that are deemed loaded. |
Definition at line 737 of file Kernels.cpp.
QStringList Isis::Kernels::getMissingList | ( | ) | const |
Returns list of kernels that were not found to exist.
This method can be used to identify which kernels do not exist when they were added to this object. If the Missing() method returns a number > 0, then this routine returns a list of files missing.
Definition at line 769 of file Kernels.cpp.
|
private |
Get a vector of comma separated types from a string.
This method parses a string assumed to contain NAIF kernel file types. It will return a vector of strings that contain each type found in the string parameters, ktypes.
Validity of the types of values found here are not verified but can still be used effectively in other manipulation activities in this object.
Here is now the strings are used:
This will result in out of the following:
ktypes | Sgtring containing comma separated list of kernel file types |
Definition at line 882 of file Kernels.cpp.
References Isis::IString::ToQt(), Isis::IString::Trim(), and Isis::IString::UpCase().
void Isis::Kernels::Init | ( | Pvl & | pvl | ) |
Determine Spice kernels in an ISIS label.
This method reads keywords in the Kernels group in the ISIS label hierarchy to find all the pertinent kernel files. They are found in the Kernels Group.
The order listed here is the same as the order specified in the ISIS Spice class at the time this class was written. When loading and unloading, the order is the same as is read in here.
pvl | Assumed to be a valid ISIS cube label containing the Kernels group |
Definition at line 159 of file Kernels.cpp.
void Isis::Kernels::InitializeNaifKernelPool | ( | ) |
Initialize the NAIF kernel keeper pool.
This method will thoroughly clear out the NAIF kernel keeper pool. This is done using the NAIF k_clear() utility. As the documentation states, it operates by side effects unloading all kernels and reinitializing the keeper pool.
This method has no regard at to whether any of the NAIF kernels are managed or not. It does update all kernels load status to unloaded.
NOTE: This method should be used with caution as it can have disasterous side effects for ISIS processing. Specifically, using this method arbitrarily will likely cause fatal exceptions particularly for Spice class instantiations.
Definition at line 350 of file Kernels.cpp.
bool Isis::Kernels::IsManaged | ( | ) | const |
Determine if all kernels are managed by this object.
This method will return true if all kernels listed in this object are marked as "managed". If any one of the kernels is found to have an unmanaged state, false will be returned by this routine.
Management/unmanagement is an all-or-nothing scheme.
Definition at line 325 of file Kernels.cpp.
|
private |
Determine if the type is a NAIF supported kernel type.
ktype | String containing the kernel type |
Definition at line 1008 of file Kernels.cpp.
int Isis::Kernels::Load | ( | const QString & | ktypes | ) |
Load all kernels with one more types.
This method will find all kernels with a specific type and loads them into the NAIF KEEPER system/pool using the NAIF furnsh_c utility. If they are already loaded, they are not loaded again. Status is set to show they are loaded.
This object cannot monitor the kernel pool unless explicit action is taken. See the CheckLoadStatus() method. It will update the load status of kernels in the current list.
NOTE: If individual kernel are not managed by this routine they are not loaded. Users must invoke the Manage() method to enable full kernel manipulation.
ktypes | One or more kernel types specified in a comma separated list |
Definition at line 381 of file Kernels.cpp.
Referenced by Isis::PushFrameCameraCcdLayout::addKernel().
int Isis::Kernels::Load | ( | ) |
Load all kernels in list.
This method will iterate though all NAIF-type kernels and load them into the NAIF KEEPER system/pool using the NAIF furnsh_c utility. If they are already loaded, they are not loaded again. Status is set to show they are loaded.
This object cannot monitor the kernel pool unless explicit action is taken. See the CheckLoadStatus() method. It will update the load status of kernels in the current list.
NOTE: If individual kernel are not managed by this routine they are not loaded. Users must invoke the Manage() method to enable full kernel manipulation.
Definition at line 422 of file Kernels.cpp.
|
private |
Load a kernel file.
The internal file structure contains information related to a kernel that is common to the ISIS system. Its status is checked and only if the kernels is not loaded will it be loaded via the NAIF furnsh_c utility. Its load status is updated as well as its manage status (it becomes managed).
kfile | Structure containing the file to load |
Definition at line 791 of file Kernels.cpp.
void Isis::Kernels::Manage | ( | ) |
Set each kernels management status to managed.
This method will change every kernels's management state to managed so that full manipulation of every kernel can be performed by this object.
If a kernel is managed, it will be allowed to UnLoad at will. This is typically the only restriction of an unmanaged kernel.
Definition at line 286 of file Kernels.cpp.
int Isis::Kernels::Merge | ( | const Kernels & | other | ) |
Merge the contents of another Kernels object.
This method mergest the contents of another Kernels object into this one. Kernels that exist in both instances of the object are handled special. The status of this object's version of the file is updated to reflect conditions of the other objects kernels.
When the file does not exist in this object, the kernel file structure is copied from the other Kernels object, its managed status is set to false (since it pre-exists in another object that must relinquish its management of it) and is added to this objects kernel list.
When the file does exist in this object, its load status is checked in the other Kernels object. If it is loaded according to the other object, it is marked as loaded in this object and its managed state is set to unmanaged (since it contained in another object, no assumptions can be made as to whom and how it came about to be loaded.
The following code fragment demonstrates how to ensure only one Kernels object retains complete control of the merged set of kernels:
The UpdateLoadStatus() ensures the state of the managed kernel list in master is completely up to date.
other | Other Kenels object containing a separate list of NAIF kernels that will be merged with the contents of this object. |
Definition at line 616 of file Kernels.cpp.
int Isis::Kernels::Missing | ( | ) | const |
Return count of missing kernel files.
Definition at line 137 of file Kernels.cpp.
Copy constructor for existing Kernels objecr.
This copy constructor ensures the kernel list copied from an existing object is set to proper conditions as to minimize interference of both object that existence.
Any current kernels that in this object are removed without regard for ther current state. The list of kernels in the source object are copied and their state is analyzed. Any opened kernels are set to unmanaged state.
kernels | Source list from which the list is copied |
Definition at line 93 of file Kernels.cpp.
|
private |
Determines type of NAIF/ISIS kernel we're dealing with.
This method will open the file and look at the first 8 characters. Valid NAIF binary and text kernels typically have its type defined in the first 8 characters. The expected format of these characters is "DAF/CK". This method retrieves this string, trims off formatting characters and spaces and returns the string after the "/" character. This value is returned as the kernel type.
It also checks for ISIS DEMs and a special case of ISIS IAKs, which does not follow the NAIF convention. ISIS IAKs don't typically contain the NAIF format identifier but do contain the ".ti" file extention.
UNKNOWN and DAF types are further checked by the filename. This is a last resort to properly tag kernel types that are ambiguous. DAFs are common for some SPKs. UNKNOWNs are common for many kernels that do not follow the NAIF standard first 8 character identifier model.
kfile | Name of potential NAIF kernel to determine type for |
Definition at line 1125 of file Kernels.cpp.
References Isis::FileName::expanded(), Isis::IString::ToQt(), and Isis::IString::Trim().
|
private |
Check kernel type by file extension and special ISIS kernels.
This method is a fallback attempt to determine the type of an expected NAIF kernel. This method assumes the proper way (inspecting first 8 characters of the kernel file) did not succeed in making this determination.
There are some times that are expected to fail this test. ISIS DEMs are cube files and will not be determined using the NAIF 8 character approach. As such, all files that end in .cub are assumed to be DEMs and are tagged as such.
There are also some special ISIS IK addendum files that exist in the ISIS system. These files are used to augment an instruments' IK kernel and potentially override some of the original IK contents. This file type is determined by checking for a ".ti" extension and then further checking the base filename for the substring "Addendum". This is the only way to ensure it is an ISIS IAK file. It must pass both tests or it is simply tagged as an IK (due to the .ti extension).
The remainder of the tests are strictly testing the file extension. Here is how the associations are made to the files based upon their file extensions:
.cub = DEM - ISIS cubes are DEMs .ti = IK - unless "Addendum" is in basename, then it is an IAK .tf = FK - frames kernel .tsc = SCLK - spacecraft clock kernel .tsl = LSK - leap seconds kernel .tpc = PCK - planetary ephemeris kernel .bc = CK - C-kernel .bsp = SPK - spacecraft position kernel .bes = EK - event kernels .bds = DSK - NAIF DSK shape model kernel .meta = META - NAIF meta kernels file
If none of these file extensions or condition are found, then the value of the parameter iktype is returned as the default type.
kfile | File to determine type for |
iktype | Default type to be used in none are determined from this methiod |
Definition at line 1198 of file Kernels.cpp.
References Isis::FileName::baseName(), and Isis::FileName::extension().
|
inline |
int Isis::Kernels::UnLoad | ( | const QString & | ktypes | ) |
Unloads all kernels of a specific type.
This method will parse a string containing acronyms of NAIF kernels types and close only those found with the associated type. Types in the context of this class are loosely managed. They are typically types returned by the NAIF utilities, kinfo_c and kdata_c.
Only those files that match will be unloaded. There load states will be altered to reflect its load status.
Only files that are tagged as manageable but this object are closed. Unmanaged kernels are essentially ignored.
ktypes | Comma delimited string specifying the type to unload. This string is of the form "LSK,FK,SPK". |
Definition at line 470 of file Kernels.cpp.
int Isis::Kernels::UnLoad | ( | ) |
Unloads all kernels from the NAIF pool.
This method will unload all kernels from the kernel pool. It will unload them one at a time, which is known to be inefficient. You could consider using the InitializeNaifKernelPool() method for a more thorough and efficient cleansing.
Definition at line 442 of file Kernels.cpp.
Referenced by ~Kernels().
|
private |
Unloads a kernel from the NAIF kernel pool.
This method will unload a NAIF kernel from the kernel pool. If the internal load state does not indicate it is loaded, there will be no activity performed.
The file must also be tagged as manageable by this object. Certain conditions will affect the manageability of a NAIF kernel in this object. See the class documentation for details. In the situation of the file being tagged as unmanageable, the load state never changes. Use UpdateLoadStatus() to determine its true load state.
There is good chance that a NAIF kernel may no longer be loaded in the pool. This is particularly a real possibility as a side effect of this class. Errors are, therefore, ignored when encountered attempting to unload a kernel file. The state is then set to a unloaded condition.
kfile |
Definition at line 831 of file Kernels.cpp.
void Isis::Kernels::UnManage | ( | ) |
Set each kernels' management state to unmanaged.
This method changes the management state to unmanaged, thus restricting the ability of this method to unload loaded kernels.
When a kernel is marked as unmanaged, it will persist in its loaded state even after the destruction of this object (there is really no way to track how kernels get loaded reliably).
Definition at line 305 of file Kernels.cpp.
int Isis::Kernels::UpdateLoadStatus | ( | ) |
Determine the load status of all kernels known to this object.
This method will reevaluate the load status of each NAIF kernel contained within this object. This method can be useful when there are more than one of these Kernels objects instantiated.
It will check to determine if each NAIF kernel is loaded using the NAIF kinfo_c utility. It will change loaded status to unloaded and unloaded status to loaded from results of the query. It does not consider the managed state of any kernel.
One can always choose to use the Load() and UnLoad() utilities for explicit handling of the kernel (type) states.
Definition at line 508 of file Kernels.cpp.
|
private |
Update the managed state of the kernel file list.
This method changes the managed state of individual files that are opened. If a file is determined to be open it sets the managed state such that this object will not manage it. In other words, it ensures it will not close the file when asked.
This method is intended to be used when copying the contents of another Kernels object and it will not allow closing of existing kernel files that are found to be open. It is useful to call the UpdateLoadStatus() method first to determine load states of files.
And files that it finds to be unloaded, it will set it manageable.
Definition at line 556 of file Kernels.cpp.