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_vupack

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


Abstract


   CSPICE_VUPACK unpacks three scalar components from a vector.

I/O


   Given:

      v        a double precision 3-dimensional vector.

               help, v
                  DOUBLE = Array[3]

   the call:

      cspice_vupack, v, x, y, z

   returns:

      x,
      y,
      z        the double precision scalar components of the vector `v'.

               help, x
                  DOUBLE = Scalar
               help, y
                  DOUBLE = Scalar
               help, z
                  DOUBLE = Scalar

               The following equalities hold:

                  v[0] = x
                  v[1] = y
                  v[2] = z

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) Suppose that you have an instrument kernel that provides,
      within a single keyword, the three frequencies used by the
      instrument, and that you want to use these frequencies
      independently within your code.

      The following code example demonstrates how to use cspice_vupack
      to get these frequencies into independent scalar variables.

      Use the kernel shown below, an IK defining the three
      frequencies used by an instrument with NAIF ID -999001.


         KPL/IK

         File name: vupack_ex1.ti

         The keyword below define the three frequencies used by a
         hypothetical instrument (NAIF ID -999001). They correspond
         to three filters: red, green and blue. Frequencies are
         given in micrometers.

         \begindata

            INS-999001_FREQ_RGB   = (  0.65,  0.55, 0.475 )
            INS-999001_FREQ_UNITS = ( 'MICROMETERS'       )

         \begintext


         End of IK


      Example code begins here.


      PRO vupack_ex1

         ;;
         ;; Local parameters.
         ;;
         IKNAME =   'vupack_ex1.ti'
         KEYWRD =   'INS-999001_FREQ_RGB'

         ;;
         ;; Load the instrument kernel.
         ;;
         cspice_furnsh, IKNAME

         ;;
         ;; Get the frequency data from the kernel pool.
         ;;
         cspice_gdpool, KEYWRD, 0L, 3L, ddata, found

         if ( found ) then begin

            cspice_vupack, ddata, red, green, blue
            print, format='(A,F6.2)', 'Blue  (nm): ', blue  * 1000.D0
            print, format='(A,F6.2)', 'Green (nm): ', green * 1000.D0
            print, format='(A,F6.2)', 'Red   (nm): ', red   * 1000.D0

         endif else begin

            print, 'No data found in the kernel pool for ', KEYWRD

         endelse

         ;;
         ;; It's always good form to unload kernels after use,
         ;; particularly in IDL due to data persistence.
         ;;
         cspice_kclear

      END


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


      Blue  (nm): 475.00
      Green (nm): 550.00
      Red   (nm): 650.00


Particulars


   Basically, this is just shorthand notation for the common
   sequence

      x = v[0]
      y = v[1]
      z = v[2]

   The routine is useful largely for two reasons. First, it
   reduces the chance that the programmer will make a "cut and
   paste" mistake, like

      x = v[0]
      y = v[0]
      z = v[0]

   Second, it makes conversions between equivalent units simpler,
   and clearer. For instance, the sequence

      x = v[0] * cspice_rpd()
      y = v[1] * cspice_rpd()
      z = v[2] * cspice_rpd()

   can be replaced by the (nearly) equivalent sequence

      cspice_vscl, cspice_rpd(), v, v
      cspice_vupack, v, x, y, z

Exceptions


   1)  If the input argument `v' is undefined, an error is signaled
       by the IDL error handling system.

   2)  If the input argument `v' is not of the expected type, or it
       does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

   3)  If any of the output arguments, `x', `y' or `z', is not a
       named variable, an error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.0.3, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added complete
       code example.

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

       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.2, 13-JUN-2011 (EDW)

       Edits to comply with NAIF standard for Icy headers.

   -Icy Version 1.0.1, 09-DEC-2005 (EDW)

       Added -Examples section.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   unpack three scalar components from a vector



Fri Dec 31 18:43:09 2021