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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_PCKCOV finds the coverage window for a specified reference frame
   in a specified binary PCK file.

I/O


   Given:

      pckfnm   the name of a binary PCK file.

               help, pckfnm
                  STRING = Scalar

      idcode   the integer frame class ID code of a PCK reference frame for
               which data are expected to exist in the specified PCK file.

               help, idcode
                  LONG = Scalar

      cover    an initialized SPICE window data structure.

               help, cover
                  STRUCT = cspice_celld(2*N)

               `cover' optionally may contain coverage data on input; on
               output, the data already present in `cover' will be combined
               with coverage found for the reference frame designated by
               `idcode' in the file `pckfnm'.

               If `cover' contains no data on input, its size and
               cardinality still must be initialized.

               The user must create `cover' using cspice_celld.

   the call:

      cspice_pckcov, pckfnm, idcode, cover

   returns:

      cover    a SPICE window data structure which represents the merged
               coverage for the reference frame having frame class ID
               `idcode'.

               help, cover
                  STRUCT = cspice_celld(2*N)

               This is the set of time intervals for which data for `idcode'
               are present in the file `pckfnm', 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 these
               intervals.

               The interval endpoints contained in `cover' are ephemeris
               times, expressed as seconds past J2000 TDB.

               See the -Examples section below for a complete example
               program showing how to retrieve the endpoints from `cover'.

Parameters


   None.

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.

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

      Use the LSK kernel below to load the leap seconds and time
      constants required for the time conversions.

         naif0012.tls


      Example code begins here.


      PRO pckcov_ex1, pcknam

         ;;
         ;; 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(pcknam) do begin
            cspice_pckfrm, pcknam[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(pcknam) do begin
               cspice_pckcov, pcknam[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 frame:", 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


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, with the following variable as input

         pcknam = [ 'earth_720101_070426.bpc', 'moon_pa_de421_1900-2050.bpc' ]

      the output was:


      ========================================
      Coverage for frame:        3000
      Interval:        0
      Start   : 1962 JAN 20 00:00:41.184 (TDB)
      Stop    : 2007 APR 26 00:01:05.185 (TDB)

      ========================================
      Coverage for frame:       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 coverage a specified PCK file provides for a specified PCK
   class reference frame.

Exceptions


   1)  If the input file has transfer format, the error
       SPICE(INVALIDFORMAT) is signaled by a routine in the call tree
       of this routine.

   2)  If the input file is not a transfer file but has architecture
       other than DAF, the error SPICE(INVALIDARCHTYPE) is signaled
       by a routine in the call tree of this routine.

   3)  If the input file is a binary DAF file of type other than PCK,
       the error SPICE(INVALIDFILETYPE) is signaled by a routine in
       the call tree of this routine.

   4)  If the PCK file cannot be opened or read, an error is signaled
       by a routine in the call tree of this routine. The output
       window will not be modified.

   5)  If the size of the output window argument `cover' is
       insufficient to contain the actual number of intervals in the
       coverage window for `idcode', an error is signaled by a routine
       in the call tree of this routine.

   6)  If any of the input arguments, `pckfnm', `idcode' or `cover',
       is undefined, an error is signaled by the IDL error handling
       system.

   7)  If any of the input arguments, `pckfnm', `idcode' or `cover',
       is not of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

Files


   This routine reads a PCK file.

Restrictions


   1)  If an error occurs while this routine is updating the window
       `cover', the window may be corrupted.

Required_Reading


   DAF.REQ
   ICY.REQ
   PCK.REQ
   TIME.REQ
   WINDOWS.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   M. Liukis           (JPL)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.1.0, 25-AUG-2021 (JDR)

       Changed the input argument name "pck" to "pckfnm" for consistency
       with other routines.

       Edited the header to comply with NAIF standard.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

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

Index_Entries


   get coverage window for binary PCK reference frame
   get coverage start and stop time for binary PCK frame



Fri Dec 31 18:43:06 2021