Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.stsci.edu/~sontag/spicedocs/cspice/spklef_c.html
Дата изменения: Sat Dec 17 06:09:48 2005 Дата индексирования: Mon Apr 11 00:09:50 2016 Кодировка: Поисковые слова: iceland |
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 loaded.
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.
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" 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, < ); 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] ); }
None.
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.
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.
N.J. Bachman (JPL) K.R. Gehringer (JPL) J.M. Lynch (JPL) R.E. Thurman (JPL) I.M. Underwood (JPL)
NAIF Document 168.0, "S- and P- Kernel (SPK) Specification and User's Guide"
-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