Index Page
spkopa_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 spkopa_c ( ConstSpiceChar * file,
                   SpiceInt       * handle ) 

Abstract

 
  Open an existing SPK file for subsequent write. 
 

Required_Reading

 
   SPK 
 

Keywords

 
   SPK 
 

Brief_I/O

 
   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. 
 

Detailed_Input

 
   file       is the name of an existing SPK file to which 
              you wish to append additional SPK segments. 
 

Detailed_Output

 
   handle     is the DAF integer handle that refers to the SPK file
              opened for appending.  
 

Parameters

 
   None. 
 

Exceptions

 
   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.
 

Files

 
   See arguments file and handle. 
 

Particulars

 
   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. 
 

Examples

 
   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 ); 
 

Restrictions

 
   None. 
 

Literature_References

 
   None. 
 

Author_and_Institution

   F.S. Turner        (JPL)

Version

 
   -CSPICE Version 1.0.0, 16-MAR-1999 (FST)

Index_Entries

 
   Open an existing SPK file for adding segments 
 
Wed Apr  5 17:54:43 2017