void spkopa_c ( ConstSpiceChar * file,
SpiceInt * handle )
Open an existing SPK file for subsequent write.
SPK
SPK
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
file I The name of an existing SPK file.
handle O A handle attached to the SPK file opened to append.
file is the name of an existing SPK file to which
you wish to append additional SPK segments.
handle is the DAF integer handle that refers to the SPK file
opened for appending.
None.
1) If the file specified does not exist the error
SPICE(FILENOTFOUND) will be signalled.
2) If the file specified is not an SPK file, the error
SPICE(FILEISNOTSPK) will be signalled.
3) If the string pointer file is null, the error
SPICE(NULLPOINTER) will be signaled.
4) If the string file has length zero, the error
SPICE(EMPTYSTRING) will be signaled.
All other exceptions are determined by routines in the call
tree of this routine. If any exceptions arise that prevent
opening of the specified file for writing, HANDLE will be
returned with the value 0.
See arguments file and handle.
This file provides an interface for opening existing SPK
files for the addition of SPK segments. If you need
to open an new SPK file for writing, call the routine SPKOPN.
Suppose you have collected data for a type 05 SPK segment and
wish to place the new segment in an existing SPK file. The
code fragment below shows one set of calls that you could perform
to make the addition. (Note that you could add segments of
other data types by replacing the call to spkw05_c with a suitably
modified call to another spkwXX_c routine.)
We assume that the following variables have already been
assigned the proper values:
body (integer) Body code for ephemeris object.
center (integer) body code for the center of motion
of the body.
frame (string) the reference frame of the states.
first (d.p.) first valid time for which states can be
computed in seconds past 2000.
last (d.p.) last valid time for which states can
be computed in seconds past 2000.
gm (d.p.) gravitational mass of central body.
n (integer) number of states and epochs.
states (d.p.) array of states (x,y,z,dx,dy,dz).
epochs (d.p.) array of epochs (seconds past 2000.)
segid (string) segment identifier
#include "SpiceUsr.h"
.
.
.
/.
Begin by opening the file.
./
spkopa_c ( file, &handle );
/.
Now add the collected data as a new segment.
./
spkw05_c ( handle, body, center, frame, first, last, segid,
gm, n, states, epochs );
/.
Finally, close the file.
./
spkcls_c ( handle );
None.
None.
F.S. Turner (JPL)
-CSPICE Version 1.0.0, 16-MAR-1999 (FST)
Open an existing SPK file for adding segments
Link to routine spkopa_c source file spkopa_c.c
|