##// END OF EJS Templates
Modifications in Param Writer, files now split in two when there is a big difference in time between contiguous data
Julio Valdez -
r853:3ad9b63d79aa
parent child
Show More
@@ -599,6 +599,8 class ParamWriter(Operation):
599
599
600 currentDay = None
600 currentDay = None
601
601
602 lastTime = None
603
602 def __init__(self):
604 def __init__(self):
603
605
604 Operation.__init__(self)
606 Operation.__init__(self)
@@ -792,16 +794,29 class ParamWriter(Operation):
792 grp.create_dataset(self.metadataList[i], data=getattr(self.dataOut, self.metadataList[i]))
794 grp.create_dataset(self.metadataList[i], data=getattr(self.dataOut, self.metadataList[i]))
793 return
795 return
794
796
795 def dateFlag(self):
797 def timeFlag(self):
798 currentTime = self.dataOut.utctime
796
799
797 timeTuple = time.localtime(self.dataOut.utctime)
800 if self.lastTime is None:
801 self.lastTime = currentTime
802
803 #Day
804 timeTuple = time.localtime(currentTime)
798 dataDay = timeTuple.tm_yday
805 dataDay = timeTuple.tm_yday
799
806
800 if dataDay == self.currentDay:
807 #Time
801 return False
808 timeDiff = currentTime - self.lastTime
802
809
803 self.currentDay = dataDay
810 #Si el dia es diferente o si la diferencia entre un dato y otro supera la hora
804 return True
811 if dataDay != self.currentDay:
812 self.currentDay = dataDay
813 return True
814 elif timeDiff > 3*60*60:
815 self.lastTime = currentTime
816 return True
817 else:
818 self.lastTime = currentTime
819 return False
805
820
806 def setNextFile(self):
821 def setNextFile(self):
807
822
@@ -916,7 +931,7 class ParamWriter(Operation):
916
931
917 def putData(self):
932 def putData(self):
918
933
919 if self.blockIndex == self.blocksPerFile or self.dateFlag():
934 if self.blockIndex == self.blocksPerFile or self.timeFlag():
920 self.setNextFile()
935 self.setNextFile()
921
936
922 # if not self.firsttime:
937 # if not self.firsttime:
General Comments 0
You need to be logged in to leave comments. Login now