Index Page
cspice_gnpool
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_GNPOOL queries the kernel pool for names of pool variables
   matching a user defined template.

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

I/O


   Given:

      name     the scalar string matchi_c template to use when searching
               for variable names in the kernel pool. The characters '*'
               and '%' are used for the wild card string and wild card
               character respectively.  For details of string
               pattern matching see the header of the routine matchi_c.

      start    a scalar integer value for the index indicating the
               first component of the data vector to return (index 0 for
               all elements).

      room     the scalar integer specifying the maximum number of components
               that can return for 'name'.

      length   the scalar integer value describing the max length
               to allow for the data strings (the value 81 returns
               any kernel variable name).

   the call:

      cspice_gnpool, name, start, room, length, kvars, found

   returns:

      kvars   a string array of kernel variable names matching the template
              'name', beginning with match number 'start'.

      found   a scalar boolean that flags whether any kernel variable names
              matched the 'name' template (TRUE) or not (FALSE).

              'kvars' has a size of 'room' or less.

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.

      Example(1):

      ;;
      ;; Load a leapseconds kernel.
      ;;
      cspice_furnsh, 'standard.tm'

      ;;
      ;; A template for Jupiter kernel variables.
      ;;
      VAR = 'BODY599*'

      ;;
      ;; Query for the variable name, return all matches from
      ;; index 0.
      ;;
      INDEX  = 0
      ROOM   = 10
      STRLEN = 81

      cspice_gnpool, VAR, INDEX, ROOM, STRLEN, kervar, found

      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

   IDL outputs:

      Variable        0 matching BODY599* : BODY599_POLE_DEC
      Variable        1 matching BODY599* : BODY599_LONG_AXIS
      Variable        2 matching BODY599* : BODY599_PM
      Variable        3 matching BODY599* : BODY599_RADII
      Variable        4 matching BODY599* : BODY599_POLE_RA


      Example(2):

      ;;
      ;; Return to the array 'kervar' the names of the first
      ;; 'ROOM' pool variables. Use the * wildcard character
      ;; as a template to indicate a request for all kernel
      ;; variables.
      ;;
      ;;
      ;; Return all matches from 'INDEX' zero.
      ;;
      INDEX  = 0
      ROOM   = 10
      STRLEN = 81

      ;;
      ;; Load a meta kernel listing leapseconds and
      ;; the default SPICE PCK kernels.
      ;;
      cspice_furnsh, 'standard.tm'

      ;;
      ;; Retrieve the variables from the pool.
      ;;
      cspice_gnpool, '*', index, ROOM, STRLEN, kervar, found

      ;;
      ;; Output the returned variable names.
      ;;
      if (found) then begin

         ;;
         ;; Output the returned variable names.
         ;;
         for i=0, n_elements(kervar)-1 do begin
            print, '   Variable ' + string(i) + ' : ', kervar[i]
         endfor

      endif else begin
         print, 'Failed to find any variable in the kernel pool'
      endelse

   IDL outputs:

      Variable        0 : BODY711_NUT_PREC_PM
      Variable        1 : BODY703_POLE_RA
      Variable        2 : BODY402_NUT_PREC_PM
      Variable        3 : BODY502_NUT_PREC_RA
      Variable        4 : BODY299_POLE_RA
      Variable        5 : BODY5_NUT_PREC_ANGLES
      Variable        6 : BODY999_LONG_AXIS
      Variable        7 : BODY713_POLE_RA
      Variable        8 : BODY708_NUT_PREC_PM
      Variable        9 : BODY808_NUT_PREC_RA

   Note, the seemingly random order of the output list reflects the
   order used by the SPICE kernel subsystem to store/lookup the
   variable names.

Particulars


   None.

Required Reading


   ICY.REQ
   KERNEL.REQ

Version


   -Icy Version 1.0.2, 29-APR-2011, EDW (JPL)

      Edits to I/O section so as to parallel Mice version.

   -Icy Version 1.0.1, 02-JAN-2007, EDW (JPL)

      Edit to I/O section for 'room' and 'start' to improve clarity.

      Minor edit to example comments concerning output list order.

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

Index_Entries


   return names of kernel pool variables matching a template




Wed Apr  5 17:58:01 2017