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_scs2e

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


Abstract


   CSPICE_SCS2E converts a spacecraft clock string to ephemeris
   seconds past J2000 (ET).

I/O


   Given:

      sc       a NAIF ID code for a spacecraft, one of whose clock values is
               represented by `sclkch'.

               help, sc
                  LONG = Scalar

               The set of supported spacecraft clocks is listed in the SCLK
               Required Reading.

      sclkch   a character string representation of the spacecraft clock value
               that corresponds to `et', for the spacecraft specified by the
               input argument `sc', or an N-vector of representations.

               help, sclkch
                  STRING = Scalar   or   STRING = Array[N]

               `sclkch' is an absolute spacecraft clock time, so partition
               information should be included in this string. The precise
               format of `sclkch' is specified in the SCLK Required Reading.

   the call:

      cspice_scs2e, sc, sclkch, et

   returns:

      et       the epoch, specified as ephemeris seconds past J2000, that
               corresponds to `sclkch', or an N-vector of epochs.

               help, et
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

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

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) Obtain from a series of CASSINI string representations
      the corresponding ephemeris epoch and UTC time.

      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File name: scs2e_ex1.tm

         This meta-kernel is intended to support operation of SPICE
         example programs. The kernels shown here should not be
         assumed to contain adequate or correct versions of data
         required by SPICE-based user applications.

         In order for an application to use this meta-kernel, the
         kernels referenced here must be present in the user's
         current working directory.

         The names and contents of the kernels referenced
         by this meta-kernel are as follows:

            File name                     Contents
            ---------                     --------
            naif0012.tls                  Leapseconds
            cas00071.tsc                  CASSINI SCLK


         \begindata

            KERNELS_TO_LOAD = ( 'naif0012.tls',
                                'cas00071.tsc' )

         \begintext

         End of meta-kernel


      Example code begins here.


      PRO scs2e_ex1

         ;;
         ;; Load the leapseconds kernel for time conversion.
         ;;
         cspice_furnsh, 'scs2e_ex1.tm'

         ;;
         ;; Assign values for the spacecraft ID (CASSINI).
         ;;
         SC     = -82
         sclkch = '1/1465644281.165'

         ;;
         ;; Convert 'sclkch' for spacecraft 'SC' to ephemeris time.
         ;;
         cspice_scs2e, SC, sclkch, et

         ;;
         ;; Convert the ephemeris time to a UTC calendar string.
         ;;
         cspice_et2utc, et, 'C', 3, utc

         print, '  SCLK String             ET                  UTC Time      '
         print, '----------------  ----------------  ------------------------'
         print, 'Scalar:'
         print, FORMAT='(A-16,2X,F16.6,2X,A)', sclkch, et, utc

         ;;
         ;; Convert a vector of SCLK strings.
         ;;
         sclkch =  [ '1/1465644281.165' ,$
                     '1/1465646281.165' ,$
                     '1/1465647281'     ,$
                     '1/1465647281.001' ]

         cspice_scs2e, SC, sclkch, et
         cspice_et2utc, et, 'C', 3, utc

         print, 'Vector:'
         for i=0, n_elements(et)-1 do begin
            print, FORMAT='(A-16,2X,F16.6,2X,A)', sclkch[i], et[i], utc[i]
         endfor

         ;;
         ;; 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:


        SCLK String             ET                  UTC Time
      ----------------  ----------------  ------------------------
      Scalar:
      1/1465644281.165  140223678.094534  2004 JUN 11 11:00:13.910
      Vector:
      1/1465644281.165  140223678.094534  2004 JUN 11 11:00:13.910
      1/1465646281.165  140225678.080283  2004 JUN 11 11:33:33.896
      1/1465647281      140226677.428631  2004 JUN 11 11:50:13.244
      1/1465647281.001  140226677.432538  2004 JUN 11 11:50:13.248


Particulars


   This routine is provided as a convenience; it is simply shorthand
   for the code fragment

      cspice_scencd, sc, sclkch, sclkdp
      cspice_sct2e,  sc, sclkdp, et

Exceptions


   1)  If an SCLK kernel has not been loaded, does not contain all of
       the required data, or contains invalid data, an error is
       signaled by a routine in the call tree of this routine. The
       output argument `et' will not be modified. This routine assumes
       that that an SCLK kernel appropriate to the spacecraft clock
       identified by the input argument `sc' has been loaded.

   2)  If a leapseconds kernel is required for conversion between
       SCLK and `et' but is not loaded, an error is signaled by a
       routine in the call tree of this routine. The output argument
       `et' will not be modified. When using SCLK kernels that map SCLK
       to a time system other than `et' (also called barycentric
       dynamical time---`TDB'), it is necessary to have a leapseconds
       kernel loaded at the time this routine is called.

       The time system that an SCLK kernel maps SCLK to is indicated
       by the variable SCLK_TIME_SYSTEM_nn in the kernel, where nn
       is the negative of the NAIF integer code for the spacecraft.
       The time system used in a kernel is TDB if and only if the
       variable is assigned the value 1.

   3)  If the value of `sclkch' is invalid, an error is signaled by a
       routine in the call tree of this routine. The output argument
       `et' will not be modified.

   4)  If any of the input arguments, `sc' or `sclkch', is undefined,
       an error is signaled by the IDL error handling system.

   5)  If any of the input arguments, `sc' or `sclkch', is not of the
       expected type, or it does not have the expected dimensions and
       size, an error is signaled by the Icy interface.

   6)  If the output argument `et' is not a named variable, an error
       is signaled by the Icy interface.

Files


   None.

Restrictions


   1)  An SCLK kernel appropriate to the spacecraft clock identified
       by `sc' must be loaded at the time this routine is called.

   2)  If the SCLK kernel used with this routine does not map SCLK
       directly to barycentric dynamical time, a leapseconds kernel
       must be loaded at the time this routine is called.

Required_Reading


   ICY.REQ
   SCLK.REQ

Literature_References


   None.

Author_and_Institution


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

Version


   -Icy Version 1.1.2, 13-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement and meta-kernel with CASSINI PDS archived data.
       Reformatted example's output and changed calls to "cspice_unload"
       by "cspice_kclear".

       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.1.1, 05-FEB-2008 (EDW)

       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)

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

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

Index_Entries


   spacecraft_clock string to ephemeris time



Fri Dec 31 18:43:07 2021