##// END OF EJS Templates
Fix utc time in MAdrigal modules
Juan C. Espinoza -
r1086:828386118e15
parent child
Show More
@@ -381,7 +381,7 class MADReader(JRODataReader, ProcessingUnit):
381
381
382 self.dataOut.parameters = [s for s in parameters if s]
382 self.dataOut.parameters = [s for s in parameters if s]
383 self.dataOut.heightList = self.ranges
383 self.dataOut.heightList = self.ranges
384 self.dataOut.utctime = (self.datatime - UT1970).total_seconds()
384 self.dataOut.utctime = (self.datatime - datetime.datetime(1970, 1, 1)).total_seconds()
385 self.dataOut.utctimeInit = self.dataOut.utctime
385 self.dataOut.utctimeInit = self.dataOut.utctime
386 self.dataOut.paramInterval = min(self.intervals)
386 self.dataOut.paramInterval = min(self.intervals)
387 self.dataOut.useLocalTime = False
387 self.dataOut.useLocalTime = False
@@ -415,6 +415,7 class MADWriter(Operation):
415
415
416 Operation.__init__(self, **kwargs)
416 Operation.__init__(self, **kwargs)
417 self.dataOut = Parameters()
417 self.dataOut = Parameters()
418 self.counter = 0
418 self.path = None
419 self.path = None
419 self.fp = None
420 self.fp = None
420
421
@@ -487,7 +488,7 class MADWriter(Operation):
487 '''
488 '''
488
489
489 self.mnemonic = MNEMONICS[self.kinst] #TODO get mnemonic from madrigal
490 self.mnemonic = MNEMONICS[self.kinst] #TODO get mnemonic from madrigal
490 date = datetime.datetime.fromtimestamp(self.dataOut.utctime)
491 date = datetime.datetime.utcfromtimestamp(self.dataOut.utctime)
491
492
492 filename = '{}{}{}'.format(self.mnemonic,
493 filename = '{}{}{}'.format(self.mnemonic,
493 date.strftime('%Y%m%d_%H%M%S'),
494 date.strftime('%Y%m%d_%H%M%S'),
@@ -497,7 +498,7 class MADWriter(Operation):
497
498
498 if os.path.isfile(self.fullname) :
499 if os.path.isfile(self.fullname) :
499 log.warning(
500 log.warning(
500 'Destination path {} already exists. Previous file deleted.'.format(
501 'Destination file {} already exists, previous file deleted.'.format(
501 self.fullname),
502 self.fullname),
502 'MADWriter')
503 'MADWriter')
503 os.remove(self.fullname)
504 os.remove(self.fullname)
@@ -522,7 +523,7 class MADWriter(Operation):
522 Allowed parameters in: parcodes.tab
523 Allowed parameters in: parcodes.tab
523 '''
524 '''
524
525
525 startTime = datetime.datetime.fromtimestamp(self.dataOut.utctime)
526 startTime = datetime.datetime.utcfromtimestamp(self.dataOut.utctime)
526 endTime = startTime + datetime.timedelta(seconds=self.dataOut.paramInterval)
527 endTime = startTime + datetime.timedelta(seconds=self.dataOut.paramInterval)
527 heights = self.dataOut.heightList
528 heights = self.dataOut.heightList
528
529
General Comments 0
You need to be logged in to leave comments. Login now