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
scte01

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

     SCTE01 ( Ticks to ET, type 01 )

     ENTRY SCTE01 ( SC, SCLKDP, ET )

Abstract

     Convert encoded type 1 spacecraft clock (`ticks') to ephemeris
     seconds past J2000 (ET).

Required_Reading

     SCLK
     TIME

Keywords

     CONVERSION
     TIME

Declarations

    INTEGER               SC
    DOUBLE PRECISION      SCLKDP
    DOUBLE PRECISION      ET

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     SC         I   NAIF spacecraft ID code.
     SCLKDP     I   Type 1 SCLK, encoded as ticks since clock start.
     ET         I   Ephemeris time, seconds past J2000.

Detailed_Input

     SC       is a NAIF ID code for a spacecraft, one of whose
              clock values is represented by SCLKDP.

     SCLKDP   is an encoded type 1 spacecraft clock value
              produced by the routine SCENCD. SCLKDP is a
              count of ticks since spacecraft clock start:
              partition information IS included in the encoded
              value.

Detailed_Output

     ET       is the ephemeris time, seconds past J2000, that
              corresponds to SCLKDP.

Parameters

     None.

Exceptions

     1)  This routine assumes that that an SCLK kernel appropriate to
         the spacecraft clock identified by the input argument SC has
         been loaded. 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.

         The variables that must be set by the SCLK kernel are:

            -  The number of fields in an (unabridged) SCLK string
            -  The output delimiter code
            -  The parallel time system code
            -  The moduli of the fields of an SCLK string
            -  The offsets for each clock field.
            -  The SCLK coefficients array
            -  The partition start times
            -  The partition end times

     2)  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. 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.

         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 any of the following kernel variables have invalid values,
         the error will be diagnosed by routines called by this
         routine:

            -  The number of SCLK coefficients
            -  The number of partition start times
            -  The number of partition end times
            -  The number of fields of a SCLK string
            -  The number of moduli for a SCLK string

         If the number of values for any item read from the kernel
         pool exceeds the maximum allowed value, it is may not be
         possible to diagnose the error correctly, since overwriting
         of memory may occur. This particular type of error is not
         diagnosed by this routine.

     4)  If the time system code is not recognized, the error
         SPICE(VALUEOUTOFRANGE) is signaled.

     5)  If the input SCLK value SCLKDP is out of range, the error
         SPICE(VALUEOUTOFRANGE) is signaled. The output argument ET
         will not be modified.

     6)  If the SCLK rate used to interpolate SCLK values is
         nonpositive, the error SPICE(VALUEOUTOFRANGE) is signaled.
         The output argument SCLKDP will not be modified.

     7)  If the partition times or SCLK coefficients themselves
         are invalid, this routine will almost certainly give
         incorrect results. This routine cannot diagnose errors
         in the partition times or SCLK coefficients, except possibly
         by crashing.

Files

     None.

Particulars

     SCTE01 is not usually called by routines external to SPICELIB.
     The conversion routine SCT2E converts any type of encoded
     spacecraft clock value produced by SCENCD to ephemeris seconds
     past J2000.  SCT2E is the preferred user interface routine
     because its interface specification does not refer to spacecraft
     clock types. However, direct use of SCTE01 by user routines is
     not prohibited.

Examples

     1)  Convert an encoded type 1 SCLK value to ET:

         During program initialization, load the leapseconds and SCLK
         kernels. We will assume that these files are named
         "LEAPSECONDS.KER" and "SCLK.KER".  You must substitute the
         actual names of these files in your code.

            CALL CLPOOL
            CALL FURNSH ( 'LEAPSECONDS.KER' )
            CALL FURNSH ( 'SCLK.KER'        )

         If SCLKDP is an encoded spacecraft clock value, if SC
         is the NAIF integer code for the spacecraft whose
         SCLK <--> ET mapping is defined by the data in SCLK.KER,
         then the call

            CALL SCTE01 ( SC, SCLKDP, ET )

         will return the ET value corresponding to SCLKDP.

         For example, if SC is -77, indicating the Galileo spacecraft,
         and if a Galileo SCLK kernel is loaded, then if SCLKDP
         is set to

            7.2800000000000E+05

         the call

            CALL SCTE01 ( SC, SCLKDP, ET )

         returns ET as

            -3.2286984854565E+08

         on a VAX 11/780 running VMS 5.3, Fortran 5.5.

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.

Literature_References

     None.

Author_and_Institution

     N.J. Bachman       (JPL)
     J. Diaz del Rio    (ODC Space)
     B.V. Semenov       (JPL)

Version

    SPICELIB Version 4.0.0, 01-DEC-2021 (NJB) (JDR)

        Updated to support buffering of data for multiple clocks.
        This entry point tracks kernel pool changes but no longer
        sets or uses watches.

        A check for invalid time system code was added.

        A check for nonpositive clock rate was added.

        Edited the header to comply with NAIF standard.

    SPICELIB Version 3.3.0, 09-SEP-2013 (BVS)

        Updated to keep track of the POOL counter and call ZZCVPOOL.

    SPICELIB Version 3.2.0, 05-MAR-2009 (NJB)

        Bug fix: this routine now keeps track of whether its
        kernel pool look-up succeeded. If not, a kernel pool
        lookup is attempted on the next call to this routine.

    SPICELIB Version 3.1.0, 09-NOV-2007 (NJB)

        Bug fix: changed maximum value arguments to 1 in
        calls to SCLI01 to fetch NFIELD and DELCDE values.

    SPICELIB Version 3.0.0, 06-JAN-1998 (NJB)

        Removed local variable RNDCLK; this entry point no longer
        creates a rounded version of its input argument. Use of
        ANINT to round coefficients has been discontinued.

    SPICELIB Version 2.0.0, 17-APR-1992 (NJB)

        This routine was updated to handle SCLK kernels that use
        TDT as their `parallel' time system. Header was updated,
        particularly $Exceptions and $Restrictions. Watch is now
        set on required kernel variables. Comment section for
        permuted index source lines was added following the header.

    SPICELIB Version 1.0.0, 21-AUG-1990 (NJB)
Fri Dec 31 18:36:46 2021