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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_KTOTAL returns the number of kernels of a specified type that are
   currently loaded via the cspice_furnsh interface.

I/O


   Given:

      kind     a list of types of kernels to count when computing loaded
               kernels.

               help, kind
                  STRING = Scalar

               `kind' should consist of a list of words of kernels to
               examine. Recognized types are

                  SPK  --- All SPK files are counted in the total.
                  CK   --- All CK files are counted in the total.
                  PCK  --- All binary PCK files are counted in the
                           total.
                  DSK  --- All DSK files are counted in the total.
                  EK   --- All EK files are counted in the total.
                  TEXT --- All text kernels that are not meta-text
                           kernels are included in the total.
                  META --- All meta-text kernels are counted in the
                           total.
                  ALL  --- Every type of kernel is counted in the
                           total.

               `kind' is case insensitive. If a word appears in `kind'
               that is not one of those listed above, it is ignored.

               When `kind' consists of multiple words, the words must
               be separated by blanks. Examples of valid lists are the
               strings

                  'SPK CK TEXT'
                  'SPK CK text'
                  'PCK DSK'
                  'CK'
                  'ALL'

               See the -Examples section for illustrations of the
               use of `kind'.

   the call:

      cspice_ktotal, kind, count

   returns:

      count    the number of kernels loaded through cspice_furnsh that
               belong to the list specified by `kind'.

               help, count
                  LONG = Scalar

Parameters


   None.

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.

   1) Load a meta-kernel with a PCK, an LSK and an SPK, and
      separately, a text kernel and a binary PCK. Show the
      total number of kernels and meta-kernels loaded. Determine the
      number of text kernels loaded, and the number of binary
      kernels.

      Unload all kernels and clear the kernel pool using
      cspice_kclear, and check that no kernels are loaded.


      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File name: ktotal_ex1.tm

         This meta-kernel is intended to support operation of SPICE
         example programs. The kernels shown here should not be
         assumed to contain adequate or correct versions of data
         required by SPICE-based user applications.

         In order for an application to use this meta-kernel, the
         kernels referenced here must be present in the user's
         current working directory.

         The names and contents of the kernels referenced
         by this meta-kernel are as follows:

            File name                     Contents
            ---------                     --------
            de421.bsp                     Planetary ephemeris
            pck00008.tpc                  Planet orientation and
                                          radii
            naif0009.tls                  Leapseconds


         \begindata

            KERNELS_TO_LOAD = ( 'de421.bsp',
                                'pck00008.tpc',
                                'naif0009.tls'  )

         \begintext

         End of meta-kernel


      Use the PCK kernel below as the binary PCK required for the
      example.

         earth_latest_high_prec.bpc


      Use the FK kernel below as the text kernel required for the
      example.

         RSSD0002.TF


      Example code begins here.


      PRO ktotal_ex1

         ;;
         ;; Load several kernel files.
         ;;
         cspice_furnsh, 'ktotal_ex1.tm'
         cspice_furnsh, 'RSSD0002.TF'
         cspice_furnsh, 'earth_latest_high_prec.bpc'

         ;;
         ;; Count the number of loaded kernel files.
         ;;
         cspice_ktotal, 'ALL', n
         print, FORMAT='(A,I2)', 'The total number of kernels after ' +      $
                                 'final cspice_furnsh:', n

         ;;
         ;; Count the number of meta-kernels.
         ;;
         cspice_ktotal, 'META', n
         print, FORMAT='(A,I2)', 'The total number of meta-kernels  ' +      $
                                 '                   :', n

         ;;
         ;; Count the number of text kernels.
         ;;
         cspice_ktotal, 'TEXT', n
         print, FORMAT='(A,I2)', 'The total number of text kernels  ' +      $
                                 '                   :', n

         ;;
         ;; Count the number of binary kernels. These kernels
         ;; are of type CK, DSK, EK, PCK or SPK.
         ;;
         cspice_ktotal, 'CK DSK EK PCK SPK', n
         print, FORMAT='(A,I2)', 'The total number of binary kernels' +      $
                                 '                   :', n

         ;;
         ;; Clear the KEEPER system, retrieve the number of loaded
         ;; after the clear.
         ;;
         cspice_kclear

         cspice_ktotal, 'ALL', n
         print, FORMAT='(A,I2)', 'The total number of kernels after ' +      $
                                 'cspice_kclear      :', n

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      The total number of kernels after final cspice_furnsh: 6
      The total number of meta-kernels                     : 1
      The total number of text kernels                     : 3
      The total number of binary kernels                   : 2
      The total number of kernels after cspice_kclear      : 0


Particulars


   cspice_ktotal allows you to easily determine the number of kernels
   loaded via the interface cspice_furnsh that are of a type of interest.

Exceptions


   1)  If a word on the list specified by `kind' is not recognized,
       it is ignored.

   2)  If `kind' is blank, or none of the words in `kind' is on the
       list specified above, `count' will be returned as zero.

   3)  If the input argument `kind' is undefined, an error is
       signaled by the IDL error handling system.

   4)  If the input argument `kind' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

   5)  If the output argument `count' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   KERNEL.REQ

Literature_References


   None.

Author_and_Institution


   N.J. Bachman        (JPL)
   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 2.0.1, 01-NOV-2021 (JDR) (NJB)

       Edited the header to comply with NAIF standard. Updated example code to
       demonstrate different types of calls to the API.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections, and
       completed -Particulars section.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

       Updated -I/O description of input argument "kind" to illustrate
       use of multi-word lists. Added kernel.req to the list of required
       readings. Improved -Abstract section.

   -Icy Version 2.0.0, 02-NOV-2016 (EDW) (NJB)

       Updated to support use of DSKs.

   -Icy Version 1.0.1, 09-DEC-2005 (EDW)

       Added -Examples section.

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

Index_Entries


   Number of loaded kernels of a given type



Fri Dec 31 18:43:05 2021