Index Page
cspice_scdecd
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_SCDECD converts a double precision encoding of spacecraft
   clock time into a string representation.

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

I/O

   
   Given:
   
      sc       the scalar integer NAIF ID of the spacecraft whose 
               clock's time is being encoded.
               
      sclkdp   the double precision scalar or N-vector encoding of 
               a clock time in units of ticks since the spacecraft
               clock start time.

   the call:
   
      cspice_scdecd, sc, sclkdp, sclkch
   
   returns:
   
      sclkch   the scalar or N-vector string representation of the 
               clock count 'sclkdp' for 'sc'

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

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),
      ;; s-clock kernels, and several SCLK time
      ;; strings
      ;;
      SC     = -32
      SCLK   = '/kernels/voyager2/sclk/vg200004.tsc'
      sclkin =  '2/20538:39:768'

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

      ;;
      ;; Convert the Voyager SCLK strings to the
      ;; corresponding double precision value.
      ;;
      cspice_scencd, SC, sclkin, timein

      ;;
      ;; Convert the double precision value of
      ;; the SCLK count back to string. The output
      ;; string should nearly match the original 
      ;; with regards to roundoff and minus any 
      ;; embedded spaces.
      ;;
      cspice_scdecd, SC, timein, sclkch

      print, 'Scalar:'
      print,                       'Original: ' + sclkin
      print, format='(A10,F20.8)', 'Encoded : ',  timein
      print,                       'Decoded : ' + sclkch
      print

      ;;
      ;; Convert a vector of SCLK strings.
      ;;
      sclkin =  [ '2/20538:39:768' ,$
                  '2/20543:21:768' ,$
                  '2/20550:37'     ,$
                  '2/20561:59'     ,$
                  '5/04563:00:001'  ]

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

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

         print,                       'Original: ' + sclkin[i]
         print, format='(A10,F20.8)', 'Encoded : ',  timein[i]
         print,                       'Decoded : ' + sclkch[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: 2/20538:39:768
      Encoded :   985327950.00000000
      Decoded : 2/20538:39:768

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

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

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

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

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

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"
      
   -Icy Version 1.1.0, 12-SEP-2004, EDW (JPL)

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

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

Index_Entries

 
   decode spacecraft_clock 
 



Wed Apr  5 17:58:03 2017