From 31a78476b79743cc59ac5642f66b753c918efcd9 2013-03-05 17:55:19 From: Daniel Valdez Date: 2013-03-05 17:55:19 Subject: [PATCH] Se agrega a JROData el flag realtime, para este caso se da prioridad al procesamiento de datos. Los graficos se generan solo cuando el tiempo de procesamiento es cercano al tiempo de adquisición. --- diff --git a/schainpy/model/jrodata.py b/schainpy/model/jrodata.py index ca17ee8..9892c7a 100644 --- a/schainpy/model/jrodata.py +++ b/schainpy/model/jrodata.py @@ -175,6 +175,8 @@ class JROData: C = 3e8 frequency = 49.92e6 + + realtime = False def __init__(self): diff --git a/schainpy/model/jrodataIO.py b/schainpy/model/jrodataIO.py index 465ffa5..4bca12d 100644 --- a/schainpy/model/jrodataIO.py +++ b/schainpy/model/jrodataIO.py @@ -467,7 +467,7 @@ class JRODataReader(JRODataIO, ProcessingUnit): if not walk: fullpath = path - + foldercounter = '' else: #Filtra solo los directorios for thisPath in os.listdir(path): @@ -479,7 +479,7 @@ class JRODataReader(JRODataIO, ProcessingUnit): dirList.append(thisPath) if not(dirList): - return None, None, None, None, None + return None, None, None, None, None, None dirList = sorted( dirList, key=str.lower ) @@ -1554,6 +1554,8 @@ class VoltageReader(JRODataReader): self.profileIndex += 1 + self.dataOut.realtime = self.online + return self.dataOut.data @@ -2200,6 +2202,8 @@ class SpectraReader(JRODataReader): self.dataOut.flagNoData = False + self.dataOut.realtime = self.online + return self.dataOut.data_spc diff --git a/schainpy/model/jroplot.py b/schainpy/model/jroplot.py index 75b2538..3265f64 100644 --- a/schainpy/model/jroplot.py +++ b/schainpy/model/jroplot.py @@ -1,6 +1,12 @@ import numpy import time, datetime, os from graphics.figure import * +def isRealtime(utcdatatime): + utcnow = time.mktime(datetime.datetime.utcnow().timetuple()) + delta = utcnow - utcdatatime # abs + if delta >= 5*60.: + return False + return True class CrossSpectraPlot(Figure): @@ -1124,6 +1130,11 @@ class SpectraHeisScope(Figure): ymax : None, """ + if dataOut.realtime: + if not(isRealtime(utcdatatime = dataOut.utctime)): + print 'Skipping this plot function' + return + if channelList == None: channelIndexList = dataOut.channelIndexList else: