@@ -224,7 +224,9 def addpcolor(ax, x, y, z, zmin, zmax, xlabel='', ylabel='', title='', colormap= | |||||
224 |
|
224 | |||
225 | printLabels(ax, xlabel, ylabel, title) |
|
225 | printLabels(ax, xlabel, ylabel, title) | |
226 |
|
226 | |||
227 | imesh = ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=matplotlib.pyplot.get_cmap(colormap)) |
|
227 | ax.collections.remove(ax.collections[0]) | |
|
228 | ||||
|
229 | ax.pcolormesh(x,y,z.T,vmin=zmin,vmax=zmax, cmap=matplotlib.pyplot.get_cmap(colormap)) | |||
228 |
|
230 | |||
229 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
|
231 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, | |
230 | ticksize=9, xtick_visible=True, ytick_visible=True, |
|
232 | ticksize=9, xtick_visible=True, ytick_visible=True, |
@@ -178,7 +178,7 class RTIPlot(Figure): | |||||
178 |
|
178 | |||
179 | __isConfig = None |
|
179 | __isConfig = None | |
180 | __nsubplots = None |
|
180 | __nsubplots = None | |
181 |
|
181 | __missing = 1E30 | ||
182 | WIDTHPROF = None |
|
182 | WIDTHPROF = None | |
183 | HEIGHTPROF = None |
|
183 | HEIGHTPROF = None | |
184 | PREFIX = 'rti' |
|
184 | PREFIX = 'rti' | |
@@ -193,6 +193,8 class RTIPlot(Figure): | |||||
193 | self.HEIGHT = 200 |
|
193 | self.HEIGHT = 200 | |
194 | self.WIDTHPROF = 120 |
|
194 | self.WIDTHPROF = 120 | |
195 | self.HEIGHTPROF = 0 |
|
195 | self.HEIGHTPROF = 0 | |
|
196 | self.x_buffer = None | |||
|
197 | self.avgdB_buffer = None | |||
196 |
|
198 | |||
197 | def getSubplots(self): |
|
199 | def getSubplots(self): | |
198 |
|
200 | |||
@@ -276,11 +278,9 class RTIPlot(Figure): | |||||
276 | z = dataOut.data_spc[channelIndexList,:,:]/factor |
|
278 | z = dataOut.data_spc[channelIndexList,:,:]/factor | |
277 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
279 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) | |
278 | avg = numpy.average(z, axis=1) |
|
280 | avg = numpy.average(z, axis=1) | |
279 | noise = dataOut.getNoise()/factor |
|
|||
280 |
|
281 | |||
281 | # zdB = 10.*numpy.log10(z) |
|
|||
282 | avgdB = 10.*numpy.log10(avg) |
|
282 | avgdB = 10.*numpy.log10(avg) | |
283 | noisedB = 10.*numpy.log10(noise) |
|
283 | ||
284 |
|
284 | |||
285 | thisDatetime = dataOut.datatime |
|
285 | thisDatetime = dataOut.datatime | |
286 | title = "RTI: %s" %(thisDatetime.strftime("%d-%b-%Y")) |
|
286 | title = "RTI: %s" %(thisDatetime.strftime("%d-%b-%Y")) | |
@@ -303,16 +303,36 class RTIPlot(Figure): | |||||
303 | if zmax == None: zmax = numpy.nanmax(avgdB)*0.9 |
|
303 | if zmax == None: zmax = numpy.nanmax(avgdB)*0.9 | |
304 |
|
304 | |||
305 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") |
|
305 | self.name = thisDatetime.strftime("%Y%m%d_%H%M%S") | |
|
306 | self.x_buffer = numpy.array([]) | |||
|
307 | self.avgdB_buffer = numpy.array([]) | |||
306 | self.__isConfig = True |
|
308 | self.__isConfig = True | |
307 |
|
309 | |||
308 |
|
310 | |||
309 | self.setWinTitle(title) |
|
311 | self.setWinTitle(title) | |
|
312 | ||||
|
313 | if len(self.avgdB_buffer)==0: | |||
|
314 | self.avgdB_buffer = avgdB | |||
|
315 | newxdim = 1 | |||
|
316 | newydim = -1 | |||
|
317 | else: | |||
|
318 | if x[0]>self.x_buffer[-1]: | |||
|
319 | gap = avgdB.copy() | |||
|
320 | gap[:] = self.__missing | |||
|
321 | self.avgdB_buffer = numpy.hstack((self.avgdB_buffer, gap)) | |||
310 |
|
322 | |||
|
323 | self.avgdB_buffer = numpy.hstack((self.avgdB_buffer, avgdB)) | |||
|
324 | newxdim = -1 | |||
|
325 | newydim = len(y) | |||
|
326 | ||||
|
327 | self.x_buffer = numpy.hstack((self.x_buffer, x)) | |||
|
328 | ||||
|
329 | self.avgdB_buffer = numpy.ma.masked_inside(self.avgdB_buffer,0.99*self.__missing,1.01*self.__missing) | |||
|
330 | ||||
311 | for i in range(self.nplots): |
|
331 | for i in range(self.nplots): | |
312 | title = "Channel %d: %s" %(dataOut.channelList[i], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) |
|
332 | title = "Channel %d: %s" %(dataOut.channelList[i], thisDatetime.strftime("%d-%b-%Y %H:%M:%S")) | |
313 | axes = self.axesList[i*self.__nsubplots] |
|
333 | axes = self.axesList[i*self.__nsubplots] | |
314 |
zdB = avgdB[i].reshape( |
|
334 | zdB = self.avgdB_buffer[i].reshape(newxdim,newydim) | |
315 | axes.pcolor(x, y, zdB, |
|
335 | axes.pcolor(self.x_buffer, y, zdB, | |
316 | xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
|
336 | xmin=tmin, xmax=tmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, | |
317 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, |
|
337 | xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True, | |
318 | ticksize=9, cblabel='', cbsize="1%") |
|
338 | ticksize=9, cblabel='', cbsize="1%") |
@@ -13,12 +13,12 controllerObj = Project() | |||||
13 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
13 | controllerObj.setup(id = '191', name='test01', description=desc) | |
14 |
|
14 | |||
15 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
15 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
16 |
path='/ |
|
16 | path='/remote/ewdrifts/RAW_EXP/EW_DRIFT_FARADAY/EW_Drift', | |
17 | startDate='2011/01/01', |
|
17 | startDate='2011/01/01', | |
18 | endDate='2012/12/31', |
|
18 | endDate='2012/12/31', | |
19 | startTime='00:00:00', |
|
19 | startTime='00:00:00', | |
20 | endTime='23:59:59', |
|
20 | endTime='23:59:59', | |
21 |
online= |
|
21 | online=1, | |
22 | walk=0) |
|
22 | walk=0) | |
23 |
|
23 | |||
24 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
24 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
@@ -36,52 +36,40 procUnitConfObj1.addParameter(name='nFFTPoints', value='128', format='int') | |||||
36 | procUnitConfObj1.addParameter(name='pairsList', value='(0,1),(2,3)', format='pairslist') |
|
36 | procUnitConfObj1.addParameter(name='pairsList', value='(0,1),(2,3)', format='pairslist') | |
37 |
|
37 | |||
38 | opObj11 = procUnitConfObj1.addOperation(name='IncohInt', optype='other') |
|
38 | opObj11 = procUnitConfObj1.addOperation(name='IncohInt', optype='other') | |
39 |
opObj11.addParameter(name='n', value=' |
|
39 | opObj11.addParameter(name='timeInterval', value='0.5', format='float') | |
40 | #opObj11.addParameter(name='timeInterval', value='0.33', format='float') |
|
|||
41 |
|
40 | |||
42 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') |
|
41 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') | |
43 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
42 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
44 | opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str') |
|
43 | opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str') | |
45 |
|
|
44 | opObj11.addParameter(name='zmin', value='10', format='int') | |
46 |
opObj11.addParameter(name='zm |
|
45 | opObj11.addParameter(name='zmax', value='40', format='int') | |
47 | opObj11.addParameter(name='zmax', value='120', format='int') |
|
|||
48 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
46 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
49 |
|
47 | |||
50 |
|
||||
51 | #opObj11 = procUnitConfObj1.addOperation(name='RTIfromNoise', optype='other') |
|
|||
52 | #opObj11.addParameter(name='idfigure', value='2', format='int') |
|
|||
53 | #opObj11.addParameter(name='timerange', value='10', format='int') |
|
|||
54 | #opObj11.addParameter(name='ymin', value='20', format='int') |
|
|||
55 | #opObj11.addParameter(name='ymax', value='120', format='int') |
|
|||
56 |
|
||||
57 | opObj11 = procUnitConfObj1.addOperation(name='ProfilePlot', optype='other') |
|
48 | opObj11 = procUnitConfObj1.addOperation(name='ProfilePlot', optype='other') | |
58 | opObj11.addParameter(name='idfigure', value='2', format='int') |
|
49 | opObj11.addParameter(name='idfigure', value='2', format='int') | |
59 |
|
|
50 | opObj11.addParameter(name='xmin', value='10', format='int') | |
60 |
opObj11.addParameter(name='xm |
|
51 | opObj11.addParameter(name='xmax', value='40', format='int') | |
61 | opObj11.addParameter(name='xmax', value='120', format='int') |
|
52 | ||
62 |
|
||||
63 | opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='other') |
|
53 | opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='other') | |
64 | opObj11.addParameter(name='idfigure', value='3', format='int') |
|
54 | opObj11.addParameter(name='idfigure', value='3', format='int') | |
65 | opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
55 | opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
66 |
opObj11.addParameter(name='zmin', value=' |
|
56 | opObj11.addParameter(name='zmin', value='10', format='int') | |
67 |
opObj11.addParameter(name='zmax', value=' |
|
57 | opObj11.addParameter(name='zmax', value='40', format='int') | |
68 |
|
|
58 | opObj11.addParameter(name='save', value='1', format='bool') | |
|
59 | opObj11.addParameter(name='figpath', value='/home/dsuarez/Pictures/cross_spc', format='str') | |||
69 |
|
60 | |||
70 | opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') |
|
61 | opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') | |
71 | opObj11.addParameter(name='idfigure', value='4', format='int') |
|
62 | opObj11.addParameter(name='idfigure', value='4', format='int') | |
72 | opObj11.addParameter(name='wintitle', value='RTIPLot', format='str') |
|
63 | opObj11.addParameter(name='wintitle', value='RTIPLot', format='str') | |
73 |
opObj11.addParameter(name='zmin', value=' |
|
64 | opObj11.addParameter(name='zmin', value='10', format='int') | |
74 |
opObj11.addParameter(name='zmax', value=' |
|
65 | opObj11.addParameter(name='zmax', value='40', format='int') | |
75 |
opObj11.addParameter(name=' |
|
66 | opObj11.addParameter(name='xmin', value='0', format='int') | |
76 |
opObj11.addParameter(name=' |
|
67 | opObj11.addParameter(name='xmax', value='24', format='int') | |
|
68 | opObj11.addParameter(name='channelList', value='0,1,2,3', format='intlist') | |||
|
69 | #opObj11.addParameter(name='timerange', value='86400', format='int') | |||
|
70 | opObj11.addParameter(name='showprofile', value='0', format='int') | |||
77 | opObj11.addParameter(name='save', value='1', format='bool') |
|
71 | opObj11.addParameter(name='save', value='1', format='bool') | |
78 |
opObj11.addParameter(name='figpath', value='/ |
|
72 | opObj11.addParameter(name='figpath', value='/home/dsuarez/Pictures/rti', format='str') | |
79 |
|
||||
80 | opObj11 = procUnitConfObj1.addOperation(name='CoherenceMap', optype='other') |
|
|||
81 | opObj11.addParameter(name='idfigure', value='5', format='int') |
|
|||
82 | #opObj11.addParameter(name='pairsList', value='(0,2)', format='pairslist') |
|
|||
83 | opObj11.addParameter(name='timerange', value='300', format='int') |
|
|||
84 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
|||
85 |
|
73 | |||
86 | print "Escribiendo el archivo XML" |
|
74 | print "Escribiendo el archivo XML" | |
87 | controllerObj.writeXml(filename) |
|
75 | controllerObj.writeXml(filename) |
General Comments 0
You need to be logged in to leave comments.
Login now