##// END OF EJS Templates
add NoisePlot
jespinoza -
r907:4034368d1421
parent child
Show More
@@ -40,7 +40,7 class PlotData(Operation, Process):
40 self.show = kwargs.get('show', True)
40 self.show = kwargs.get('show', True)
41 self.save = kwargs.get('save', False)
41 self.save = kwargs.get('save', False)
42 self.colormap = kwargs.get('colormap', self.colormap)
42 self.colormap = kwargs.get('colormap', self.colormap)
43 self.showprofile = kwargs.get('showprofile', False)
43 self.showprofile = kwargs.get('showprofile', True)
44 self.title = kwargs.get('wintitle', '')
44 self.title = kwargs.get('wintitle', '')
45 self.xaxis = kwargs.get('xaxis', 'time')
45 self.xaxis = kwargs.get('xaxis', 'time')
46 self.zmin = kwargs.get('zmin', None)
46 self.zmin = kwargs.get('zmin', None)
@@ -182,7 +182,7 class PlotSpectraData(PlotData):
182 self.axes.append(ax)
182 self.axes.append(ax)
183 n += 1
183 n += 1
184
184
185 self.figure.subplots_adjust(wspace=0.9, hspace=0.5)
185 self.figure.subplots_adjust(left=0.1, right=0.95, bottom=0.15, top=0.85, wspace=0.9, hspace=0.5)
186 self.figure.show()
186 self.figure.show()
187
187
188 def plot(self):
188 def plot(self):
@@ -258,6 +258,8 class PlotRTIData(PlotData):
258 self.nrows = self.dataOut.nChannels
258 self.nrows = self.dataOut.nChannels
259 self.width = 10
259 self.width = 10
260 self.height = 2.2*self.nrows
260 self.height = 2.2*self.nrows
261 if self.nrows==1:
262 self.height += 1
261 self.ylabel = 'Range [Km]'
263 self.ylabel = 'Range [Km]'
262 self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList]
264 self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList]
263
265
@@ -345,6 +347,8 class PlotCOHData(PlotRTIData):
345 self.nrows = self.dataOut.nPairs
347 self.nrows = self.dataOut.nPairs
346 self.width = 10
348 self.width = 10
347 self.height = 2.2*self.nrows
349 self.height = 2.2*self.nrows
350 if self.nrows==1:
351 self.height += 1
348 self.ylabel = 'Range [Km]'
352 self.ylabel = 'Range [Km]'
349 self.titles = ['Channels {}'.format(x) for x in self.dataOut.pairsList]
353 self.titles = ['Channels {}'.format(x) for x in self.dataOut.pairsList]
350
354
@@ -354,6 +358,7 class PlotCOHData(PlotRTIData):
354 facecolor='w')
358 facecolor='w')
355 else:
359 else:
356 self.figure.clf()
360 self.figure.clf()
361 self.axes = []
357
362
358 for n in range(self.nrows):
363 for n in range(self.nrows):
359 ax = self.figure.add_subplot(self.nrows, self.ncols, n+1)
364 ax = self.figure.add_subplot(self.nrows, self.ncols, n+1)
@@ -363,8 +368,54 class PlotCOHData(PlotRTIData):
363 self.figure.subplots_adjust(hspace=0.5)
368 self.figure.subplots_adjust(hspace=0.5)
364 self.figure.show()
369 self.figure.show()
365
370
366 class PlotSNRData(PlotRTIData):
371 class PlotNoiseData(PlotData):
372 CODE = 'noise'
373
374 def setup(self):
375
376 self.ncols = 1
377 self.nrows = 1
378 self.width = 10
379 self.height = 3.2
380 self.ylabel = 'Intensity [dB]'
381 self.titles = ['Noise']
367
382
383 if self.figure is None:
384 self.figure = plt.figure(figsize=(self.width, self.height),
385 edgecolor='k',
386 facecolor='w')
387 else:
388 self.figure.clf()
389 self.axes = []
390
391 self.ax = self.figure.add_subplot(self.nrows, self.ncols, 1)
392 self.ax.firsttime = True
393
394 self.figure.show()
395
396 def plot(self):
397
398 x = self.times
399 xmin = self.min_time
400 xmax = xmin+self.xrange*60*60
401 if self.ax.firsttime:
402 for ch in self.dataOut.channelList:
403 y = [self.data[self.CODE][t][ch] for t in self.times]
404 self.ax.plot(x, y, lw=1, label='Ch{}'.format(ch))
405 self.ax.firsttime = False
406 self.ax.xaxis.set_major_formatter(FuncFormatter(func))
407 self.ax.xaxis.set_major_locator(LinearLocator(6))
408 self.ax.set_ylabel(self.ylabel)
409 plt.legend()
410 else:
411 for ch in self.dataOut.channelList:
412 y = [self.data[self.CODE][t][ch] for t in self.times]
413 self.ax.lines[ch].set_data(x, y)
414
415 self.ax.set_xlim(xmin, xmax)
416 self.ax.set_ylim(min(y)-5, max(y)+5)
417
418 class PlotSNRData(PlotRTIData):
368 CODE = 'snr'
419 CODE = 'snr'
369
420
370 class PlotDOPData(PlotRTIData):
421 class PlotDOPData(PlotRTIData):
@@ -372,6 +423,5 class PlotDOPData(PlotRTIData):
372 colormap = 'jet'
423 colormap = 'jet'
373
424
374 class PlotPHASEData(PlotCOHData):
425 class PlotPHASEData(PlotCOHData):
375
376 CODE = 'phase'
426 CODE = 'phase'
377 colormap = 'seismic'
427 colormap = 'seismic'
General Comments 0
You need to be logged in to leave comments. Login now