Index Page
cspice_str2et
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_STR2ET converts a string representing an epoch to a 
   double precision value representing the number of TDB seconds 
   past the J2000 epoch corresponding to the input epoch.

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

I/O

   
   Given:
   
      str   any scalar or array of strings recognized by SPICE 
            as an epoch.
   
   the call:

      cspice_str2et, str, et

   returns:

      et   the scalar or N-vector of double precision number of 
           TDB seconds past the J2000 epoch that corresponds to 
           the input 'str'.

           'et' returns with the same measure of vectorization (N) 
           as 'str'.

   Note: Reference the function cspice_tsetyr for information concerning 
   the translation of two digit representations of the century count.

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.

      ;;
      ;; Load a leapseconds kernel.
      ;;
      cspice_furnsh, 'standard.tm'

      ;;
      ;; Define the epoch as a string.
      ;;
      date = 'Thu Mar 20 12:53:29 PST 1997'

      ;;
      ;; Convert a string to ephemeris time (ET).
      ;;
      cspice_str2et, date, et
      print, 'Scalar:'
      print, FORMAT='(F20.8)', et 

      ;;
      ;; Define a vector of time strings:
      ;;
      time = strarr(5)

      ;;
      ;; Allocate an array of longs, initial value
      ;; 2454000, increment by 10000 for each array 
      ;; element. Use longs, 'L', for the Julian data
      ;; value.
      ;;
      jd = 10000L * lindgen(5) + 2454000L

      ;;
      ;; Fill the time array with string representations
      ;; of the 'jd' array in the format of a Julian date
      ;; string. Also strip whitespace.
      ;;
      time+= 'JD' + string(jd) + '.'
      time = strcompress( time, /REMOVE_ALL )

      ;;
      ;; Convert the array of time strings 'time' to 
      ;; and array of ephemeris times 'et'.
      ;;
      cspice_str2et, time, et
      print, 'Vector:'
      for i=0, 4 do print, FORMAT='(F20.8)', et[i]
   
   IDL outputs:

      Scalar:
        -87836728.81438904

      Vector:
        212112064.18239054
       1076112064.18491936
       1940112064.18430591
       2804112064.18263292
       3668112064.18564129

Particulars


   None.

Required Reading


   ICY.REQ
   TIME.REQ

Version


   -Icy Version 1.1.2, 13-JUN-2010, EDW (JPL)

      Minor edit to code comments eliminating typo.
 
   -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, 01-AUG-2004, EDW (JPL)

       Added capability to process vector 'str' input
       returning a vector 'et' on output.

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

Index_Entries


    Convert a string to TDB seconds past the J2000 epoch




Wed Apr  5 17:58:04 2017