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_spklef

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


Abstract


   CSPICE_SPKLEF loads an ephemeris file for use by SPK readers then
   returns an integer file handle.

I/O


   Given:

      fname    a string containing the name of the file to be loaded.

               help, fname
                  STRING = Scalar

   the call:

      cspice_spklef, fname, handle

   returns:

      handle   an integer handle assigned to the file upon loading.

               help, handle
                  LONG = Scalar

               Almost every other SPK routine will subsequently use this
               number to refer to the file.

Parameters


   FTSIZE      is the maximum number of SPK files that may
               be loaded simultaneously under any circumstances.
               FTSIZE is currently set to match the maximum number
               of DAF files that may be loaded simultaneously.

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 planetary ephemeris SPK; then look up a series of
      geometric states of the Earth relative to the solar system
      barycenter, referenced to the J2000 frame.

      Use the SPK kernel below to load the required ephemerides
      for the Earth and the Earth Barycenter relative to the solar
      system barycenter.

         de405.bsp


      Example code begins here.


      PRO spklef_ex1

         ;;
         ;; Local constants.
         ;;
         MAXITR = 5
         ET0 = -315576000.0
         STEP = 3600.0

         ABCORR = 'NONE'
         FRAME = 'J2000'
         OBSERVER = 'SOLAR SYSTEM BARYCENTER'
         SPK = 'de405.bsp'
         TARGET = 'EARTH'

         ;;
         ;; Load the SPK file.
         ;;
         cspice_spklef, SPK, handle

         ;;
         ;; Step through a series of epochs, looking up a state vector
         ;; at each one.
         ;;
         for i=0, MAXITR - 1L do begin
            et  =  ET0 + i*STEP

            cspice_spkezr, TARGET, et, FRAME, ABCORR, OBSERVER, state, ltime

            print, ''
            print, format='(A,F21.10)', 'et = ', et
            print, ''
            print, format='(A,F21.10)', 'J2000 x-position (km):  ', state[0]
            print, format='(A,F21.10)', 'J2000 y-position (km):  ', state[1]
            print, format='(A,F21.10)', 'J2000 z-position (km):  ', state[2]
            print, format='(A,F21.10)', 'J2000 x-velocity (km/s):', state[3]
            print, format='(A,F21.10)', 'J2000 y-velocity (km/s):', state[4]
            print, format='(A,F21.10)', 'J2000 z-velocity (km/s):', state[5]
            print, ''
         endfor

         ;;
         ;; Unload the SPK kernel. This isn't necessary in a stand-
         ;; alone program, but it's good practice in procedures
         ;; because it frees program and system resources.
         ;;
         cspice_spkuef, handle

      END


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


      et = -315576000.0000000000

      J2000 x-position (km):   -26772058.9514643848
      J2000 y-position (km):   132760135.1677220613
      J2000 z-position (km):    57557579.2735445350
      J2000 x-velocity (km/s):       -29.7772753957
      J2000 y-velocity (km/s):        -5.0656884328
      J2000 z-velocity (km/s):        -2.1979102802


      et = -315572416.0000000000

      J2000 x-position (km):   -26878773.3732022829
      J2000 y-position (km):   132741944.0943545550
      J2000 z-position (km):    57549686.5114355534
      J2000 x-velocity (km/s):       -29.7731803858
      J2000 y-velocity (km/s):        -5.0855796048
      J2000 z-velocity (km/s):        -2.2065325889


      et = -315568800.0000000000

      J2000 x-position (km):   -26986425.6981768459
      J2000 y-position (km):   132723518.3595090210
      J2000 z-position (km):    57541691.9637668282
      J2000 x-velocity (km/s):       -29.7690319295
      J2000 y-velocity (km/s):        -5.1056448242
      J2000 z-velocity (km/s):        -2.2152302239


      et = -315565184.0000000000

      J2000 x-position (km):   -27094062.9916883670
      J2000 y-position (km):   132705020.0753098428
      J2000 z-position (km):    57533665.9684742540
      J2000 x-velocity (km/s):       -29.7648665253
      J2000 y-velocity (km/s):        -5.1257064565
      J2000 z-velocity (km/s):        -2.2239261848


      et = -315561600.0000000000

      J2000 x-position (km):   -27200732.8499865979
      J2000 y-position (km):   132686613.9163857996
      J2000 z-position (km):    57525679.9742503539
      J2000 x-velocity (km/s):       -29.7607212708
      J2000 y-velocity (km/s):        -5.1455869940
      J2000 z-velocity (km/s):        -2.2325435301


Particulars


   Loading an SPK file makes the file's data accessible to the Icy
   SPK readers cspice_spkezr and cspice_spkez.

   The maximum number of SPK files that may be loaded at any time is
   given by the parameter FTSIZE. After this limit it reached, it is
   necessary to unload an SPK file before another can be loaded. The
   function cspice_spkuef is provided to unload files from the SPK system.

Exceptions


   1)  If an attempt is made to open more DAF files than is specified by the
       parameter FTSIZE in the DAF subsystem, an error is signaled by a
       routine in the call tree of this routine.

   2)  If an attempt is made to load more files than is specified by
       the local parameter FTSIZE, and if the DAF system has room to
       load another file, the error SPICE(SPKFILETABLEFULL) is
       signaled by a routine in the call tree of this routine. The
       current setting of FTSIZE does not allow this situation to
       arise: the DAF system will trap the error before this routine
       has the chance.

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

   4)  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.

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

Files


   A file specified by `fname', to be loaded. The file is assigned a
   handle by cspice_spklef, which will be used by most other routines to
   refer to it.

Restrictions


   None.

Required_Reading


   ICY.REQ
   SPK.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -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. Created complete
       code example from existing code fragment.

       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.2, 19-JAN-2009 (EDW)

       Edits to header text and spelling correction.

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

Index_Entries


   load SPK ephemeris file



Fri Dec 31 18:43:07 2021