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_dafps

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


Abstract


   CSPICE_DAFPS packs (assembles) an array summary from its double precision
   and integer components.

I/O


   Given:

      dc       the double precision components of the summary.

               help, dc
                  DOUBLE = Array[ND]

      ic       the integer components of the summary.

               help, ic
                  LONG = Array[NI]

   the call:

      cspice_dafps, dc, ic, sum

   returns:

      sum      an array summary containing the components in `dc' and `ic'.

               help, sum
                  DOUBLE = Array[N]

               This identifies the contents and location of a single array
               within a DAF.

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) The following code example extracts the SCLK time, boresight
      vector, and angular velocity vector for each pointing instance
      in the first segment in a CK file that contains segments of
      data type 3.

      Use the CK kernel below, available in the Venus Express PDS
      archives, as input for the code example.

         VEX_BOOM_V01.BC

      Example code begins here.


      PRO cknr03_ex1

         ;;
         ;; First load the file (it may also be opened by using
         ;; cspice_cklpf).
         ;;
         cspice_dafopr, 'VEX_BOOM_V01.BC', handle

         ;;
         ;; Begin forward search.  Find the first array.
         ;;
         cspice_dafbfs, handle
         cspice_daffna, found

         ;;
         ;; Get segment descriptor.
         ;;
         ;; Unpack the segment descriptor into its double precision
         ;; and integer components.
         ;;
         cspice_dafgs, 2L, 6L, dcd, icd
         cspice_dafps, dcd, icd, descr

         ;;
         ;; The data type for a segment is located in the third
         ;; integer component of the descriptor.
         ;;
         if ( icd[2] eq 3L ) then begin

            ;;
            ;; Does the segment contain `av' data?
            ;;
            avseg =  ( icd[3] eq 1L )

            ;;
            ;; How many records does this segment contain?
            ;;
            cspice_cknr03, handle, descr, nrec

            for i=1L, nrec do begin

               ;;
               ;; Get the ith pointing instance in the segment.
               ;;
               cspice_ckgr03, handle, descr, i, record

               ;;
               ;; Unpack `record' into the time, quaternion, and av.
               ;;
               sclkdp = record[0]

               quat   = record[1:4]

               if ( avseg ) then begin

                  av = record[5:7]

               endif

               ;;
               ;; The boresight vector is the third row of the
               ;; C-matrix.
               ;;
               cspice_q2m, quat, cmat

               bore   = cmat[*,2]

               ;;
               ;; Write out the results.
               ;;
               print, format='(A,I2)', 'Record: ', i
               print, format='(A,F25.6)',  '   SCLK time       :', sclkdp
               print, format='(A,3F14.9)', '   Boresight       :', bore

               if ( avseg ) then begin

                  print, format='(A,3F14.9)', '   Angular velocity:', av

               endif
               print

            endfor

         endif

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Record:  1
         SCLK time       :           2162686.710986
         Boresight       :  -0.999122830   0.000000000   0.041875654
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  2
         SCLK time       :       54160369751.715164
         Boresight       :  -0.999122830   0.000000000   0.041875654
         Angular velocity:   0.000000000   1.176083393   0.000000000

      Record:  3
         SCLK time       :       54160454948.487686
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  4
         SCLK time       :      299264885854.937805
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  5
         SCLK time       :     2366007685832.532227
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  6
         SCLK time       :     4432750485810.126953
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  7
         SCLK time       :     6505155594828.757812
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  8
         SCLK time       :     8571898394806.352539
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record:  9
         SCLK time       :    10638641194783.947266
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record: 10
         SCLK time       :    12705383994761.541016
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record: 11
         SCLK time       :    14777789103780.169922
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record: 12
         SCLK time       :    16844531903757.763672
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000

      Record: 13
         SCLK time       :    18911274703735.359375
         Boresight       :   0.000000000   0.000000000   1.000000000
         Angular velocity:   0.000000000   0.000000000   0.000000000


Particulars


   The components of array summaries are packed into double precision arrays
   for reasons outlined in the DAF required reading. Two routines,
   cspice_dafps (pack summary) and cspice_dafus (unpack summary) are
   provided for packing and unpacking summaries.

   The total size of the summary is

           (NI - 1)
      ND + -------- + 1
               2

   double precision words (where the sizes of `dc' and `ic', ND and NI,
   are non-negative).

Exceptions


   1)  If `nd', the number of double precision components, is zero or
       negative, no DP components are stored.

   2)  If `ni', the number of integer components, is zero or
       negative, no integer components are stored.

   3)  If the total size of the summary is greater than 125 double
       precision words, some components may not be stored. See
       -Particulars for details.

   4)  If any of the input arguments, `dc' or `ic', is undefined, an
       error is signaled by the IDL error handling system.

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

   6)  If the output argument `sum' is not a named variable, an error
       is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   DAF.REQ
   ICY.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)

Version


   -Icy Version 1.0.0, 17-NOV-2021 (JDR)

Index_Entries


   pack DAF summary



Fri Dec 31 18:43:02 2021