CSPICE_CKOBJ finds the set of ID codes of all objects in a
specified CK file.
For important details concerning this module's function, please refer to
the CSPICE routine ckobj_c.
ck the scalar string name of an C-kernel.
ids is an initialized Icy set data structure. 'ids' optionally
may contain a set of CK ID codes on input; on output, the data
already present in 'ids' will be combined with CK ID code set
found for the file 'ck'.
cspice_ckobj, ck, ids
ids an Icy set data structure which contains
the union of its contents upon input with the set
of CK ID codes of each object for which ephemeris
data are present in the indicated CK file. The
elements of Icy sets are unique; hence each
ID code in `ids' appears only once, even if the CK
file contains multiple segments for that ID code.
The user must create 'ids' using cspice_celld. (Note:
a set is a type of cell).
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
;; From a given CK file, retrieve the list of objects listed
;; in the file then retrieve the time coverage for each object.
;; Local parameters...
SPICEFALSE = 0B
MAXIV = 1000
WINSIZ = 2 * MAXIV
TIMLEN = 51
MAXOBJ = 1000
;; ...and kernels from the Cassini mission.
CK = '/kernels/cassini/ck/990817_990818ra.bc'
SCLK = '/kernels/cassini/sclk/cas00085.tsc'
;; Local variables
cover = cspice_celld( WINSIZ )
ids = cspice_celli( MAXOBJ )
;; Load a standard kernel set.
;; Find the set of objects in the CK file.
cspice_ckobj, CK, ids
;; We want to display the coverage for each object. Loop over
;; the contents of the ID code set, find the coverage for
;; each item in the set, and display the coverage.
for i=0, cspice_card( ids ) - 1 do begin
;; Find the coverage window for the current object, 'i'.
;; Empty the coverage window each time
;; so we don't include data for the previous object.
obj = ids.base[ ids.data + i ]
cspice_scard, 0L, cover
cspice_ckcov, CK, obj, SPICEFALSE, 'INTERVAL', 0.D, 'TDB', cover
;; Get the number of intervals in the coverage window.
niv = cspice_wncard( cover )
;; Display a simple banner.
print, 'Coverage for object:', obj
;; Convert the coverage interval start and stop times to TDB
;; calendar strings.
for j=0, niv-1 do begin
;; Get the endpoints of the jth interval.
cspice_wnfetd, cover, j, b, e
;; Convert the endpoints to TDB calendar
;; format time strings and display them.
;; Pass the endpoints in an array, [b,e],
;; so cspice_timout returns an array of time
cspice_timout, [b,e], $
'YYYY MON DD HR:MN:SC.### (TDB) ::TDB', $
print, 'Interval: ', j
print, 'Start : ', timstr
print, 'Stop : ', timstr
;; It's always good form to unload kernels after use,
;; particularly in IDL due to data persistence.
Coverage for object: -82000
Start : 1999 AUG 17 17:31:05.601 (TDB)
Stop : 1999 AUG 17 23:06:46.222 (TDB)
Start : 1999 AUG 17 23:06:49.472 (TDB)
Stop : 1999 AUG 18 06:07:10.057 (TDB)
Start : 1999 AUG 18 06:07:13.307 (TDB)
Stop : 1999 AUG 18 11:53:21.924 (TDB)
Start : 1999 AUG 18 11:53:25.174 (TDB)
Stop : 1999 AUG 18 13:31:05.135 (TDB)
This routine provides an API via which applications can determine
the set of objects for which there are pointing data in a
specified CK file.
-Icy Version 1.0.3, 04-APR-2012, EDW (JPL)
Explicitly described ID variables as "CK IDs."
-Icy Version 1.0.2, 30-NOV-2007, NJB, EDW (JPL)
Corrected bug in the Examples section program:
program now empties the coverage window prior to collecting
data for the current object. Updated example to
use cspice_wncard rather than cspice_card.
-Icy Version 1.0.1, 27-FEB-2007, EDW (JPL)
Replaced cspice_unload call in example section with
-Icy Version 1.0.0, 30-DEC-2004, EDW (JPL)
find id codes in ck file