User Tools

Site Tools


date2lobt

DATE2LOBT

IDL doc_library comment

 Function date2lobt converts date to CEPAC Local On Board Time (LOBT),
 which is an approximation of the International Atomic Time (TAI).

 result=date2lobt(date)

 date:
         Date in array format:[year,month,day,hour,minute,second,millisecond]
         E.g. date=[1995,12,2,8,8,0,0] or date=[1995,12,1]
         The length of the date must be atleast 1, if the rest is missing
         it is supposed to be 1, 1, 0, 0, 0, 0.
         Also array of date arrays is accepted.
         E.g. date=[[1995,12,2,8,8,0,0],[1996,12,2,8,8,0,0]] or
         date=[[1995],[1996],[1997]]. In this case an array of doubles is
         returned.

 result:
         CEPAC Local On Board Time values (TAI) in seconds (Double).

 Uses:
         Generic IDL routine cdf_epoch.

 Comment:
         This routine is intended to work mainly for ERNE-data. Specifically
         dates prior to launch (1995-12-2) are not necessary handled properly.
         Leap seconds: +29 added to all times (UTC leap seconds at launch date),
                       after 1995-12-31 +1,
                       after 1997-06-30 +1,
                       after 1998-12-31 +1.
                       after 2005-12-31 +1.


 Errors:
         The returned values are negative if something goes wrong. Notably
         cdf_epoch allows only months between [1..12], days between [1..31],
         and so on.

         Exeption are the known leap seconds e.g., 1995-12-31 23:56:60.mmm,
         where '60' is allowed as a value for seconds (mmm stands for the
         milliseconds. While cdf_epoch doesn't allow this, it is circumvented
         in the enveloping code here.


  Version History:


  Version 1.3

      4.1.2006
                       Added leap second at the end of year 2005.

                       Author: ER, Space Research Laboratory, University of Turku


  Version 1.2

      8.10.2003
                       1) Bug correction. The leap second correction
                          was made too early. The timing error was
                          equal to the number of current leap seconds.
                          Reversing the order of the leap second addjustments
                          solved the problem.

                       2) Added the possibility to input the leap second
                          time in the date field. That is, the second
                          field can be 60 as special case.

                       Author: ER, Space Research Laboratory, University of Turku





  Date2Lobt

       Created:

        13.6.1996       Original version (v1.0)
                        Output type: 'LONGINT'.


       Modifications:

        6.3.1997        Date as array
        22.6.1998       Leap seconds updated
        15.12.1999      Leap seconds updated

                       Author: MT, Space Research Laboratory, University of Turku
                       
date2lobt.txt · Last modified: 2023/10/12 11:47 by admin