Index Page spklef_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       void spklef_c ( ConstSpiceChar * filename,
                       SpiceInt       * handle    )
#### Abstract
       Load an ephemeris file for use by the readers.  Return that file's
       handle, to be used by other SPK routines to refer to the file.
#### Required_Reading
       SPK
#### Keywords
       None.
#### Brief_I/O
       Variable  I/O  Description
       --------  ---  --------------------------------------------------
       fname      I   Name of the file to be loaded.
       handle     O   Loaded file's handle.
#### Detailed_Input
       fname          is a string containing the name of the file to be
                      loaded.
#### Detailed_Output
       handle         is an integer handle assigned to the file upon
                      loading.   Almost every other SPK routine will
                      subsequently use this number to refer to the file.
#### Parameters
       None.
#### Exceptions
       The parameter FTSIZE referenced below is defined in the header file
       cspicelimits.h.

       1) If an attempt is made to load more files than is specified
          by the parameter FTSIZE, the error "SPICE(SPKFILETABLEFULL)" is
          signalled.

       2) If an attempt is made to open more DAF files than is specified
          by the parameter FTSIZE, an error is signalled by a routine that
          this routine calls.
#### Files
       A file specified by fname, to be loaded.  The file is assigned a
       handle by spklef_c, which will be used by most other routines to
       refer to it.
#### Particulars
       Loading an SPK file make the file's data accessible to the CSPICE
       SPK readers spkezr_c and spkez_c.

       The maximum number of SPK files that may be loaded at any time is
       given by the parameter FTSIZE, which is defined in the header file
       cspicelimits.h.  After this limit it reached, it is necessary to
       unload an SPK file before another can be loaded.  The function
       spkuef_c is provided to unload files from the SPK system.
#### Examples
       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.

                #define        MAXITR        100
                #define        ET0           -315576000.0
                #define        STEP          3600.0

                #define        ABCORR        "NONE"
                #define        FRAME         "J2000"
                #define        OBSERVER      "SOLAR SYSTEM BARYCENTER"
                #define        SPK           "de403.bsp"
                #define        TARGET        "EARTH"

                SpiceInt       handle;
                SpiceInt       i;

                SpiceDouble    et;
                SpiceDouble    lt;
                SpiceDouble    state [6];

             /.
                Load the spk file.
             ./
                spklef_c ( SPK, &handle );

             /.
                Step through a series of epochs, looking up a state vector
                at each one.
             ./
                for ( i = 0;  i < MAXITR;  i++ )
                {
                   et  =  ET0 + i*STEP;

                   spkezr_c ( TARGET,    et,     FRAME,  ABCORR,
                              OBSERVER,  state,  &lt             );

                   printf( "\net = %20.10f\n\n",                 et       );
                   printf( "J2000 x-position (km):   %20.10f\n", state[0] );
                   printf( "J2000 y-position (km):   %20.10f\n", state[1] );
                   printf( "J2000 z-position (km):   %20.10f\n", state[2] );
                   printf( "J2000 x-velocity (km/s): %20.10f\n", state[3] );
                   printf( "J2000 y-velocity (km/s): %20.10f\n", state[4] );
                   printf( "J2000 z-velocity (km/s): %20.10f\n", state[5] );
                }
#### Restrictions
       None.
#### Literature_References
       NAIF Document 168.0, "S- and P- Kernel (SPK) Specification and
       User's Guide"
#### Author_and_Institution
       N.J. Bachman    (JPL)
       K.R. Gehringer  (JPL)
       J.M. Lynch      (JPL)
       R.E. Thurman    (JPL)
       I.M. Underwood  (JPL)
       E.D. Wright     (JPL)
       B.V. Semenov    (JPL)
#### Version
       -CSPICE Version 2.0.3, 04-FEB-2008   (BVS)

          Removed duplicate header section '-Exceptions'.

       -CSPICE Version 2.0.2, 16-JAN-2008   (EDW)

          Corrected typos in header titles:

          Detailed Input to Detailed_Input
          Detailed Output to Detailed_Output

       -CSPICE Version 2.0.1, 10-NOV-2006   (EDW)

          Added Keywords and Parameters section headers.
          Reordered section headers.

       -CSPICE Version 2.0.0, 08-FEB-1998 (NJB)

           Input argument filename changed to type ConstSpiceChar *.
           References to C2F_CreateStr_Sig were removed; code was
           cleaned up accordingly.  String checks are now done using
           the macro CHKFSTR.

       -CSPICE Version 1.0.0, 25-OCT-1997 (NJB) (EDW)
#### Index_Entries
       load spk ephemeris file
#### Link to routine spklef_c source file spklef_c.c

    Wed Jun  9 13:05:30 2010