- Abstract
Write a type 2 segment to a C-kernel.
- Required_Reading
CK
DAF
SCLK
- Brief_I/O
Variable I/O Description
-------- --- --------------------------------------------------
handle I Handle of an open CK file.
begtim I The beginning encoded SCLK of the segment.
endtim I The ending encoded SCLK of the segment.
inst I The NAIF instrument ID code.
ref I The reference frame of the segment.
segid I Segment identifier.
nrec I Number of pointing records.
start I Encoded SCLK interval start times.
stop I Encoded SCLK interval stop times.
quats I Quaternions representing instrument pointing.
avvs I Angular velocity vectors.
rates I Number of seconds per tick for each interval.
- Detailed_Input
handle is the handle of the CK file to which the segment will
be written. The file must have been opened with write
access.
begtim is the beginning encoded SCLK time of the segment. This
value should be less than or equal to the first START
time in the segment.
endtim is the encoded SCLK time at which the segment ends.
This value should be greater than or equal to the last
STOP time in the segment.
inst is the NAIF integer ID code for the instrument.
ref is a character string that specifies the
reference frame of the segment. This should be one of
the frames supported by the SPICELIB routine NAMFRM
which is an entry point of FRAMEX.
segid is the segment identifier. A CK segment identifier may
contain up to 40 characters.
nrec is the number of pointing intervals that will be
written to the segment.
start are the start times of each interval in encoded
spacecraft clock. These times must be strictly
increasing.
stop are the stop times of each interval in encoded
spacecraft clock. These times must be greater than
the START times that they correspond to but less
than or equal to the START time of the next interval.
quats are the quaternions representing the C-matrices
associated with the start times of each interval.
AVVS are the angular velocity vectors for each interval.
RATES are the number of seconds per encoded spacecraft clock
tick for each interval.
In most applications this value will be the same for
each interval within a segment. For example, when
constructing a predict C-kernel for Mars Observer, the
rate would be 1/256 for each interval since this is
the smallest time unit expressible by the MO clock. The
nominal seconds per tick rates for Galileo and Voyager
are 1/120 and 0.06 respectively.
- Detailed_Output
None. See Files section.
- Parameters
None.
- Particulars
For a detailed description of a type 2 CK segment please see the
CK Required Reading.
This routine relieves the user from performing the repetitive
calls to the DAF routines necessary to construct a CK segment.
- Examples
This example writes a predict type 2 C-kernel segment for
the Mars Observer spacecraft bus to a previously opened CK file
attached to handle.
/.
Assume arrays of quaternions, angular velocities, and interval
start and stop times are produced elsewhere.
./
.
.
.
/.
The nominal number of seconds in a tick for MO is 1/256.
./
sectik = 1. / 256.;
for ( i = 0; i < nrec; i++ )
{
rate[i] = sectik;
}
/.
The subroutine ckw02_c needs the following components of the
segment descriptor:
1) SCLK limits of the segment.
2) Instrument code.
3) Reference frame.
./
begtim = start [ 0 ];
endtim = stop [nrec-1];
inst = -94000;
ref = "j2000";
segid = "mo predict seg type 2";
/.
Write the segment.
./
ckw02_c ( handle, begtim, endtim, inst, ref, segid,
nrec, start, stop, quat, avv, rates );
- Restrictions
None.
- Exceptions
1) If handle is not the handle of a C-kernel opened for writing
the error will be diagnosed by routines called by this
routine.
2) If segid is more than 40 characters long, the error
SPICE(SEGIDTOOLONG) is signalled.
3) If segid contains any nonprintable characters, the error
SPICE(NONPRINTABLECHARS) is signalled.
4) If the first START time is negative, the error
SPICE(INVALIDSCLKTIME) is signalled. If any of the subsequent
START times are negative the error SPICE(TIMESOUTOFORDER)
will be signalled.
5) If any of the STOP times are negative, the error
SPICE(DEGENERATEINTERVAL) is signalled.
6) If the STOP time of any of the intervals is less than or equal
to the START time, the error SPICE(DEGENERATEINTERVAL) is
signalled.
7) If the START times are not strictly increasing, the
error SPICE(TIMESOUTOFORDER) is signalled.
8) If the STOP time of one interval is greater than the START
time of the next interval, the error SPICE(BADSTOPTIME)
is signalled.
9) If begtim is greater than START[0] or endtim is less than
STOP[NREC-1], the error SPICE(INVALIDDESCRTIME) is
signalled.
10) If the name of the reference frame is not one of those
supported by the routine NAMFRM, the error
SPICE(INVALIDREFFRAME) is signalled.
11) If nrec, the number of pointing records, is less than or
equal to 0, the error SPICE(INVALIDNUMRECS) is signalled.
- Files
This routine adds a type 2 segment to a C-kernel. The C-kernel
may be either a new one or an existing one opened for writing.
- Author_and_Institution
N.J. Bachman (JPL)
K.R. Gehringer (JPL)
J.M. Lynch (JPL)
- Literature_References
None.
- Version
-CSPICE Version 1.2.0, 28-AUG-2001 (NJB)
Changed prototype: inputs start, stop, sclkdp, quats,
and avvs are now const-qualified. Implemented interface
macros for casting these inputs to const.
-CSPICE Version 1.1.0, 08-FEB-1998 (NJB)
References to C2F_CreateStr_Sig were removed; code was
cleaned up accordingly. String checks are now done using
the macro CHKFSTR.
-CSPICE Version 1.0.0, 25-OCT-1997 (NJB)
Based on SPICELIB Version 2.0.0, 28-DEC-1993 (WLT)
- Index_Entries
write ck type_2 pointing data segment
- Link to routine source