CSPICE_PCKCOV returns the coverage window for a specified reference
frame in a specified binary PCK file.
For important details concerning this module's function, please refer to
the CSPICE routine pckcov_c.
pck is the name of a binary PCK file.
idcode is the integer frame class ID code of a PCK reference
frame for which data are expected to exist in the
specified PCK file.
cover is an initialized ICY window data structure.
'cover' may optionally contain coverage data on
input; on output, the data already present in
'cover' will be combined with coverage found for the
object designated by 'idcode' in the file 'pck'.
The user must create 'cover' using cspice_celld.
cspice_pckcov, pck, idcode, cover
cover is an Icy window data structure which
represents the merged coverage for `idcode'. This is
the set of time intervals for which data for
'idcode' are present in the file 'pck', merged with
the set of time intervals present in 'cover' on
input. The merged coverage is represented as the
union of one or more disjoint time intervals. The
window 'cover' contains the pairs of endpoints of
The interval endpoints contained in 'cover' are
ephemeris times, expressed as seconds past J2000
See the Examples section below for a complete
example program showing how to retrieve the
endpoints from 'cover'.
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.
Use a simple routine to display the coverage for each object in a
specified PCK file(s). Find the set of objects in the file(s); for
each object, find and display the coverage.
PRO PCKFRM_T, pck
;; From a given PCK file, retrieve the list of objects listed
;; in the file then retrieve the time coverage for each object.
;; Local parameters...
MAXIV = 1000
WINSIZ = 2 * MAXIV
TIMLEN = 51
MAXOBJ = 1000
LSK = 'naif0012.tls';
;; Local variables
cover = cspice_celld( WINSIZ )
ids = cspice_celli( MAXOBJ )
;; Note, neither cspice_pckcov or cspice_pckfrm requires this
;; kernel to function. We need the data for output time
;; Find the set of frames in the pck file.
for i = 1, n_elements(pck) do begin
cspice_pckfrm, pck[i-1], ids
;; We want to display the coverage for each frame. 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 frame, '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
for k = 1, n_elements(pck) do begin
cspice_pckcov, pck[k-1], obj, cover
;; Get the number of intervals in the coverage window.
niv = cspice_card( cover ) / 2
;; 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
;; Empty the kernel pool.
IDL> pckfrm_t, [ 'earth_latest_high_prec.bpc', $
Coverage for object: 3000
Start : 2000 JAN 01 00:01:04.183 (TDB)
Stop : 2017 MAR 27 00:01:09.185 (TDB)
Coverage for object: 31006
Start : 1900 JAN 01 00:00:00.000 (TDB)
Stop : 2051 JAN 01 00:00:00.000 (TDB)
This routine provides an API via which applications can determine
the coverage a specified PCK file provides for a specified
PCK class reference frame.
-Icy Version 1.0.0, 04-JAN-2017, ML (JPL), EDW (JPL)
get coverage window for binary pck reference frame
get coverage start and stop time for binary pck frame