@@ -9,7 +9,7 class Figure: | |||||
9 | __isDriverOpen = False |
|
9 | __isDriverOpen = False | |
10 | __isFigureOpen = False |
|
10 | __isFigureOpen = False | |
11 | __isConfig = False |
|
11 | __isConfig = False | |
12 |
|
12 | __counter = 0 | ||
13 | drvObj = None |
|
13 | drvObj = None | |
14 | driver = None |
|
14 | driver = None | |
15 | idfigure = None |
|
15 | idfigure = None | |
@@ -43,6 +43,7 class Figure: | |||||
43 | self.__isDriverOpen = False |
|
43 | self.__isDriverOpen = False | |
44 | self.__isFigureOpen = False |
|
44 | self.__isFigureOpen = False | |
45 | self.__isConfig = False |
|
45 | self.__isConfig = False | |
|
46 | self.__counter = 0 | |||
46 |
|
47 | |||
47 | self.drvObj = Driver(driver, idfigure, xw, yw, wintitle, overplot, colormap, colorbar) |
|
48 | self.drvObj = Driver(driver, idfigure, xw, yw, wintitle, overplot, colormap, colorbar) | |
48 | self.driver = driver |
|
49 | self.driver = driver | |
@@ -107,7 +108,7 class Figure: | |||||
107 |
|
108 | |||
108 | self.drvObj.driver.save(filename) |
|
109 | self.drvObj.driver.save(filename) | |
109 |
|
110 | |||
110 | def plot1DArray(self, data1D, x=None, channelList=None, xmin=None, xmax=None, minvalue=None, maxvalue=None, figuretitle=None, save=False, gpath='./'): |
|
111 | def plot1DArray(self, data1D, x=None, channelList=None, xmin=None, xmax=None, minvalue=None, maxvalue=None, figuretitle=None, save=False, gpath='./', ratio=1): | |
111 |
|
112 | |||
112 | nx, ny = data1D.shape |
|
113 | nx, ny = data1D.shape | |
113 |
|
114 | |||
@@ -146,7 +147,7 class Figure: | |||||
146 | self.__newPage() |
|
147 | self.__newPage() | |
147 |
|
148 | |||
148 |
|
149 | |||
149 | for channel in channelList: |
|
150 | for channel in range(len(channelList)): | |
150 | frameObj = self.frameObjList[channel] |
|
151 | frameObj = self.frameObjList[channel] | |
151 | frameObj.init(xmin=self.xmin, |
|
152 | frameObj.init(xmin=self.xmin, | |
152 | xmax=self.xmax, |
|
153 | xmax=self.xmax, | |
@@ -155,20 +156,25 class Figure: | |||||
155 | minvalue=self.minvalue, |
|
156 | minvalue=self.minvalue, | |
156 | maxvalue=self.maxvalue) |
|
157 | maxvalue=self.maxvalue) | |
157 |
|
158 | |||
158 | for channel in channelList: |
|
159 | for channel in range(len(channelList)): | |
159 | dataCh = data1D[channel,:] |
|
160 | dataCh = data1D[channel,:] | |
160 | frameObj = self.frameObjList[channel] |
|
161 | frameObj = self.frameObjList[channel] | |
161 | frameObj.plot(x, dataCh) |
|
162 | frameObj.plot(x, dataCh) | |
162 |
|
163 | |||
163 | self.__refresh() |
|
164 | self.__refresh() | |
164 |
|
165 | |||
165 |
|
||||
166 | if save: |
|
166 | if save: | |
167 | path = gpath |
|
167 | if self.__counter == 0: | |
168 | now = datetime.datetime.now() |
|
168 | path = gpath | |
169 | file = "scope_img%02d_%d_%d.png"%(self.idfigure, time.mktime(now.timetuple()), now.microsecond) |
|
169 | now = datetime.datetime.now() | |
170 | filename = os.path.join(path,file) |
|
170 | file = "plot_img%02d_%d_%d.png"%(self.idfigure, time.mktime(now.timetuple()), now.microsecond) | |
171 | self.save(filename) |
|
171 | filename = os.path.join(path,file) | |
|
172 | self.save(filename) | |||
|
173 | self.__counter += 1 | |||
|
174 | ||||
|
175 | if self.__counter == ratio: | |||
|
176 | self.__counter = 0 | |||
|
177 | ||||
172 |
|
178 | |||
173 | self.__closePage() |
|
179 | self.__closePage() | |
174 |
|
180 | |||
@@ -188,6 +194,7 class Figure: | |||||
188 | deltax=None, |
|
194 | deltax=None, | |
189 | save=False, |
|
195 | save=False, | |
190 | gpath='./', |
|
196 | gpath='./', | |
|
197 | ratio=1, | |||
191 | cleardata=False, |
|
198 | cleardata=False, | |
192 | *args): |
|
199 | *args): | |
193 |
|
200 | |||
@@ -223,7 +230,7 class Figure: | |||||
223 | self.__newPage() |
|
230 | self.__newPage() | |
224 | self.__isFigureOpen = True |
|
231 | self.__isFigureOpen = True | |
225 |
|
232 | |||
226 | for channel in channelList: |
|
233 | for channel in range(len(channelList)): | |
227 | if len(args) != 0: value = args[0][channel] |
|
234 | if len(args) != 0: value = args[0][channel] | |
228 | else: value = args |
|
235 | else: value = args | |
229 |
|
236 | |||
@@ -240,13 +247,27 class Figure: | |||||
240 | value) |
|
247 | value) | |
241 |
|
248 | |||
242 |
|
249 | |||
243 | for channel in channelList: |
|
250 | for channel in range(len(channelList)): | |
244 | dataCh = data[channel,:] |
|
251 | dataCh = data[channel,:] | |
245 | frameObj = self.frameObjList[channel] |
|
252 | frameObj = self.frameObjList[channel] | |
246 | frameObj.plot(x, y, dataCh) |
|
253 | frameObj.plot(x, y, dataCh) | |
247 |
|
254 | |||
248 |
|
255 | |||
249 | self.__refresh() |
|
256 | self.__refresh() | |
|
257 | ||||
|
258 | if save: | |||
|
259 | if self.__counter == 0: | |||
|
260 | path = gpath | |||
|
261 | now = datetime.datetime.now() | |||
|
262 | file = "pcolor_img%02d_%d_%d.png"%(self.idfigure, time.mktime(now.timetuple()), now.microsecond) | |||
|
263 | filename = os.path.join(path,file) | |||
|
264 | self.save(filename) | |||
|
265 | self.__counter += 1 | |||
|
266 | ||||
|
267 | if self.__counter == ratio: | |||
|
268 | self.__counter = 0 | |||
|
269 | ||||
|
270 | ||||
250 | if cleardata == True: |
|
271 | if cleardata == True: | |
251 | self.__closePage() |
|
272 | self.__closePage() | |
252 | self.__isFigureOpen = False |
|
273 | self.__isFigureOpen = False |
@@ -62,6 +62,11 class CrossSpc(Figure): | |||||
62 |
|
62 | |||
63 |
|
63 | |||
64 | class CrossSpcFrame(Frame): |
|
64 | class CrossSpcFrame(Frame): | |
|
65 | xi = None | |||
|
66 | xw = None | |||
|
67 | yi = None | |||
|
68 | yw = None | |||
|
69 | alpha = None | |||
65 | def __init__(self): |
|
70 | def __init__(self): | |
66 | self.drvObj = drvObj |
|
71 | self.drvObj = drvObj | |
67 | self.idframe = idframe |
|
72 | self.idframe = idframe | |
@@ -72,6 +77,12 class CrossSpcFrame(Frame): | |||||
72 |
|
77 | |||
73 | self.colorbar = colorbar |
|
78 | self.colorbar = colorbar | |
74 | self.showprofile = showprofile |
|
79 | self.showprofile = showprofile | |
|
80 | self.xi = 0. | |||
|
81 | self.xw = 0. | |||
|
82 | self.yi = 0. | |||
|
83 | self.yw = 0. | |||
|
84 | self.alpha = 1. | |||
|
85 | ||||
75 | self.createPlots() |
|
86 | self.createPlots() | |
76 |
|
87 | |||
77 | def createPlots(self): |
|
88 | def createPlots(self): | |
@@ -84,7 +95,7 class CrossSpcFrame(Frame): | |||||
84 | plotObjList.append(plotObj) |
|
95 | plotObjList.append(plotObj) | |
85 |
|
96 | |||
86 | if self.showprofile: |
|
97 | if self.showprofile: | |
87 | xi, yi, xw, yw = self.getScreenPos(idplot) |
|
98 | xi, yi, xw, yw = self.getScreenPosGraph1(idplot) | |
88 | type = "pwbox" |
|
99 | type = "pwbox" | |
89 | title = "" |
|
100 | title = "" | |
90 | xlabel = "dB" |
|
101 | xlabel = "dB" | |
@@ -96,20 +107,36 class CrossSpcFrame(Frame): | |||||
96 |
|
107 | |||
97 | self.plotObjList = plotObjList |
|
108 | self.plotObjList = plotObjList | |
98 |
|
109 | |||
99 | def getScreenPos(self,idplot): |
|
110 | # def getScreenPos(self,idplot): | |
100 | pass |
|
111 | # pass | |
101 |
|
112 | |||
102 |
def getScreenPos |
|
113 | def getScreenPos(self, diplot): | |
103 |
|
|
114 | ||
|
115 | xi = self.xi | |||
|
116 | xw = self.xw | |||
104 |
|
117 | |||
105 | if self.showprofile: |
|
118 | if self.showprofile: | |
106 |
|
|
119 | width = 0.55 | |
|
120 | xw += width | |||
|
121 | ||||
|
122 | ||||
|
123 | ||||
|
124 | ||||
|
125 | self.xi = 0.15 + idplot*self.alpha | |||
|
126 | ||||
|
127 | if self.showprofile: | |||
|
128 | width = 0.55 | |||
|
129 | self.xw += width | |||
107 |
|
130 | |||
108 | else: |
|
131 | else: | |
109 |
|
|
132 | width = 0.65 | |
|
133 | self.xw += width | |||
110 |
|
134 | |||
111 | if self.colorbar: |
|
135 | if self.colorbar: | |
112 | xw = xw - 0.06 |
|
136 | self.xw = self.xw - 0.06 | |
|
137 | ||||
|
138 | ||||
|
139 | self.alpha = self.xw | |||
113 |
|
140 | |||
114 | yi = 0.20; yw = 0.75 |
|
141 | yi = 0.20; yw = 0.75 | |
115 |
|
142 | |||
@@ -117,9 +144,18 class CrossSpcFrame(Frame): | |||||
117 |
|
144 | |||
118 | def getScreenPosGraph1(self): |
|
145 | def getScreenPosGraph1(self): | |
119 | if self.colorbar: |
|
146 | if self.colorbar: | |
120 |
xi = |
|
147 | xi = self.xw + 0.08 | |
121 | else: |
|
148 | else: | |
122 |
xi = |
|
149 | xi = self.xw + 0.05 | |
|
150 | ||||
|
151 | xw = xi + 0.2 | |||
|
152 | ||||
|
153 | self.alpha = xw | |||
|
154 | ||||
|
155 | if self.colorbar: | |||
|
156 | self.xi = 0.65 + 0.08 | |||
|
157 | else: | |||
|
158 | self.xi = 0.75 + 0.05 | |||
123 |
|
159 | |||
124 | xw = xi + 0.2 |
|
160 | xw = xi + 0.2 | |
125 |
|
161 | |||
@@ -211,7 +247,8 class SpcFrame(Frame): | |||||
211 | title = "" |
|
247 | title = "" | |
212 | xlabel = "dB" |
|
248 | xlabel = "dB" | |
213 | ylabel = "" |
|
249 | ylabel = "" | |
214 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel) |
|
250 | szchar = 0.70 | |
|
251 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar) | |||
215 | plotObjList.append(plotObj) |
|
252 | plotObjList.append(plotObj) | |
216 |
|
253 | |||
217 | self.plotObjList = plotObjList |
|
254 | self.plotObjList = plotObjList | |
@@ -319,7 +356,7 class RTIFigure(Figure): | |||||
319 | minvalue = None |
|
356 | minvalue = None | |
320 | maxvalue = None |
|
357 | maxvalue = None | |
321 | xrangestepinsecs = None |
|
358 | xrangestepinsecs = None | |
322 |
|
359 | timefmt=None | ||
323 |
|
360 | |||
324 | def __init__(self, idfigure, nframes, wintitle, driver, colormap="br_green", colorbar= True, showprofile=False): |
|
361 | def __init__(self, idfigure, nframes, wintitle, driver, colormap="br_green", colorbar= True, showprofile=False): | |
325 | Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) |
|
362 | Figure.__init__(self,idfigure, nframes, wintitle, self.xw, self.yw, self.overplot, driver, colormap, colorbar) | |
@@ -339,29 +376,24 class RTIFigure(Figure): | |||||
339 | cdatetime = datetime.datetime.utcfromtimestamp(x) |
|
376 | cdatetime = datetime.datetime.utcfromtimestamp(x) | |
340 |
|
377 | |||
341 | mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,self.starttime.hour,self.starttime.minute,self.starttime.second) |
|
378 | mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,self.starttime.hour,self.starttime.minute,self.starttime.second) | |
342 | if ((xrangestep == 0) or (xrangestep == None)): |
|
379 | ||
343 | maxdatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,self.endtime.hour,self.endtime.minute,self.endtime.second) |
|
380 | maxdatetime = mindatetime + datetime.timedelta(seconds=xrangestep) | |
344 | self.xrangestepinsecs = time.mktime(maxdatetime.timetuple()) - time.mktime(mindatetime.timetuple()) |
|
381 | self.xrangestepinsecs = xrangestep | |
345 | npoints = 1000. |
|
|||
346 | if xrangestep == 1: |
|
|||
347 | maxdatetime = mindatetime + datetime.timedelta(hours=1) |
|
|||
348 | self.xrangestepinsecs = 60*60. |
|
|||
349 | npoints = 500. |
|
|||
350 | if xrangestep == 2: |
|
|||
351 | maxdatetime = mindatetime + datetime.timedelta(minutes=1) |
|
|||
352 | self.xrangestepinsecs = 60. |
|
|||
353 | npoints = 250. |
|
|||
354 | if xrangestep == 3: |
|
|||
355 | maxdatetime = mindatetime + datetime.timedelta(seconds=1) |
|
|||
356 | self.xrangestepinsecs = 1. |
|
|||
357 | npoints = 125. |
|
|||
358 |
|
382 | |||
359 | xmin = time.mktime(mindatetime.timetuple()) |
|
383 | xmin = time.mktime(mindatetime.timetuple()) | |
360 | xmax = time.mktime(maxdatetime.timetuple()) |
|
384 | xmax = time.mktime(maxdatetime.timetuple()) | |
361 |
|
385 | |||
362 | deltax1 = (xmax-xmin) / npoints |
|
386 | if self.xrangestepinsecs<=60.: | |
363 | # deltax = timeInterval |
|
387 | self.timefmt="%H:%M:%S" | |
|
388 | ||||
|
389 | if self.xrangestepinsecs>0. and self.xrangestepinsecs<=1200.: | |||
|
390 | self.timefmt="%H:%M:%S" | |||
|
391 | ||||
|
392 | if self.xrangestepinsecs>1200. and self.xrangestepinsecs<=86400.: | |||
|
393 | self.timefmt="%H:%M" | |||
364 |
|
394 | |||
|
395 | if self.xrangestepinsecs>86400.: | |||
|
396 | self.timefmt="%y:%m:%d:%H" | |||
365 |
|
397 | |||
366 | if ymin == None: ymin = numpy.min(y) |
|
398 | if ymin == None: ymin = numpy.min(y) | |
367 | if ymax == None: ymax = numpy.max(y) |
|
399 | if ymax == None: ymax = numpy.max(y) | |
@@ -385,14 +417,8 class RTIFigure(Figure): | |||||
385 | cdatetime = datetime.datetime.utcfromtimestamp(x) |
|
417 | cdatetime = datetime.datetime.utcfromtimestamp(x) | |
386 |
|
418 | |||
387 | if ((cdatetime.time()>=self.starttime) and (cdatetime.time()<self.endtime)): |
|
419 | if ((cdatetime.time()>=self.starttime) and (cdatetime.time()<self.endtime)): | |
388 | if self.xrangestep == 1: |
|
420 | ||
389 |
|
|
421 | mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,cdatetime.hour,cdatetime.minute,cdatetime.second) | |
390 |
|
||||
391 | if self.xrangestep == 2: |
|
|||
392 | mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,cdatetime.hour,cdatetime.minute,self.starttime.second) |
|
|||
393 |
|
||||
394 | if self.xrangestep == 3: |
|
|||
395 | mindatetime = datetime.datetime(cdatetime.year,cdatetime.month,cdatetime.day,cdatetime.hour,cdatetime.minute,cdatetime.second) |
|
|||
396 |
|
422 | |||
397 | self.xmin = time.mktime(mindatetime.timetuple()) - time.timezone |
|
423 | self.xmin = time.mktime(mindatetime.timetuple()) - time.timezone | |
398 | self.xmax = self.xmin + self.xrangestepinsecs |
|
424 | self.xmax = self.xmin + self.xrangestepinsecs | |
@@ -409,11 +435,11 class RTIFigure(Figure): | |||||
409 | self.frameObjList = [] |
|
435 | self.frameObjList = [] | |
410 |
|
436 | |||
411 | for frame in range(self.nframes): |
|
437 | for frame in range(self.nframes): | |
412 | frameObj = RTIFrame(self.drvObj,frame + 1, self.colorbar, self.showprofile) |
|
438 | frameObj = RTIFrame(self.drvObj,frame + 1, self.colorbar, self.showprofile, self.timefmt) | |
413 | self.frameObjList.append(frameObj) |
|
439 | self.frameObjList.append(frameObj) | |
414 |
|
440 | |||
415 | class RTIFrame(Frame): |
|
441 | class RTIFrame(Frame): | |
416 | def __init__(self,drvObj,idframe,colorbar,showprofile): |
|
442 | def __init__(self,drvObj,idframe,colorbar,showprofile, timefmt): | |
417 | self.drvObj = drvObj |
|
443 | self.drvObj = drvObj | |
418 | self.idframe = idframe |
|
444 | self.idframe = idframe | |
419 | self.nplots = 1 |
|
445 | self.nplots = 1 | |
@@ -423,6 +449,7 class RTIFrame(Frame): | |||||
423 |
|
449 | |||
424 | self.colorbar = colorbar |
|
450 | self.colorbar = colorbar | |
425 | self.showprofile = showprofile |
|
451 | self.showprofile = showprofile | |
|
452 | self.timefmt = timefmt | |||
426 | self.createPlots() |
|
453 | self.createPlots() | |
427 |
|
454 | |||
428 | def createPlots(self): |
|
455 | def createPlots(self): | |
@@ -431,7 +458,7 class RTIFrame(Frame): | |||||
431 | idplot = 0 |
|
458 | idplot = 0 | |
432 | xi, yi, xw, yw = self.getScreenPos(idplot) |
|
459 | xi, yi, xw, yw = self.getScreenPos(idplot) | |
433 |
|
460 | |||
434 | plotObj = RTIPlot(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, self.colorbar) |
|
461 | plotObj = RTIPlot(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, self.colorbar, self.timefmt) | |
435 | plotObjList.append(plotObj) |
|
462 | plotObjList.append(plotObj) | |
436 |
|
463 | |||
437 | if self.showprofile: |
|
464 | if self.showprofile: | |
@@ -441,7 +468,8 class RTIFrame(Frame): | |||||
441 | title = "" |
|
468 | title = "" | |
442 | xlabel = "dB" |
|
469 | xlabel = "dB" | |
443 | ylabel = "" |
|
470 | ylabel = "" | |
444 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel) |
|
471 | szchar = 0.75 | |
|
472 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar) | |||
445 | plotObjList.append(plotObj) |
|
473 | plotObjList.append(plotObj) | |
446 |
|
474 | |||
447 | self.plotObjList = plotObjList |
|
475 | self.plotObjList = plotObjList | |
@@ -490,7 +518,7 class RTIPlot(Plot): | |||||
490 | xg = None |
|
518 | xg = None | |
491 | yg = None |
|
519 | yg = None | |
492 |
|
520 | |||
493 | def __init__(self,drvObj, idframe, idplot, xi, yi, xw, yw, colorbar): |
|
521 | def __init__(self,drvObj, idframe, idplot, xi, yi, xw, yw, colorbar, timefmt): | |
494 | self.drvObj = drvObj |
|
522 | self.drvObj = drvObj | |
495 | self.idframe = idframe |
|
523 | self.idframe = idframe | |
496 | self.idplot = idplot |
|
524 | self.idplot = idplot | |
@@ -511,7 +539,7 class RTIPlot(Plot): | |||||
511 | self.xpos = [self.xi,self.xw] |
|
539 | self.xpos = [self.xi,self.xw] | |
512 | self.ypos = [self.yi,self.yw] |
|
540 | self.ypos = [self.yi,self.yw] | |
513 | self.xaxisastime = True |
|
541 | self.xaxisastime = True | |
514 |
self.timefmt = |
|
542 | self.timefmt = timefmt | |
515 | self.xopt = "bcnstd" |
|
543 | self.xopt = "bcnstd" | |
516 | self.yopt = "bcnstv" |
|
544 | self.yopt = "bcnstv" | |
517 |
|
545 | |||
@@ -577,14 +605,15 class ScopeFigure(Figure): | |||||
577 |
|
605 | |||
578 |
|
606 | |||
579 | class ScopeFrame(Frame): |
|
607 | class ScopeFrame(Frame): | |
580 | # plotObjList = [] |
|
|||
581 | xlabel = "" |
|
608 | xlabel = "" | |
582 | ylabel = "" |
|
609 | ylabel = "" | |
583 | title = "" |
|
610 | title = "" | |
|
611 | szchar = 1.1 | |||
|
612 | ||||
584 | def __init__(self,drvObj,idframe): |
|
613 | def __init__(self,drvObj,idframe): | |
585 | self.drvObj = drvObj |
|
614 | self.drvObj = drvObj | |
586 | self.idframe = idframe |
|
615 | self.idframe = idframe | |
587 |
self.nplots = 1 |
|
616 | self.nplots = 1 | |
588 | self.createPlots() |
|
617 | self.createPlots() | |
589 | # Frame.__init__(self, drvObj, idframe) |
|
618 | # Frame.__init__(self, drvObj, idframe) | |
590 |
|
619 | |||
@@ -601,10 +630,11 class ScopeFrame(Frame): | |||||
601 | title = "Channel %d"%self.idframe |
|
630 | title = "Channel %d"%self.idframe | |
602 | xlabel = "range (Km)" |
|
631 | xlabel = "range (Km)" | |
603 | ylabel = "intensity" |
|
632 | ylabel = "intensity" | |
604 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel) |
|
633 | plotObj = Plot1D(self.drvObj, self.idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, self.szchar) | |
605 | plotObjList.append(plotObj) |
|
634 | plotObjList.append(plotObj) | |
|
635 | ||||
606 | self.plotObjList = plotObjList |
|
636 | self.plotObjList = plotObjList | |
607 | # self.plotObjList.append(plotObj) |
|
637 | ||
608 |
|
638 | |||
609 | def plot(self, x, y, z=None): |
|
639 | def plot(self, x, y, z=None): | |
610 | for plotObj in self.plotObjList: |
|
640 | for plotObj in self.plotObjList: | |
@@ -613,7 +643,7 class ScopeFrame(Frame): | |||||
613 |
|
643 | |||
614 | class Plot1D(Plot): |
|
644 | class Plot1D(Plot): | |
615 | # type, title, xlabel, ylabel |
|
645 | # type, title, xlabel, ylabel | |
616 | def __init__(self, drvObj, idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel): |
|
646 | def __init__(self, drvObj, idframe, idplot, xi, yi, xw, yw, type, title, xlabel, ylabel, szchar): | |
617 | self.drvObj = drvObj |
|
647 | self.drvObj = drvObj | |
618 | self.idframe = idframe |
|
648 | self.idframe = idframe | |
619 | self.idplot = idplot |
|
649 | self.idplot = idplot | |
@@ -627,7 +657,7 class Plot1D(Plot): | |||||
627 | self.timefmt = None |
|
657 | self.timefmt = None | |
628 | self.xopt = "bcnst" |
|
658 | self.xopt = "bcnst" | |
629 | self.yopt = "bcnstv" |
|
659 | self.yopt = "bcnstv" | |
630 |
self.szchar = |
|
660 | self.szchar = szchar | |
631 | self.type = type |
|
661 | self.type = type | |
632 | self.title = title |
|
662 | self.title = title | |
633 | self.xlabel = xlabel |
|
663 | self.xlabel = xlabel |
@@ -283,7 +283,8 class SpectraProcessor: | |||||
283 | showprofile=False, |
|
283 | showprofile=False, | |
284 | save=False, |
|
284 | save=False, | |
285 | gpath=None, |
|
285 | gpath=None, | |
286 |
|
|
286 | ratio=1, | |
|
287 | channelList=None): | |||
287 |
|
288 | |||
288 | if self.dataOutObj.flagNoData: |
|
289 | if self.dataOutObj.flagNoData: | |
289 | return 0 |
|
290 | return 0 |
@@ -72,27 +72,28 class VoltageProcessor: | |||||
72 | showprofile=False, |
|
72 | showprofile=False, | |
73 | xrangestep=None, |
|
73 | xrangestep=None, | |
74 | save=False, |
|
74 | save=False, | |
75 |
gpath=None |
|
75 | gpath=None, | |
|
76 | ratio=1, | |||
|
77 | channelList=None): | |||
76 |
|
78 | |||
77 | if self.dataOutObj.flagNoData: |
|
79 | if self.dataOutObj.flagNoData: | |
78 | return 0 |
|
80 | return 0 | |
79 |
|
81 | |||
80 | nframes = len(self.dataOutObj.channelList) |
|
82 | if channelList == None: | |
|
83 | channelList = self.dataOutObj.channelList | |||
|
84 | ||||
|
85 | nframes = len(channelList) | |||
81 |
|
86 | |||
82 | if len(self.plotObjList) <= self.plotObjIndex: |
|
87 | if len(self.plotObjList) <= self.plotObjIndex: | |
83 | self.addRti(idfigure, nframes, wintitle, driver, colormap, colorbar, showprofile) |
|
88 | self.addRti(idfigure, nframes, wintitle, driver, colormap, colorbar, showprofile) | |
84 |
|
89 | |||
85 | data = self.dataOutObj.data * numpy.conjugate(self.dataOutObj.data) |
|
90 | data = self.dataOutObj.data[channelList,:] * numpy.conjugate(self.dataOutObj.data[channelList,:]) | |
86 | data = 10*numpy.log10(data.real) |
|
91 | data = 10*numpy.log10(data.real) | |
87 |
|
92 | |||
88 | # currenttime = self.dataOutObj.utctime |
|
|||
89 | # if timezone == "lt": |
|
|||
90 | currenttime = self.dataOutObj.utctime - time.timezone |
|
93 | currenttime = self.dataOutObj.utctime - time.timezone | |
91 |
|
94 | |||
92 | range = self.dataOutObj.heightList |
|
95 | range = self.dataOutObj.heightList | |
93 |
|
96 | |||
94 | channelList = self.dataOutObj.channelList |
|
|||
95 |
|
||||
96 | thisdatetime = datetime.datetime.fromtimestamp(self.dataOutObj.utctime) |
|
97 | thisdatetime = datetime.datetime.fromtimestamp(self.dataOutObj.utctime) | |
97 | dateTime = "%s"%(thisdatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
98 | dateTime = "%s"%(thisdatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
98 | date = "%s"%(thisdatetime.strftime("%d-%b-%Y")) |
|
99 | date = "%s"%(thisdatetime.strftime("%d-%b-%Y")) | |
@@ -120,7 +121,9 class VoltageProcessor: | |||||
120 | deltax=deltax, |
|
121 | deltax=deltax, | |
121 | save=save, |
|
122 | save=save, | |
122 | gpath=gpath, |
|
123 | gpath=gpath, | |
123 |
|
|
124 | ratio=ratio, | |
|
125 | cleardata=cleardata | |||
|
126 | ) | |||
124 |
|
127 | |||
125 |
|
128 | |||
126 | self.plotObjIndex += 1 |
|
129 | self.plotObjIndex += 1 | |
@@ -142,9 +145,7 class VoltageProcessor: | |||||
142 | driver='plplot', |
|
145 | driver='plplot', | |
143 | save=False, |
|
146 | save=False, | |
144 | gpath=None, |
|
147 | gpath=None, | |
145 |
|
|
148 | ratio=1, | |
146 | xlabelList=None, |
|
|||
147 | ylabelList=None, |
|
|||
148 | type="power"): |
|
149 | type="power"): | |
149 |
|
150 | |||
150 | if self.dataOutObj.flagNoData: |
|
151 | if self.dataOutObj.flagNoData: | |
@@ -181,7 +182,8 class VoltageProcessor: | |||||
181 | maxvalue=maxvalue, |
|
182 | maxvalue=maxvalue, | |
182 | figuretitle=figuretitle, |
|
183 | figuretitle=figuretitle, | |
183 | save=save, |
|
184 | save=save, | |
184 |
gpath=gpath |
|
185 | gpath=gpath, | |
|
186 | ratio=ratio) | |||
185 |
|
187 | |||
186 |
|
188 | |||
187 | self.plotObjIndex += 1 |
|
189 | self.plotObjIndex += 1 | |
@@ -223,6 +225,7 class VoltageProcessor: | |||||
223 | self.dataOutObj.flagNoData = True |
|
225 | self.dataOutObj.flagNoData = True | |
224 |
|
226 | |||
225 | if myCohIntObj.isReady: |
|
227 | if myCohIntObj.isReady: | |
|
228 | self.dataOutObj.timeInterval = myCohIntObj.nCohInt * self.dataOutObj.timeInterval | |||
226 | self.dataOutObj.flagNoData = False |
|
229 | self.dataOutObj.flagNoData = False | |
227 |
|
230 | |||
228 | def selectChannels(self, channelList): |
|
231 | def selectChannels(self, channelList): |
General Comments 0
You need to be logged in to leave comments.
Login now