00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 __facility__ = "Online"
00011 __abstract__ = "LAT-related useful functions"
00012 __author__ = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__ = "2005/12/20 00:00:00"
00014 __updated__ = "$Date: 2006/04/27 02:07:28 $"
00015 __version__ = "$Revision: 1.2 $"
00016 __release__ = "$Name: HEAD $"
00017 __credits__ = "SLAC"
00018
00019 import LICOS.copyright_SLAC
00020
00021 import datetime, calendar, time
00022
00023 LAT_EPOCH_datetime = calendar.timegm( time.strptime( '2001-01-01 00:00:00', '%Y-%m-%d %H:%M:%S' ) )
00024
00025
00026 def utcfromtimestamp( secs, usecs ):
00027
00028 tstamp = float( secs ) + ( float( usecs ) / 1000000.0 ) + LAT_EPOCH_datetime
00029
00030
00031 return datetime.datetime.utcfromtimestamp( tstamp )