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.

I/O


   Given:

      sc       the NAIF ID of the spacecraft clock whose time is 
               being encoded.

               [1,1] = size(sc); int32 = class(sc)               

      sclkch   string value(s) representing spacecraft 'sc' clock count.

               [n,c1] = size(sclkch); char = class(sclkch)

                  or

               [1,n] = size(sclkch); cell = class(sclkch)

   the call:

      sclkdp = cspice_scencd( sc, sclkch )

   returns:

      sclkdp   the encoding(s) of 'sclkch' for 'sc'.

               [1,n] = size(sclkdp); double = class(sclkdp)

               'sclkdp' returns with the same vectorization measure, 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.0;

      %
      % Load the kernel files.
      %
      cspice_furnsh( SCLK )

      %
      % Convert the Voyager encoded SCLK to an
      % SCLK string.
      %
      sclkch = cspice_scdecd( SC, timein );

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

      disp( 'Scalar:' )

      txt = sprintf( 'Original: %20.8f', timein );
      disp( txt )

      txt = sprintf( ['SCLKCH  : ' sclkch] );
      disp( txt )

      txt = sprintf( 'Decoded : %20.8f', sclkdp );
      disp( txt )

      disp( ' ' )

      %
      % Convert a vector of SCLK values.
      %
      timein = [ 985327950.0, ...
                 985553550.0, ...
                 985901583.0, ...
                 986447183.0, ...
                 9136032015.0 ];

      %
      % Convert the SCLK double precision values to the string
      % representation, then convert to the dp form. As before, the
      % output value should match the original.
      %
      sclkch = cspice_scdecd( SC, timein );
      sclkdp = cspice_scencd( SC, sclkch );

      disp( 'Vector:' )
      for i=1:5

         txt = sprintf( 'Original: %20.8f', timein(i) );
         disp( txt )

         txt = sprintf( ['SCLKCH  : ' sclkch(i,:) ] );
         disp( txt )

         txt = sprintf( 'Decoded : %20.8f', sclkdp(i) );
         disp( txt )

         disp( ' ' )

      end

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

   MATLAB 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


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

   MICE.REQ
   SCLK.REQ

Version


   -Mice Version 1.0.1, 06-JAN-2015, EDW (JPL)

       Edited I/O section to conform to NAIF standard for Mice documentation.

   -Mice Version 1.0.0, 18-APR-2006, EDW (JPL)

Index_Entries


   encode spacecraft_clock


Wed Apr  5 18:00:34 2017