| scec01 |
|
Table of contents
Procedure
SCEC01 ( ET to continuous ticks, type 1 )
ENTRY SCEC01 ( SC, ET, SCLKDP )
Abstract
Convert ephemeris seconds past J2000 (ET) to continuous encoded
type 1 spacecraft clock (`ticks'). The output value need not be
integral.
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 continuous 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 continuous encoded type 1 spacecraft clock
value corresponding 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. Unlike the output
of SCET01, SCLKDP is not rounded by this routine.
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
SCEC01 is not usually called by routines external to SPICELIB.
The conversion routine SCE2C converts ephemeris seconds
past J2000 to any type of encoded spacecraft clock value.
SCE2C is the preferred user interface routine because its
interface specification does not refer to spacecraft clock types.
However, direct use of SCEC01 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
-27848635.8149248
then the call
CALL SCEC01 ( SC, ET, SCLKDP )
returns SCLKDP as
35425287435.8554
on a NeXT workstation running NEXTSTEP 3.3.
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 2.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 1.4.0, 09-SEP-2013 (BVS)
Updated to keep track of the POOL counter and call ZZCVPOOL.
SPICELIB Version 1.3.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 1.2.0, 09-NOV-2007 (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 1.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 1.0.0, 13-FEB-1999 (NJB)
|
Fri Dec 31 18:36:45 2021