@@ -40,7 +40,7 class PlotData(Operation, Process): | |||
|
40 | 40 | self.show = kwargs.get('show', True) |
|
41 | 41 | self.save = kwargs.get('save', False) |
|
42 | 42 | self.colormap = kwargs.get('colormap', self.colormap) |
|
43 |
self.showprofile = kwargs.get('showprofile', |
|
|
43 | self.showprofile = kwargs.get('showprofile', True) | |
|
44 | 44 | self.title = kwargs.get('wintitle', '') |
|
45 | 45 | self.xaxis = kwargs.get('xaxis', 'time') |
|
46 | 46 | self.zmin = kwargs.get('zmin', None) |
@@ -182,7 +182,7 class PlotSpectraData(PlotData): | |||
|
182 | 182 | self.axes.append(ax) |
|
183 | 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 | 186 | self.figure.show() |
|
187 | 187 | |
|
188 | 188 | def plot(self): |
@@ -258,6 +258,8 class PlotRTIData(PlotData): | |||
|
258 | 258 | self.nrows = self.dataOut.nChannels |
|
259 | 259 | self.width = 10 |
|
260 | 260 | self.height = 2.2*self.nrows |
|
261 | if self.nrows==1: | |
|
262 | self.height += 1 | |
|
261 | 263 | self.ylabel = 'Range [Km]' |
|
262 | 264 | self.titles = ['Channel {}'.format(x) for x in self.dataOut.channelList] |
|
263 | 265 | |
@@ -345,6 +347,8 class PlotCOHData(PlotRTIData): | |||
|
345 | 347 | self.nrows = self.dataOut.nPairs |
|
346 | 348 | self.width = 10 |
|
347 | 349 | self.height = 2.2*self.nrows |
|
350 | if self.nrows==1: | |
|
351 | self.height += 1 | |
|
348 | 352 | self.ylabel = 'Range [Km]' |
|
349 | 353 | self.titles = ['Channels {}'.format(x) for x in self.dataOut.pairsList] |
|
350 | 354 | |
@@ -354,6 +358,7 class PlotCOHData(PlotRTIData): | |||
|
354 | 358 | facecolor='w') |
|
355 | 359 | else: |
|
356 | 360 | self.figure.clf() |
|
361 | self.axes = [] | |
|
357 | 362 | |
|
358 | 363 | for n in range(self.nrows): |
|
359 | 364 | ax = self.figure.add_subplot(self.nrows, self.ncols, n+1) |
@@ -363,8 +368,54 class PlotCOHData(PlotRTIData): | |||
|
363 | 368 | self.figure.subplots_adjust(hspace=0.5) |
|
364 | 369 | self.figure.show() |
|
365 | 370 | |
|
366 |
class Plot |
|
|
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 | 419 | CODE = 'snr' |
|
369 | 420 | |
|
370 | 421 | class PlotDOPData(PlotRTIData): |
@@ -372,6 +423,5 class PlotDOPData(PlotRTIData): | |||
|
372 | 423 | colormap = 'jet' |
|
373 | 424 | |
|
374 | 425 | class PlotPHASEData(PlotCOHData): |
|
375 | ||
|
376 | 426 | CODE = 'phase' |
|
377 | 427 | colormap = 'seismic' |
General Comments 0
You need to be logged in to leave comments.
Login now