Table of contents
CSPICE_LDPOOL loads the variable assignments in an ASCII
text kernel to the kernel pool.
Given:
fname the name of the text kernel file whose variables will be loaded
into the pool.
help, fname
STRING = Scalar
the call:
cspice_ldpool, fname
loads the assignments listed in `fname' to the kernel pool.
Note: This routine, has been superseded by cspice_furnsh.
NAIF recommends users load all kernel files for read-only data
access with cspice_furnsh.
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) The following example demonstrates how to create a leapseconds
kernel, load it, then check the pool for the data.
Example code begins here.
PRO ldpool_ex1
;;
;; Start with the needed variable assignments.
;;
LMPOOL_NVARS = 5
LSK = "ldpool_ex1.tls"
NLINES = 27
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 )" $
]
lmpoolNames = [ $
"DELTET/DELTA_T_A", $
"DELTET/K", $
"DELTET/EB", $
"DELTET/M", $
"DELTET/DELTA_AT" $
]
;;
;; Create a kernel file. We must prepend a "\begindata" control
;; word before the kernel variable assignments.
;;
openw, LUN, LSK, /Get_Lun
printf, LUN, "\begindata"
for i = 0, (NLINES-1) do begin
printf, LUN, textbuf[i]
endfor
;;
;; Place a "\begintext" marker after the data assignments,
;; just in case...
;;
printf, LUN, "\begintext"
;;
;; Close the new LSK.
;;
close, LUN
;;
;; Load the LSK into the kernel pool.
;;
cspice_ldpool, LSK
;;
;; Check the variable assignments now exist in the
;; pool.
;;
for i = 0, (LMPOOL_NVARS-1) do begin
;;
;; Retrieve name, type, and array size for each
;; variable name.
;;
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
endfor
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 : 46
Variable type : N
Note that all five variable assignment found in the pool. A size
1 indicates a scalar, type N indicates a numeric value.
Text kernels input to this routine need not have native line
terminators for the platform. Lower level CSPICE routines can
read and process non-native text files. This functionality does
not exist in the Fortran SPICELIB.
1) If an i/o error occurs while opening or reading a text kernel,
the error is signaled by a routine in the call tree of this
routine.
2) If any text kernel parsing error occurs, the error is signaled
by a routine in the call tree of this routine.
3) If a kernel pool overflow is detected, an error is signaled by
a routine in the call tree of this routine.
4) If the input argument `fname' is undefined, an error is
signaled by the IDL error handling system.
5) If the input argument `fname' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
See `fname' in -I/O.
1) Normally SPICE applications should load kernels via the
cspice_furnsh routine.
ICY.REQ
KERNEL.REQ
PCK.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.1.0, 01-JUN-2021 (JDR)
Changed input argument name "filename" to "fname" for consistency
with other routines.
Edited the header to comply with NAIF standard. Added example's
problem statement.
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.0, 16-JUN-2003 (EDW)
LOAD variables from a text kernel file into the pool
|