void spklef_c ( ConstSpiceChar * filename,
SpiceInt * handle )
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.
Variable I/O Description
-------- --- --------------------------------------------------
fname I Name of the file to be loaded.
handle O Loaded file's handle.
fname is a string containing the name of the file to be
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.
The parameter FTSIZE referenced below is defined in the header file
1) If an attempt is made to load more files than is specified
by the parameter FTSIZE, the error "SPICE(SPKFILETABLEFULL)" is
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.
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.
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.
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"
SpiceDouble state ;
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, < );
printf( "\net = %20.10f\n\n", et );
printf( "J2000 x-position (km): %20.10f\n", state );
printf( "J2000 y-position (km): %20.10f\n", state );
printf( "J2000 z-position (km): %20.10f\n", state );
printf( "J2000 x-velocity (km/s): %20.10f\n", state );
printf( "J2000 y-velocity (km/s): %20.10f\n", state );
printf( "J2000 z-velocity (km/s): %20.10f\n", state );
NAIF Document 168.0, "S- and P- Kernel (SPK) Specification and
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)
-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)
load spk ephemeris file