Unload a SPICE kernel.
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- file I The name of a kernel to unload.
file is the name of a file to unload. This file should be one loaded through the interface furnsh_c. If the file is not on the list of loaded kernels no action is taken. Note that if file is a meta-text kernel, all of the files loaded as a result of loading the meta-text kernel will be unloaded.
The call unload_c ( file ); has the effect of "erasing" the last previous call: furnsh_c ( file ); This interface allows you to unload binary and text kernels. Moreover, if you used a meta-text kernel to set up your working environment, you can unload all of the kernels loaded through the meta-kernel by unloading the meta-kernel. Unloading Text or Meta-text Kernels. Part of the action of unloading text (or meta-text kernels) is clearing the kernel pool and re-loading any kernels that were not in the specified set of kernels to unload. Since loading of text kernels is not a very fast process, unloading text kernels takes considerably longer than unloading binary kernels. Moreover, since the kernel pool is cleared, any kernel pool variables you have set from your program by using one of the interfaces pcpool_c, pdpool_c, pipool_c, or lmpool_c will be removed from the kernel pool. For this reason, if you plan to use this feature in your program, together with one of the routines specified above, you will need to take special precautions to make sure kernel pool variables required by your program do not inadvertently disappear.
Suppose that you wish to compare two different sets of kernels used to describe the geometry of a mission (for example a predict model and a reconstructed model). You can place all of the kernels for one model in one meta-text kernel, and the other set in a second meta-text kernel. Let's call these predict.mta and actual.mta. #include "SpiceUsr.h" . . . furnsh_c ( "predct.mta" ); /. Compute quantities of interest and store them for comparison with results of reconstructed (actual) kernels. Now unload the predict model and load the reconstructed model. ./ unload_c ( "predct.mta" ); furnsh_c ( "actual.mta" ); /. Re-compute quantities of interest and compare them with the stored quantities. ./
See the note regarding the unloading of text and meta-text kernels.
1) If the specified kernel is not on the list of loaded kernels no action is taken. 2) If the input file argument pointer is null, the error SPICE(NULLPOINTER) will be signaled. 3) If the input file argument pointer is the empty string, the error SPICE(EMPTYSTRING) will be signaled.
N.J. Bachman (JPL) W.L. Taber (JPL)
-CSPICE Version 1.0.0, 01-SEP-1999 (NJB) (WLT)
Unload a SPICE kernel