Table of contents
CSPICE_SCE2S converts an ephemeris seconds past J2000 (ET)
value describing a date to a character string representation
of a spacecraft clock value (SCLK).
Given:
sc a NAIF ID code for a spacecraft clock whose reading at the epoch
specified by `et' is desired.
help, sc
LONG = Scalar
et an epoch, specified as ephemeris seconds past J2000.
help, et
DOUBLE = Scalar
the call:
cspice_sce2s, sc, et, sclkch
returns:
sclkch a character string representation of the spacecraft clock value
that corresponds to `et', for the spacecraft clock specified by
the input argument `sc'.
help, sclkch
STRING = Scalar
`sclkch' is an absolute spacecraft clock value, so a partition
number is included in the string. The format of `sclkch' is
specified in the SCLK kernel for the clock `sc'. A general
discussion of spacecraft clock string formats is available in
the SCLK Required Reading.
In order to choose an appropriate length for `sclkch', you can
examine an SCLK kernel for the clock specified by `sc'. The
format of string representations of the clock's values is
specified by kernel variables associated with the clock. See
-Examples below for further information.
None.
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) Convert a UTC time to the character string representation of
the CASSINI spacecraft clock value.
Use the meta-kernel shown below to load the required SPICE
kernels.
KPL/MK
File name: sce2s_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 sce2s_ex1
;;
;; Load the kernels for time conversion.
;;
cspice_furnsh, 'sce2s_ex1.tm'
;;
;; Assign values for the spacecraft ID (CASSINI).
;;
SC = -82
event_time = '2004 JUN 11 11:00:37.57200'
;;
;; Convert the time string to ephemeris time.
;;
cspice_str2et, event_time, et
;;
;; Convert the ephemeris time to the corresponding
;; s-clock string appropriate for this spacecraft
;;
cspice_sce2s, sc, et, sclkch
print, ' UTC Time SCLK string'
print, '-------------------------- ----------------'
print, event_time, ' ', sclkch
;;
;; 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:
UTC Time SCLK string
-------------------------- ----------------
2004 JUN 11 11:00:37.57200 1/1465644305.079
This routine is provided as a convenience; it is simply shorthand
for the code fragment
cspice_sce2t, sc, et, sclkdp
cspice_scdecd, sc, sclkdp, sclkch
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 `sclkch' will not be modified. This routine
assumes 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
`sclkch' will not be modified. When using an SCLK kernel that
maps 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 to which an SCLK kernel maps SCLK epochs 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 input `et' value is not representable in the spacecraft
clock string format for the spacecraft clock identified by `sc',
an error is signaled by a routine in the call tree of this
routine. The output argument `sclkch' will not be modified.
4) If any of the input arguments, `sc' or `et', is undefined, an
error is signaled by the IDL error handling system.
5) If any of the input arguments, `sc' or `et', 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 `sclkch' is not a named variable, an
error is signaled by the Icy interface.
An SCLK kernel, appropriate to the spacecraft clock identified
by `sc', must be loaded at the time this routine is called.
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.
None.
ICY.REQ
SCLK.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 01-JUN-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.0.0, 16-JUN-2003 (EDW)
ephemeris time to spacecraft_clock string
|