Table of contents
CSPICE_DVPOOL deletes a variable from the kernel pool.
Given:
name the name of the kernel pool variable to delete.
help, name
STRING = Scalar
The name and associated values are removed from the kernel
pool, freeing the occupied space.
If a watches are set on the variable designated by
`name', the corresponding agents are placed on the list
of agents to be notified of a kernel variable update.
the call:
cspice_dvpool, name
deletes the variable `name' and removes its associated values from the
kernel pool.
None.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
1) Query the kernel pool for variables matching a pattern,
returning 10 or less matches starting from index #1. Then
remove those variables from the kernel pool, and check that
indeed they have been deleted.
Use the LSK kernel below to load the variables used within
the example.
naif0009.tls
Example code begins here.
PRO dvpool_ex1
;;
;; Load an LSK.
;;
cspice_furnsh, 'naif0009.tls'
;;
;; A template for the leapseconds kernel variables.
;;
VAR = 'DELTET*'
;;
;; Query for the variable name, return 10 or less matches from
;; index 0.
;;
INDEX = 0
ROOM = 10
STRLEN = 81
cspice_gnpool, VAR, INDEX, ROOM, STRLEN, kervar, found
print, 'Kernel pool state after load.'
if (found) then begin
;;
;; Output the returned variable names.
;;
for i=0, n_elements(kervar)-1 do begin
print, 'Variable ' + string(i) + ' matching ' + VAR $
+ ' : ', kervar[i]
endfor
endif else begin
print, 'Failed to find ' + VAR + ' in the kernel pool'
endelse
;;
;; Delete the kernel pool variables returned from cspice_gnpool.
;;
for i=0, n_elements(kervar)-1 do begin
cspice_dvpool, kervar[i]
endfor
cspice_gnpool, VAR, INDEX, ROOM, STRLEN, kervar, found
print, ' '
print, 'Kernel pool state after load.'
if (found) then begin
;;
;; Output the returned variable names.
;;
for i=0, n_elements(kervar)-1 do begin
print, ' Variable ' + string(i) + ' matching ' + VAR $
+ ' : ', kervar[i]
endfor
endif else begin
print, 'Failed to find ' + VAR + ' in the kernel pool'
endelse
;;
;; It's always good form to unload kernels after use,
;; particularly in IDL due to data persistence.
;;
cspice_kclear
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Kernel pool state after load.
Variable 0 matching DELTET* : DELTET/DELTA_AT
Variable 1 matching DELTET* : DELTET/K
Variable 2 matching DELTET* : DELTET/M
Variable 3 matching DELTET* : DELTET/EB
Variable 4 matching DELTET* : DELTET/DELTA_T_A
Kernel pool state after load.
Failed to find DELTET* in the kernel pool
This routine enables users to programmatically remove variables
from the kernel pool, as opposed to having to clear the pool and
reload it.
Note that it is not necessary to remove kernel variables in order
to simply update them; this routine should be used only when
variables are to be removed.
1) If the specified variable is not present in the kernel pool,
this routine simply returns. No error is signaled.
2) If the input argument `name' is undefined, an error is
signaled by the IDL error handling system.
3) If the input argument `name' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
None.
None.
ICY.REQ
KERNEL.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.2, 13-AUG-2021 (JDR)
Edited the header to comply with NAIF standard. Added reference LSK
to the example.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added argument's type and size information in the -I/O section.
-Icy Version 1.0.1, 29-APR-2011 (EDW)
Edits to -I/O and -Particulars section so as to parallel Mice version.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
delete a kernel pool variable
|