This page was created by the IDL library routine mk_html_help2.

Last modified: Wed Apr 11 01:15:09 2012.


Directory Listing of Routines


Routine Descriptions

ADD_LEAP_SECONDS

[Next Routine] [List of Routines]

Procedure: add_leap_seconds

Purpose:
  Takes a TDAS date and adds leap seconds to the date(s) using the data in the CDF 3.4(or later) leap second config file.
  Like time_string and time_double, it is vectorized and accepts array inputs of arbitrary dimensions

Inputs: 
  Dates: double precision seconds since 1970 or date strings.  Can be scalar or array values with any dimensions or ordering.

Keywords:
  subtract:  If this keyword is set, this function will subtract leap seconds from a date that already includes them.
  
  leap_seconds: Set this to a named variable in which to return the offsets used for the calculation.  Note that these can differ in both sign and magnitude for
  a particular date, depending on whether you are adding or subtracting.

Return Value:
  The data with leap seconds added(or removed). Will preserve double or string data types.
  (e.g. If you pass in a string, it returns a string)
  
Notes:
  #1 This routine requires the CDF 3.4 leap second file.  One will be provided with the TDAS install, but it will be updated
  automatically when a new leap second occurs.
  
  #2 The environment variable "!CDF_LEAP_SECONDS" must be defined for this routine to work.  This variable is defined by
  calling cdf_leap_second_init.  Normally, the initialization routine for missions that use tt2000 should use this.

Examples:
THEMIS>   print,add_leap_seconds('2007-03-23')
2007-03-23/00:00:33
THEMIS>   print,add_leap_seconds('2007-03-23',/subtract)
2007-03-22/23:59:27
THEMIS>   print,add_leap_seconds(add_leap_seconds('2007-03-23'),/subtract)
2007-03-23/00:00:00
THEMIS>   print,add_leap_seconds(time_double(['2007-03-23','1980-01-01/23:59:59']))
   1.1746080e+09   3.1561922e+08
THEMIS>   print,add_leap_seconds(['2007-03-23','1980-01-01/23:59:59'],leap_seconds=ls_offset)
2007-03-23/00:00:33 1980-01-02/00:00:18
THEMIS>   print,ls_offset
      33.0000      19.0000

 $LastChangedBy: pcruce $
 $LastChangedDate: 2012-04-10 11:18:55 -0700 (Tue, 10 Apr 2012) $
 $LastChangedRevision: 10312 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/CDF/TT2000/add_leap_seconds.pro $

(See ssl_general/CDF/TT2000/add_leap_seconds.pro)


CDF_LEAP_SECOND_INIT

[Previous Routine] [List of Routines]
PROCEDURE:  cdf_leap_second_init
PURPOSE:    CDF library 3.4.0 and later supports time formats
            the include leap seconds.  Specifically tt2000.
            This routine maintains the calibration file that is required
            by the CDF library and TDAS to perform the conversions.

NOTES: #1 Missions that use tt2000 times in their CDFs should call this routine inside their mission init/
       config routines. (e.g. thm_init/thm_config)
       #2 Set !CDF_LEAP_SECOND.preserve_leap_seconds=1 if you want to keep leap seconds included in unix times after they're imported.
       This may mean that the data set will have a time dependent time skew with other data sets by ~35 seconds.(or more as additional 
       leap seconds are added.)
       #3 This routine may modify the environment variable CDF_LEAPSECONDTABLE and update the CDF leap second table if a new version is found.
        

$LastChangedBy: pcruce $
$LastChangedDate: 2012-04-10 11:13:49 -0700 (Tue, 10 Apr 2012) $
$LastChangedRevision: 10311 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/CDF/TT2000/cdf_leap_second_init.pro $

(See ssl_general/CDF/TT2000/cdf_leap_second_init.pro)