Index Page
cspice_pckfrm
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   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.

I/O


   Given:

      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
              file 'pck'.

   the call:

      cspice_pckfrm, pck, ids

   returns:

      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).

Examples


   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
         ;; conversion.
         ;;
         cspice_furnsh, LSK

         ;;
         ;; Find the set of frames in the pck file.
         ;;
         for i = 1, n_elements(pck) do begin
            cspice_pckfrm, pck[i-1], ids
         endfor

         ;;
         ;; 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
            endfor

            ;;
            ;; Get the number of intervals in the coverage window.
            ;;
            niv = cspice_card( cover ) / 2

            ;;
            ;; Display a simple banner.
            ;;
            print, "========================================"
            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
               ;; strings.
               ;;
               cspice_timout, [b,e], $
                              "YYYY MON DD HR:MN:SC.### (TDB) ::TDB",  $
                              TIMLEN ,$
                              timstr

               print, "Interval: ", j
               print, "Start   : ", timstr[0]
               print, "Stop    : ", timstr[1]
               print

            endfor

         endfor

         ;;
         ;; Empty the kernel pool.
         ;;
         cspice_kclear

      END

   IDL outputs:

      IDL> pckfrm_t, [ 'earth_latest_high_prec.bpc', $
                       'moon_pa_de421_1900-2050.bpc']

      ========================================
      Coverage for object:        3000
      Interval:        0
      Start   : 2000 JAN 01 00:01:04.183 (TDB)
      Stop    : 2017 MAR 27 00:01:09.185 (TDB)

      ========================================
      Coverage for object:       31006
      Interval:        0
      Start   : 1900 JAN 01 00:00:00.000 (TDB)
      Stop    : 2051 JAN 01 00:00:00.000 (TDB)

Particulars


   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.

Required Reading


   ICY.REQ
   CELLS.REQ
   DAF.REQ
   SETS.REQ
   PCK.REQ

Version


   -Icy Version 1.0.0, 04-JAN-2017, ML (JPL), EDW (JPL)

Index_Entries


   find frame class id codes of frames in binary pck file



Wed Apr  5 17:58:02 2017