Table of contents
CSPICE_LMPOOL loads the variables contained in a text buffer
into the kernel pool.
Given:
cvalen the integer scalar describing the max length to allow for the
data strings assigned to `cvals'.
help, cvalen
LONG = Scalar
cvals a scalar string or N array of strings defining SPICE kernel
variable assignments, each string not longer than `cvalen', that
could serve as a SPICE text kernel.
help, cvals
STRING = Array[N]
the call:
cspice_lmpool, cvalen, cvals
inserts the variable assignments defined by `cvals' into the
kernel pool subsystem. Once inserted, the user can access the
variables using the cspice_gcpool, cspice_gipool, or cspice_gdpool
calls.
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) Create a kernel in a text buffer and load the variables
contained within the buffer into the kernel pool. Ensure the
loaded data exists in the kernel pool. Query the pool for
each expected name, and print the size of the variable with
that name, and the type of data for that name.
Example code begins here.
PRO lmpool_ex1
LMPOOL_NVARS = 5
LNSIZE = 81
;;
;; Kernel pool variable's names.
;;
lmpoolNames = [ $
'DELTET/DELTA_T_A', $
'DELTET/K', $
'DELTET/EB', $
'DELTET/M', $
'DELTET/DELTA_AT' $
]
;;
;; Create a kernel in a text buffer.
;;
textbuf = $
[ $
'DELTET/DELTA_T_A = 32.184', $
'DELTET/K = 1.657D-3', $
'DELTET/EB = 1.671D-2', $
'DELTET/M = ( 6.239996 1.99096871D-7 )', $
'DELTET/DELTA_AT = ( 10, @1972-JAN-1', $
' 11, @1972-JUL-1', $
' 12, @1973-JAN-1', $
' 13, @1974-JAN-1', $
' 14, @1975-JAN-1', $
' 15, @1976-JAN-1', $
' 16, @1977-JAN-1', $
' 17, @1978-JAN-1', $
' 18, @1979-JAN-1', $
' 19, @1980-JAN-1', $
' 20, @1981-JUL-1', $
' 21, @1982-JUL-1', $
' 22, @1983-JUL-1', $
' 23, @1985-JUL-1', $
' 24, @1988-JAN-1', $
' 25, @1990-JAN-1', $
' 26, @1991-JAN-1', $
' 27, @1992-JUL-1', $
' 28, @1993-JUL-1', $
' 29, @1994-JUL-1', $
' 30, @1996-JAN-1', $
' 31, @1997-JUL-1', $
' 32, @1999-JAN-1 )' $
]
;;
;; Load the kernel data into the kernel pool.
;;
cspice_lmpool, LNSIZE, textbuf
;;
;; Ensure the loaded data exists in the kernel pool.
;; Query the pool for each expected name, size of the
;; variable with that name, and the type of data
;; for that name.
;;
for i = 0, (LMPOOL_NVARS-1) do begin
cspice_dtpool, lmpoolNames[i], found, n, dtype
if ( found ) then begin
print, 'Found ' + lmpoolNames[i]
print, ' # values assigned to name : ', n
print, ' with data type : ' + string(dtype)
endif
endfor
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Found DELTET/DELTA_T_A
# values assigned to name : 1
with data type : N
Found DELTET/K
# values assigned to name : 1
with data type : N
Found DELTET/EB
# values assigned to name : 1
with data type : N
Found DELTET/M
# values assigned to name : 2
with data type : N
Found DELTET/DELTA_AT
# values assigned to name : 46
with data type : N
Note that the query found the five kernel variables, returned
the number of elements assigned to each kernel variable, and
the data type associated with the variable, 'N' (numerical)
for all cases.
This routine allows you to store a text kernel in an internal
array of your program and load this array into the kernel pool
without first storing its contents as a text kernel.
Kernel pool variable names are restricted to a length of 32
characters or less.
1) If any of the kernel pool variables names or their values, as
provided in the input `cvals' array, cannot be parsed, an error
is signaled by a routine in the call tree of this routine.
2) If there is no room left in the kernel pool to store all
variables present in the input `cvals' array, an error is
signaled by a routine in the call tree of this routine.
3) If the length of any kernel pool variable name present in the
input `cvals' array exceeds its maximum allowed length (see
Kernel Required Reading, kernel.req), an error is signaled by
a routine in the call tree of this routine.
4) If any of the input arguments, `cvalen' or `cvals', is
undefined, an error is signaled by the IDL error handling
system.
5) If any of the input arguments, `cvalen' or `cvals', 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.3, 10-AUG-2021 (JDR)
Edited the -Examples section to comply with NAIF standard. Added
example's problem statement.
Changed the input argument name "length" to "cvalen" for consistency
with other routines.
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 arguments' type and size information in the -I/O section.
-Icy Version 1.0.2, 10-FEB-2010 (EDW)
Added mention of the length restriction on kernel pool variable
names.
-Icy Version 1.0.1, 25-JAN-2009 (EDW)
Edit to the -I/O argument descriptions and -Examples output
description to improve clarity.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
Load the kernel pool from an internal text buffer
|