@@ -381,7 +381,7 class MADReader(JRODataReader, ProcessingUnit): | |||
|
381 | 381 | |
|
382 | 382 | self.dataOut.parameters = [s for s in parameters if s] |
|
383 | 383 | self.dataOut.heightList = self.ranges |
|
384 |
self.dataOut.utctime = (self.datatime - |
|
|
384 | self.dataOut.utctime = (self.datatime - datetime.datetime(1970, 1, 1)).total_seconds() | |
|
385 | 385 | self.dataOut.utctimeInit = self.dataOut.utctime |
|
386 | 386 | self.dataOut.paramInterval = min(self.intervals) |
|
387 | 387 | self.dataOut.useLocalTime = False |
@@ -415,6 +415,7 class MADWriter(Operation): | |||
|
415 | 415 | |
|
416 | 416 | Operation.__init__(self, **kwargs) |
|
417 | 417 | self.dataOut = Parameters() |
|
418 | self.counter = 0 | |
|
418 | 419 | self.path = None |
|
419 | 420 | self.fp = None |
|
420 | 421 | |
@@ -487,17 +488,17 class MADWriter(Operation): | |||
|
487 | 488 | ''' |
|
488 | 489 | |
|
489 | 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 | 493 | filename = '{}{}{}'.format(self.mnemonic, |
|
493 | 494 | date.strftime('%Y%m%d_%H%M%S'), |
|
494 |
self.ext) |
|
|
495 | self.ext) | |
|
495 | 496 | |
|
496 | 497 | self.fullname = os.path.join(self.path, filename) |
|
497 | 498 | |
|
498 | 499 | if os.path.isfile(self.fullname) : |
|
499 | 500 | log.warning( |
|
500 |
'Destination |
|
|
501 | 'Destination file {} already exists, previous file deleted.'.format( | |
|
501 | 502 | self.fullname), |
|
502 | 503 | 'MADWriter') |
|
503 | 504 | os.remove(self.fullname) |
@@ -522,7 +523,7 class MADWriter(Operation): | |||
|
522 | 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 | 527 | endTime = startTime + datetime.timedelta(seconds=self.dataOut.paramInterval) |
|
527 | 528 | heights = self.dataOut.heightList |
|
528 | 529 |
General Comments 0
You need to be logged in to leave comments.
Login now