Table of contents
CSPICE_DTPOOL queries the kernel pool for the existence of a kernel
variable, if found, the routine returns the size and type of
pool variable.
Given:
name the scalar string name of a pool variable.
help, name
STRING = Scalar
the call:
cspice_dtpool, name, found, n, type
returns:
found a scalar boolean that returns TRUE if variable `name' exists in
the pool
help, found
BOOLEAN = Scalar
n the integer count of values assigned to `name', note a value
greater than one indicates an array
help, n
LONG = Scalar
type a character marker indicating the type of values
assigned to `name':
'C' character values (strings)
'N' numerical values (integers or doubles)
'X' variable name does not exist in pool
help, type
STRING = Scalar
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) Check for the variables defined in the leapseconds kernel and
a name probably (hopefully) not in the kernel pool.
Use the LSK kernel below as test file to generate the results.
naif0009.tls
Example code begins here.
PRO dtpool_ex1
;;
;; Load a leapsecond kernel.
;;
cspice_furnsh, 'naif0009.tls'
;;
;; Check for the variables defined in the leapseconds kernel.
;;
lmpoolNames = [ $
"DELTET/DELTA_T_A", $
"DELTET/K", $
"DELTET/EB", $
"DELTET/M", $
"DELTET/DELTA_AT", $
"EVERLASTING_GOBSTOPPER" $
]
for i = 0, n_elements(lmpoolNames)-1 do begin
cspice_dtpool, lmpoolNames[i], found, n, dtype
if (found) then begin
print, "Variable name : " + lmpoolNames[i]
print, "Variable size : " + string(n)
print, "Variable type : " + dtype
print
endif else begin
print, "Unable to find variable name : " + lmpoolNames[i]
print
endelse
endfor
;;
;; 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:
Variable name : DELTET/DELTA_T_A
Variable size : 1
Variable type : N
Variable name : DELTET/K
Variable size : 1
Variable type : N
Variable name : DELTET/EB
Variable size : 1
Variable type : N
Variable name : DELTET/M
Variable size : 2
Variable type : N
Variable name : DELTET/DELTA_AT
Variable size : 50
Variable type : N
Unable to find variable name : EVERLASTING_GOBSTOPPER
This routine allows you to determine whether or not a kernel
pool variable is present and to determine its size and type
if it is.
1) If the name requested is not in the kernel pool `found'
will be set to False, `n' to zero and `type' to 'X'.
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.
4) If any of the output arguments, `found', `n' or `type', is not
a named variable, 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, 25-AUG-2021 (JDR)
Edited header to comply with NAIF standard. Added example's
problem statement.
Added -Parameters, -Particulars, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-Icy Version 1.0.1, 05-JAN-2012 (EDW)
Edits to Example section, proper description of "standard.tm"
meta kernel.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
return summary information about a kernel pool variable
|