[Spice_discussion] listing names and times of BSP/BCK segments

Nat Bachman Nathaniel.Bachman at jpl.nasa.gov
Thu Jan 18 01:16:54 PST 2007

Hi Gregory,

A higher-level view of the coverage of SPK and CK files
is provided by the routines


These routines return SPICE windows (structures in C, arrays in
Fortran) representing the time coverage of data for specified
objects.  The CK interface allows you to obtain the coverage
for an object at either the segment or interpolation interval level.

However, these routines don't do specifically what you asked for:
they don't show you the coverage of individual segments.  The
routines you cited, dafgs_c and dafgn_c, as well as dafus_c,
are the primary interfaces for obtaining that information.

To use dafus_c to unpack SPK or CK segment descriptors (aka segment
"summaries"), the values of ND and NI are 2 and 6 respectively.  For
binary PCKs, the values are 2 and 5. (These values are discussed in the
SPK, CK, and PCK Required Reading.)  You can obtain the values of ND and NI
for any DAF by calling DAFRFR (available only as an f2c'd routine
in CSPICE).  However these parameter values are fixed for SPKs, CKs
and binary PCKs; one can consider the values part of the published API.

For SPKs, there is a higher-level routine than DAFUS for examining
segment descriptors:  SPKUDS.  There currently is no analog of
SPKUDS for CKs or binary PCKs.

A few notes about CK segment descriptors:

  - Time values are expressed in encoded SCLK, not TDB.
    The applicable clock is that associated with the
    instrument/structure whose pointing is given by the
    segment of interest.

    CKCOV, by the way, returns coverage information expressed
    as either encoded SCLK or TDB seconds past J2000, as
    specified by the caller.

  - CK segment coverage intervals can be misleading, since
    CK segments can have internal coverage gaps.
    In some cases, it can be more useful to know the
    coverage of interpolation intervals than of the segments.

  -Nat Bachman (JPL/NAIF)

 Nathaniel.Bachman at jpl.nasa.gov

Gregory Fruth wrote:
> Hi SPICE Discussion,
> Is there a handy API for retrieving the (string) names
> and start/end times of the segments in a BSP or BCK file?
> Currently I can do this using dafgn_c and dafgs_c, but
> decoding the info returned by dafgs_c seems to require
> some array sizes that are hard-coded into the spk* and ck*
> APIs.

More information about the Spice_discussion mailing list