CSPICE_PCKFRM returns the set of reference frame class ID codes of
all frames in a specified binary PCK file.
For important details concerning this module's function, please refer to
the CSPICE routine pckfrm_c.
pck the name of a binary PCK file.
ids is an initialized Icy set data structure.
'ids' optionally may contain a set of ID codes on
input; on output, the data already present in
'ids' will be combined with ID code set found for the
cspice_pckfrm, pck, ids
ids an Icy set data structure which contains
the union of its contents upon input with the set
of ID codes of each frame class for which data are present
in the indicated PCK file. The elements of Icy sets are unique;
hence each ID code in `ids' appears only once, even if the PCK
file contains multiple segments for that ID code.
The user must create 'ids' using cspice_celli. (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.
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 set of reference frames for which there are data in a
specified PCK file.
-Icy Version 1.0.0, 04-JAN-2017, ML (JPL), EDW (JPL)
find frame class id codes of frames in binary pck file