spk14a_c |

## Procedurevoid spk14a_c ( SpiceInt handle, SpiceInt ncsets, ConstSpiceDouble coeffs [], ConstSpiceDouble epochs [] ) ## AbstractAdd data to a type 14 SPK segment associated with handle. See also spk14b_c and spk14e_c. ## Required_ReadingSPK ## KeywordsSPK ## Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- handle I The handle of an SPK file open for writing. ncsets I The number of coefficient sets and epochs. coeffs I The collection of coefficient sets. epochs I The epochs associated with the coefficient sets. ## Detailed_Inputhandle is the file handle of an SPK file that has been opened for writing. ncsets is the number of Chebyshev coefficient sets and epochs to be stored in the segment. coeffs contains a time-ordered array of Chebyshev coefficient sets for computing the state vector of a body, packed one after the other into an array. A state vector contains the position, X, Y, Z coordinates, and the velocities, dX/dt, dY/dt, dZ/dt, for the position of a body relative to a center of motion. See the Particulars section for details on how to store the coefficient sets in the array. epochs contains the initial epochs (ephemeris seconds past J2000) corresponding to the Chebyshev coefficients in COEFFS. The I'th epoch is associated with the I'th Chebyshev coefficient set. The epochs must form a strictly increasing sequence. ## Detailed_OutputNone. The ephemeris data is stored in a segment in the SPK file associated with handle. See the Particulars section for details about the structure of a type 14 SPK segment. ## ParametersNone. ## Exceptions1) If the number of coefficient sets and epochs is not positive, the error SPICE(INVALIDARGUMENT) will be signaled. ## FilesNone. ## ParticularsThis routine adds data to a type 14 SPK segment that is associated with the input argument handle. The segment must have been started by a call to the routine spk14b_c, the routine which begins a type 14 SPK segment. This routine is one of a set of three routines for creating and adding data to type 14 SPK segments. These routines are: spk14b_c: Begin a type 14 SPK segment. This routine must be called before any data may be added to a type 14 segment. ## ExamplesAssume we have the following for each of the examples that follow. handle is the handle of an SPK file opened with write access. segid is a character string of no more than 40 characters which provides a pedigree for the data in the SPK segment we will create. body is the NAIF ID code for the body whose ephemeris is to be placed into the file. center is the center of motion for the ephemeris of body. reffrm is the name of the SPICE reference frame for the ephemeris. first is the starting epoch, in seconds past J2000, for the ephemeris data to be placed into the segment. last is the ending epoch, in seconds past J2000, for the ephemeris data to be placed into the segment. Example 1: For this example, we also assume that: n is the number of type 14 records that we want to put into a segment in an SPK file. recrds contains n type 14 records packaged for the SPK file. etstrt contains the initial epochs for each of the records contained in RECRDS, where etstrt[i] < etstrt[i+1], i = 0, n-2 etstrt[1] <= first, etstrt[n-1] < last etstrt[i+1], i = 0, n-2, is the ending epoch for record i as well as the initial epoch for record i+1. Then the following code fragment demonstrates how to create a type 14 SPK segment if all of the data for the segment is available at one time. #include "SpiceUsr.h" . . . #define SPK "example.bsp" /. If the segment is to be appended to an existing file, open that file for "append" access. Otherwise, create a new file. ./ if ( exists_c(SPK) ) { spkopa_c ( SPK, &handle ); } else { /. New files are supplied with an internal file name. Comment area space may be reserved at this time; the units are characters. ./ ifname = "Sample type 14 SPK file."; ncomch = 1024; spkopn_c ( SPK, ifname, ncomch, &handle ); } /. Begin the segment. ./ spk14b_c ( handle, segid, body, center, reffrm, first, last, chbdeg ); /. Add the data to the segment all at once. ./ ## Restrictions1) The type 14 SPK segment to which we are adding data must have been started by the routine SPK14B, the routine which begins a type 14 SPK segment. ## Literature_ReferencesNone. ## Author_and_InstitutionN.J. Bachman (JPL) K.R. Gehringer (JPL) ## Version-CSPICE Version 1.0.0, 29-JUL-1999 (NJB) (KRG) ## Index_Entriesadd data to a type_14 spk segment |

Wed Apr 5 17:54:43 2017