Index Page
cspice_pcpool
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_PCPOOL provides toolkit programmers a method for 
   programmatically inserting character data into the 
   kernel pool.

   For important details concerning this module's function, please refer to
   the CSPICE routine pcpool_c.

I/O

   
   Given:
   
      name     the scalar string name of the kernel pool variable to
               associate with the values supplied in the array 'cvals'.
              'name' is restricted to a length of 32 characters or less.

      length   the integer value describing the max length
               to allow for the data strings assigned to 'name'.
   
      cvals    an array of strings, each string not longer 
               than 'length', to load into the kernel pool
               sub-system with the assigned variable name 'name'.
   
   the call:
   
      cspice_pcpool, name, length, cvals

   returns

      Inserts the variable 'name' into the kernel pool with values as
      defined in 'cvals'.
   

Examples


   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.
   
      ;;
      ;; Define the parameters for the string array.
      ;;
      LNSIZE        = 81
      PCPOOL_DIM    = 10
      PCPOOL_VAR    = 'pcpool_array'
      PCPOOL_VAL_TMP= 'pcpool_val'
      
      ;;
      ;; Populate the pcpool_arr array with values.
      ;;
      pcpool_arr = strarr( PCPOOL_DIM )
      
      ;;
      ;; Fill pcpool_arr with PCPOOL_DIM entries of the
      ;; form n_pcpool_val.
      ;;
      for i = 0,  (PCPOOL_DIM-1) do begin
   
         pcpool_arr[i] =  string(i) + '_' + PCPOOL_VAL_TMP
   
         ;;
         ;; Compress all whitespace from the string
         ;;
         cspice_cmprss, ' ', 0, pcpool_arr[i], temp
         pcpool_arr[i] =  temp
   
      endfor
    
      ;;
      ;; Insert the array data into the kernel pool
      ;; with variable name 'pcpool_array.'
      ;;
      cspice_pcpool, PCPOOL_VAR, LNSIZE, pcpool_arr  
      
      ;;
      ;; Retrieve the variable's associated values in
      ;; array cvals.
      ;;
      ROOM   = PCPOOL_DIM
      START  = 0
      cspice_gcpool, PCPOOL_VAR, START, ROOM, LNSIZE, cvals, found
   
      ;;
      ;; Check we found the expected variable, and ensure
      ;; the expected values.
      ;;
      if ( found ) then begin
         print, 'Found array variable ' + PCPOOL_VAR + ' with entries:'
   
         for i = 0, (n_elements(cvals)-1) do begin
            print, '   ' + cvals[i]
         endfor
         
      endif else begin
         print, 'Variable ' + PCPOOL_VAR + ' not found in kernel pool.'
      endelse
   
   IDL outputs:
   
      Found array variable pcpool_array with entries:
         0_pcpool_val
         1_pcpool_val
         2_pcpool_val
         3_pcpool_val
         4_pcpool_val
         5_pcpool_val
         6_pcpool_val
         7_pcpool_val
         8_pcpool_val
         9_pcpool_val

Particulars


   Kernel pool variable names are restricted to a length of 32 
   characters or less.

Required Reading


   ICY.REQ
   KERNEL.REQ

Version


   -Icy Version 1.0.1, 10-FEB-2010, EDW (JPL)

      Added mention of the length restriction on the kernel pool variable
      name 'name'.

   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   Set the value of a character kernel pool variable 
 



Wed Apr  5 17:58:02 2017