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_getfat

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


Abstract


   CSPICE_GETFAT determines the file architecture and file type of
   most SPICE kernel files.

I/O


   Given:

      file     the string name of a SPICE kernel file whose architecture and
               type are desired.

               help, file
                  STRING = Scalar

               This file must be closed when this routine is called.

   the call:

      cspice_getfat, file, arch, kertyp

   returns:

      arch     a string describing the file's architecture of the SPICE kernel
               file specified by `file'.

               help, arch
                  STRING = Scalar

               If the architecture cannot be determined or is not recognized
               the value "?" is returned.

               Architectures currently recognized are:

                  DAF -- The file is based on the DAF architecture.
                  DAS -- The file is based on the DAS architecture.
                  XFR -- The file is in a SPICE transfer file format.
                  DEC -- The file is an old SPICE decimal text file.
                  ASC -- An ASCII text file.
                  KPL -- Kernel Pool File (i.e., a text kernel)
                  TXT -- An ASCII text file.
                  TE1 -- Text E-Kernel type 1.
                   ?  -- The architecture could not be determined.

      kertyp   a string describing the type of the SPICE kernel file.

               help, kertyp
                  STRING = Scalar

               If the type can not be determined the value "?" is returned.

               Kernel file types may be any sequence of at most four
               printing characters. NAIF has reserved for its use
               types which contain all upper case letters.

               A file type of "PRE" means that the file is a
               pre-release file.

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) Determine the file architecture and file type of all the
      kernels loaded through a meta-kernel and of a kernel in
      transfer format.

      Use the SPK kernel below to provide an example of a binary in
      transfer format.

         earthstns_itrf93_050714.xsp


      Use the meta-kernel shown below to load the other types of
      SPICE kernels.


         KPL/MK

         File: getfat_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
            ---------                        --------
            de430.bsp                        Planetary ephemeris
            mar097.bsp                       Mars satellite ephemeris
            pck00010.tpc                     Planet orientation and
                                             radii
            naif0011.tls                     Leapseconds
            mgs_moc_v20.ti                   MGS MOC instrument
                                             parameters
            mgs_sclkscet_00061.tsc           MGS SCLK coefficients
            mgs_sc_ext12.bc                  MGS s/c bus attitude
            mgs_ext12_ipng_mgs95j.bsp        MGS ephemeris
            megr90n000cb_plate.bds           Plate model based on
                                             MEGDR DEM, resolution
                                             4 pixels/degree.

         \begindata

            KERNELS_TO_LOAD = ( 'de430.bsp',
                                'mar097.bsp',
                                'pck00010.tpc',
                                'naif0011.tls',
                                'mgs_moc_v20.ti',
                                'mgs_sclkscet_00061.tsc',
                                'mgs_sc_ext12.bc',
                                'mgs_ext12_ipng_mgs95j.bsp',
                                'megr90n000cb_plate.bds'      )
         \begintext

         End of meta-kernel


      Example code begins here.


      PRO getfat_ex1

         ;;
         ;; Check the file architecture and type of an SPK
         ;; in transfer format.
         ;;
         fname1 = 'earthstns_itrf93_050714.xsp'

         cspice_getfat, fname1, arch, ktype

         print, 'File name     : ', fname1
         print, '  Architecture: ', arch
         print, '  Kernel type : ', ktype
         print, ''

         ;;
         ;; Load the kernels.
         ;;
         cspice_furnsh, 'getfat_ex1.tm'

         ;;
         ;; Get the file architecture and kernel type for each of
         ;; the kernels in the kernel pool.
         ;;
         cspice_ktotal, 'ALL', count

         for i=0, count - 1L do begin

            cspice_kdata, i, 'ALL', fname, ktype, source, handle, found

            cspice_getfat, fname, arch, ktype

            print, 'File name     : ', fname
            print, '  Source      : ', source
            print, '  Architecture: ', arch
            print, '  Kernel type : ', ktype
            print, ''

         endfor

         ;;
         ;; It's always good form to unload kernels after use,
         ;; particularly in IDL due to data persistence.
         ;;
         cspice_kclear

      END


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


      File name     : earthstns_itrf93_050714.xsp
        Architecture: XFR
        Kernel type : DAF

      File name     : getfat_ex1.tm
        Source      :
        Architecture: KPL
        Kernel type : MK

      File name     : de430.bsp
        Source      : getfat_ex1.tm
        Architecture: DAF
        Kernel type : SPK

      File name     : mar097.bsp
        Source      : getfat_ex1.tm
        Architecture: DAF
        Kernel type : SPK

      File name     : pck00010.tpc
        Source      : getfat_ex1.tm
        Architecture: KPL
        Kernel type : PCK

      File name     : naif0011.tls
        Source      : getfat_ex1.tm
        Architecture: KPL
        Kernel type : LSK

      File name     : mgs_moc_v20.ti
        Source      : getfat_ex1.tm
        Architecture: KPL
        Kernel type : IK

      File name     : mgs_sclkscet_00061.tsc
        Source      : getfat_ex1.tm
        Architecture: KPL
        Kernel type : SCLK

      File name     : mgs_sc_ext12.bc
        Source      : getfat_ex1.tm
        Architecture: DAF
        Kernel type : CK

      File name     : mgs_ext12_ipng_mgs95j.bsp
        Source      : getfat_ex1.tm
        Architecture: DAF
        Kernel type : SPK

      File name     : megr90n000cb_plate.bds
        Source      : getfat_ex1.tm
        Architecture: DAS
        Kernel type : DSK


Particulars


   This subroutine is a support utility routine that determines the
   architecture and type of a SPICE kernel file.

Exceptions


   1)  If the filename specified is blank, the error
       SPICE(BLANKFILENAME) is signaled by a routine in the call tree
       of this routine.

   2)  If any inquire on the filename specified by `file', required to
       obtain information about the physical file, fails for some
       reason, the error SPICE(INQUIREERROR) is signaled by a routine
       in the call tree of this routine.

   3)  If the file specified by `file' does not exist, the error
       SPICE(FILENOTFOUND) is signaled by a routine in the call tree
       of this routine.

   4)  If the file specified by `file' is already open but not through
       SPICE interfaces, the error SPICE(EXTERNALOPEN) is signaled by
       a routine in the call tree of this routine.

   5)  If an attempt to open the file specified by `file' fails when
       this routine requires that it succeed, the error
       SPICE(FILEOPENFAILED) is signaled by a routine in the call
       tree of this routine.

   6)  If an attempt to read the file specified by `file' fails when
       this routine requires that it succeed, the error
       SPICE(FILEREADFAILED) is signaled by a routine in the call
       tree of this routine.

   7)  If an issue is detected during the opening the input file or
       the process to determine its architecture and type, an error
       is signaled by a routine in the call tree of this routine.

   8)  If the ID word in a DAF based kernel is 'NAIF/DAF', then the
       algorithm cspice_getfat uses to distinguish between CK and SPK
       kernels may result in an indeterminate `kertyp' if the SPK or
       CK files have invalid first segments.

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

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

   11) If any of the output arguments, `arch' or `kertyp', is not a
       named variable, an error is signaled by the Icy interface.

Files


   The SPICE kernel file specified by `file' is opened and then
   closed by this routine to determine its file architecture and
   type. Filenames of open files should not be passed to this
   routine.

Restrictions


   1)  In order to properly determine the type of DAF based binary
       kernels, the routine requires that their first segments and
       the meta data necessary to address them are valid.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.0.1, 13-AUG-2021 (JDR)

       Changed output argument name "type" to "kertyp" for consistency
       with other routines. Extended the routine's argument descriptions
       in the -I/O section.

       Added complete code example to -Examples section.

       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.

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

Index_Entries


   determine the architecture and type of a kernel file



Fri Dec 31 18:43:04 2021