Perform routine error checks and if all check pass, pack the descriptor for an SPK segment
VARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- body I The NAIF ID code for the body of the segment. center I The center of motion for body. frame I The frame for this segment. type I The type of SPK segment to create. first I The first epoch for which the segment is valid. last I The last epoch for which the segment is valid. descr O An SPK segment descriptor.
body is the NAIF ID code for the body of the segment. center is the center of motion for BODY. frame is a string that names the frame to which states for the body shall be referenced. type is the type of SPK segment to create. first is the first epoch for which the segment will have ephemeris data. last is the last epoch for which the segment will have ephemeris data.
descr is a valid SPK segment descriptor to use when creating a DAF segment for this body.
This is a utility routine for validating and creating the descriptor for an SPK segment. It is intended for use only by routines that create SPK segments.
Suppose that you wish to create an SPK segment of type X and that you are writing a routine to handle the details of the segment creation. This routine can be used to ensure that the descriptor needed for the segment is properly formed and that the information in that descriptor is reasonable. Having collected the needed information you can create the descriptor and then begin a new segment as shown below. #include "SpiceUsr.h" . . . spkpds_c ( body, center, frame, type, first, last, descr ); dafbna_c ( handle, descr, segid );
1) The error SPICE(BARYCENTEREPHEM) is signaled if the value of body is 0. 2) The error SPICE(BODYANDCENTERSAME) is signaled if the values of body and center are the same. 3) The error SPICE(INVALIDREFFRAME) is signaled if frame is not one of the known SPICE reference frames. 4) The error SPICE(BADDESCRTIMES) is signaled if first is greater than or equal to LAST 5) The error SPICE(UNKNOWNSPKTYPE) is signaled if the value of type is outside the range 1 to 1000 (inclusive). This does not ensure that the type is a legitimate SPK segment type, but it is a simple check that helps avoid problems that arise from uninitialized values or improperly ordered calling arguments.
N.J. Bachman (JPL) K.R. Gehringer (JPL) W.L. Taber (JPL)
-CSPICE Version 1.0.0, 19-JUL-1999 (NJB) (KRG) (WLT)
Validate and pack an SPK segment descriptor