public final class SpkFile extends Object
Before a file can be read by the S/P-kernel readers, it must be loaded by loadSpkFile, which among other things, loads the file into the DAF system.
Up to MAX_FILES files may be loaded for use simultaneously, and a file only has to be loaded once to become a potential search target for any number of subsequent reads.
Once an SPK file has been loaded, it is assigned a file handle, which is used to keep track of the file internally, and which is used by the calling program to refer to the file in all subsequent calls to SPK routines.
A file may be removed from the list of files for potential searching by unloading it via a call to unloadSpkFile.
SPKSFS performs the search for segments within a file for the S/P-kernel readers. It searches through last-loaded files first. Within a single file, it searches through last-inserted segments first, thus assuming that "newest data is best".
Information on loaded files is used by SPKSFS to manage a buffer of saved segment descriptors and identifiers to speed up access time without having to necessarily perform file reads.
This class is based on the SPKBSR.for file of the SPICE library.
Modifier and Type | Field and Description |
---|---|
static int |
ND
Number of double precision components in a summary.
|
static int |
NI
Number of integer components in a summary.
|
Modifier and Type | Method and Description |
---|---|
static int |
loadSpkFile(String file)
Load an ephemeris file for use by the readers.
|
static boolean |
searchSegment(int body,
double et,
int[] handle,
double[] descr,
String[] ident)
Search through loaded SPK files to find the highest-priority segment applicable to the body and time specified
and buffer searched segments in the process, to attempt to avoid re-reading files.
|
static void |
unloadSpkFile(int handle)
Unload an ephemeris file so that it will no longer be searched by the readers.
|
public static final int ND
public static final int NI
public static int loadSpkFile(String file) throws IOException, PatriusException
This method is based on the SPKLEF routine of the SPICE library.
file
- Name of the file to be loadedIOException
- if there is problem opening the filePatriusException
- if there is a problem opening or closing the filepublic static void unloadSpkFile(int handle) throws PatriusException
Based on the SPKUEF routine of the SPICE library
handle
- Handle of file to be unloadedPatriusException
- if there is problem closing the filepublic static boolean searchSegment(int body, double et, int[] handle, double[] descr, String[] ident) throws PatriusException
Based on the SPKSFS routine from the SPICE library
body
- Body IDet
- Ephemeris timehandle
- Handle of file containing the applicable segmentdescr
- Descriptor of the applicable segmentident
- Identifier of the applicable segmentPatriusException
- if there is a problem while searching in the fileIOException
- if there is a problem while beginning a segment searchCopyright © 2023 CNES. All rights reserved.