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
scet01

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

     SCET01 ( ET to discrete ticks, type 1 )

     ENTRY SCET01 ( SC, ET, SCLKDP )

Abstract

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

Required_Reading

     SCLK
     TIME

Keywords

     CONVERSION
     TIME

Declarations

    INTEGER               SC
    DOUBLE PRECISION      ET
    DOUBLE PRECISION      SCLKDP

Brief_I/O

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

Detailed_Input

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

     ET       is an ephemeris time, specified in seconds past
              J2000, whose equivalent encoded SCLK value is
              desired.

Detailed_Output

     SCLKDP   is the encoded type 1 spacecraft clock value
              that corresponds to ET. The value is obtained
              by mapping ET, using the piecewise linear mapping
              defined by the SCLK kernel, to a value that may
              have a non-zero fractional part, and then
              rounding this value to the nearest double precision
              whole number.

              SCLKDP represents total time since spacecraft
              clock start and hence does reflect partition
              information.

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 SCLKDP 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 SCLKDP 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 ephemeris time value ET is out of range, the
         error SPICE(VALUEOUTOFRANGE) is signaled. The output argument
         SCLKDP 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

     Normally, the newer entry point SCEC01 (ET to continuous ticks,
     type 1) should be used in place of this routine.

     SCET01 is not usually called by routines external to SPICELIB.
     The conversion routine SCE2T converts ephemeris seconds past J2000
     to any type of discrete, encoded type 1 spacecraft clock value.
     For conversion to continuous, encoded SCLK, SCE2C is the preferred
     user interface routine because its interface specification does
     not refer to spacecraft clock types. For conversion to discrete,
     encoded SCLK, SCE2T is the preferred interface routine.

     However, direct use of SCET01 by user routines is not prohibited.

Examples

     1)  Converting ET to encoded type 1 SCLK:

         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 SC is -77, indicating the Galileo spacecraft, and
         ET is set to

            -3.2286984854565E+08

         then the call

            CALL SCET01 ( SC, ET, SCLKDP )

         returns SCLKDP as

            7.2800000000000E+05

         on a VAX 11/780 running VMS 5.3, Fortran 5.5. Note that
         the result should be the same (except for the output format)
         on most computers, since the result is a double precision
         whole number.

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)
     E.D. Wright        (JPL)

Version

    SPICELIB Version 3.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.

        Edited the header to comply with NAIF standard.

        Corrected description of invalid clock rate exception.

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

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

    SPICELIB Version 2.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 2.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 2.0.3, 22-AUG-2006 (EDW)

        Replaced references to LDPOOL with references
        to FURNSH.

    SPICELIB Version 2.0.2, 09-MAR-1999 (NJB)

        Comments were updated; references to SCE2C and SCEC01 were
        added.

    SPICELIB Version 2.0.1, 18-JUL-1996 (NJB)

        Typo in comment fixed.

    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, 04-SEP-1990 (NJB)
Fri Dec 31 18:36:45 2021