Index Page
cspice_scencd
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_SCENCD encodes a character representation of spacecraft
   clock time to the corresponding double precision number. 

   For important details concerning this module's function, please refer to
   the CSPICE routine scencd_c.

I/O

   
   Given:
   
      sc       the scalar integer NAIF ID of the spacecraft whose 
               clock's time is being encoded.

      sclkch   the scalar string or N-vector of strings representing the 
               'sc' spacecraft's clock count.
   
   the call:
   
      cspice_scencd, sc, sclkch, sclkdp
   
   returns:
   
      sclkdp   the scalar double precision or N-vector of doubles 
               representing the encoding of 'sclkch' for 'sc'.

               'sclkdp' returns with the same measure of vectorization (N)
               as 'sclkch'.
           

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.

      ;;
      ;; Assign values for the spacecraft ID (Voyager2),
      ;; the SCLK kernel, and a double precision
      ;; encodings of SCLK strings
      ;;
      SC         = -32
      SCLK       = '/kernels/voyager2/sclk/vg200004.tsc'
      timein     = 985327950.0d

      ;;
      ;; Load the kernel files.
      ;;
      cspice_furnsh, SCLK

      ;;
      ;; Convert the Voyager encoded SCLK to an
      ;; SCLK string.
      ;;
      cspice_scdecd, SC, timein, sclkch

      ;;
      ;; Convert the SCLK string to double precision form.
      ;; The output value should match the original.
      ;;
      cspice_scencd, SC, sclkch, sclkdp

      print, 'Scalar:'
      print, format='(A10,F20.8)', 'Original: ', timein
      print, format='(A10,A20  )', 'SCLKCH  : ', sclkch
      print, format='(A10,F20.8)', 'Decoded : ', sclkdp
      print

      ;;
      ;; Convert a vector of SCLK values.
      ;;
      timein = [ 985327950.0d, $
                 985553550.0d, $
                 985901583.0d, $
                 986447183.0d, $
                 9136032015.D]

      ;;
      ;; Convert the SCLK dps to the string representation,
      ;; then convert to the dp form. As before, the 
      ;; output value should match the original.
      ;;
      cspice_scdecd, SC, timein, sclkch
      cspice_scencd, SC, sclkch, sclkdp

      print, 'Vector:'
      for i=0, n_elements(timein)-1 do begin

         print, format='(A10,F20.8)', 'Original: ', timein[i]
         print, format='(A10,A20  )', 'SCLKCH  : ', sclkch[i]
         print, format='(A10,F20.8)', 'Decoded : ', sclkdp[i]
         print

      endfor

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

   IDL outputs:
   
      Scalar:
      Original:   985327950.00000000
      SCLKCH  :       2/20538:39:768
      Decoded :   985327950.00000000

      Vector:
      Original:   985327950.00000000
      SCLKCH  :       2/20538:39:768
      Decoded :   985327950.00000000

      Original:   985553550.00000000
      SCLKCH  :       2/20543:21:768
      Decoded :   985553550.00000000

      Original:   985901583.00000000
      SCLKCH  :       2/20550:37:001
      Decoded :   985901583.00000000

      Original:   986447183.00000000
      SCLKCH  :       2/20561:59:001
      Decoded :   986447183.00000000

      Original:  9136032015.00000000
      SCLKCH  :       5/04563:00:001
      Decoded :  9136032015.00000000

Particulars


   None.

Required Reading


   ICY.REQ
   SCLK.REQ

Version


   -Icy Version 1.1.1, 05-FEB-2008, EDW (JPL)

      Edited I/O section, replaced comment
      
         "returns with the same order"
      
      with
      
         "returns with the same measure of vectorization"

      Removed a superfluous -Version tag, edited -I/O section. 

   -Icy Version 1.1.0, 12-SEP-2004, EDW (JPL)

       Added capability to process 'sclkch' as vector
       input returning vector 'sclkdp' on output.

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

Index_Entries

 
   encode spacecraft_clock 
 



Wed Apr  5 17:58:03 2017