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_deltet

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


Abstract


   CSPICE_DELTET returns value of Delta ET (ET-UTC) for an input epoch.

I/O


   Given:

      epoch    the epoch at which "delta ET" is to be computed, or an N-vector
               of epochs.

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

               `epoch' may be either UTC or ephemeris seconds past J2000, as
               specified by `eptype'.

      eptype   the type of input epoch.

               help, eptype
                  STRING = Scalar

               It may be either of the following:

                  'UTC'    UTC seconds past J2000 UTC.

                  'ET'     Ephemeris seconds past J2000 TDB,
                           also known as barycentric dynamical
                           time (TDB).

   the call:

      cspice_deltet, epoch, eptype, delta

   returns:

      delta    the value of

                  "delta ET" = ET - UTC

               at the input epoch.

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

               This is added to UTC to give ET, or subtracted from ET to
               give UTC. The routine is reversible: that is, given the
               following calls,

                  cspice_deltet, utc,      'UTC', del1
                  cspice_deltet, utc+del1, 'ET',  del2

               the expression

                  ( del1 eq del2 )

               is always True.

               `delta' returns with the same measure of vectorization (N) as
               `epoch'.

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) Calculate the ET to UTC delta times in seconds, at January 1, 1997
      and January 1, 2004, and for every Julian year in-between.

      Use the LSK kernel below to load the leap seconds and time
      constants required for the conversions.

         naif0012.tls


      Example code begins here.


      PRO deltet_ex1

         ;;
         ;; Load a leapsecond file.
         ;;
         cspice_furnsh, 'naif0012.tls'

         ;;
         ;; Define times of interest and the array size
         ;; parameter.
         ;;
         SIZE     = 2004 - 1997 +1
         UTC_1997 = '1997 JAN 01 00:00:00.000'
         UTC_2004 = '2004 JAN 01 00:00:00.000'

         ;;
         ;; Convert the UTC time strings to ET.
         ;;
         cspice_str2et, UTC_1997, et_1997
         cspice_str2et, UTC_2004, et_2004

         ;;
         ;; Calculate the ET-UTC delta at Jan 1 1997
         ;; and Jan 1 2004.
         ;;
         cspice_deltet, et_1997, 'ET', delt_1997
         cspice_deltet, et_2004, 'ET', delt_2004

         print, '     UTC time             Delta ET-UTC'
         print, '------------------------  ------------'
         print, 'Scalar:'
         print, FORMAT='(A,2X,F12.8)', UTC_1997, delt_1997
         print, FORMAT='(A,2X,F12.8)', UTC_2004, delt_2004

         ;;
         ;; Given an array of 'SIZE' ephemeris times
         ;; starting from value 'et_1997' with graduations
         ;; of the number of seconds per Julian year, return
         ;; the ET-UTC delta value for each time.
         ;;
         et = dindgen(SIZE)*cspice_jyear() + et_1997
         cspice_deltet, et, 'ET', delt

         ;;
         ;; Convert 'et' to 'utc'.
         ;;
         cspice_et2utc, et, 'C', 3, utc

         print, 'Vector:'
         for i=0, (SIZE-1) do begin
            print, FORMAT='(A,2X,F12.8)', utc[i], delt[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:


           UTC time             Delta ET-UTC
      ------------------------  ------------
      Scalar:
      1997 JAN 01 00:00:00.000   62.18393536
      2004 JAN 01 00:00:00.000   64.18391170
      Vector:
      1997 JAN 01 00:00:00.000   62.18393536
      1998 JAN 01 05:59:59.000   63.18393508
      1999 JAN 01 11:59:58.000   64.18393480
      2000 JAN 01 17:59:58.000   64.18393452
      2000 DEC 31 23:59:58.000   64.18393424
      2002 JAN 01 05:59:58.000   64.18393396
      2003 JAN 01 11:59:58.000   64.18393368
      2004 JAN 01 17:59:58.000   64.18393341


Particulars


   The constants necessary for computing the offset are taken
   from the kernel pool, where they are assumed to have been
   loaded from a kernel file.

   The tables are consulted to determine the number of leap seconds
   preceding the input epoch. Also, an approximation to the periodic
   yearly variation (which has an amplitude of just under two
   milliseconds) in the difference between ET and TAI (Atomic Time)
   is computed. The final value of Delta ET is given by

      Delta ET = ( ET - TAI ) + leap seconds

Exceptions


   1)  If the input epoch is not recognized, the error
       SPICE(INVALIDEPOCH) is signaled by a routine in the call tree
       of this routine.

   2)  If the variables necessary for the computation of `delta' have
       not been loaded into the kernel pool, the error
       SPICE(KERNELVARNOTFOUND) is signaled by a routine in the call
       tree of this routine.

   3)  If the number of leapseconds in the pool is greater than the
       local leapseconds buffer size, the error SPICE(BUFFEROVERFLOW)
       is signaled by a routine in the call tree of this routine.

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

   5)  If any of the input arguments, `epoch' or `eptype', 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 `delta' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   1)  The routines cspice_str2et and cspice_et2utc are preferred for
       conversions between UTC and ET. This routine is provided mainly as a
       utility for cspice_str2et and cspice_et2utc.

   2)  A leapseconds kernel containing leapseconds and relativistic
       terms MUST be loaded prior to calling this routine.
       Examples demonstrating how to load a kernel pool are included
       in the Required Reading file time.req and in the -Examples
       section of this header. For more general information about
       kernel pools, please consult the Required Reading file
       kernel.req.

Required_Reading


   ICY.REQ
   TIME.REQ

Literature_References


   [1]  "The Astronomical Almanac for the Year 1990," United States
        Naval Observatory, U.S. Government Printing Office,
        Washington, D.C., 1989.

Author_and_Institution


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

Version


   -Icy Version 1.0.3, 24-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement and a reference to the required LSK. Modified
       example's output.

       Added -Parameters, -Particulars, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       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.2, 29-SEP-2007 (EDW)

       Replaced the comment fragment in the -I/O section

          "return with the same order"

       with

          "return with the same measure of vectorization"

       Replaced cspice_unload call in example section with
       cspice_kclear.

   -Icy Version 1.0.1, 12-JUN-2006 (EDW)

       Added the output corresponding to the example code.
       Corrected Version ID for the 20-SEP-2003 notation.

   -Icy Version 1.0.0, 20-SEP-2003 (EDW)

Index_Entries


   difference between ephemeris time and utc



Fri Dec 31 18:43:03 2021