@@ -50,14 +50,14 class PlotData(Operation, Process): | |||
|
50 | 50 | __missing = 1E30 |
|
51 | 51 | |
|
52 | 52 | __attrs__ = ['show', 'save', 'xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax', |
|
53 |
'zlimits', 'xlabel', 'ylabel', 'cb_label', 'title', |
|
|
54 |
'bgcolor', 'width', 'height', 'localtime', 'oneFigure', |
|
|
53 | 'zlimits', 'xlabel', 'ylabel', 'xaxis','cb_label', 'title', | |
|
54 | 'colorbar', 'bgcolor', 'width', 'height', 'localtime', 'oneFigure', | |
|
55 | 'showprofile', 'decimation'] | |
|
55 | 56 | |
|
56 | 57 | def __init__(self, **kwargs): |
|
57 | 58 | |
|
58 | 59 | Operation.__init__(self, plot=True, **kwargs) |
|
59 | Process.__init__(self) | |
|
60 | self.contador = 0 | |
|
60 | Process.__init__(self) | |
|
61 | 61 | self.kwargs['code'] = self.CODE |
|
62 | 62 | self.mp = False |
|
63 | 63 | self.data = None |
@@ -87,7 +87,7 class PlotData(Operation, Process): | |||
|
87 | 87 | self.ymin = kwargs.get('ymin', None) |
|
88 | 88 | self.ymax = kwargs.get('ymax', None) |
|
89 | 89 | self.xlabel = kwargs.get('xlabel', None) |
|
90 |
self.__MAXNUMY = kwargs.get('decimation', |
|
|
90 | self.__MAXNUMY = kwargs.get('decimation', 200) | |
|
91 | 91 | self.showSNR = kwargs.get('showSNR', False) |
|
92 | 92 | self.oneFigure = kwargs.get('oneFigure', True) |
|
93 | 93 | self.width = kwargs.get('width', None) |
@@ -359,7 +359,7 class PlotData(Operation, Process): | |||
|
359 | 359 | if self.xaxis is 'time': |
|
360 | 360 | dt = self.getDateTime(self.max_time) |
|
361 | 361 | xmax = (dt.replace(hour=int(self.xmax), minute=59, second=59) - |
|
362 | datetime.datetime(1970, 1, 1)).total_seconds() | |
|
362 | datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=1)).total_seconds() | |
|
363 | 363 | if self.data.localtime: |
|
364 | 364 | xmax += time.timezone |
|
365 | 365 | else: |
@@ -369,9 +369,8 class PlotData(Operation, Process): | |||
|
369 | 369 | ymax = self.ymax if self.ymax else numpy.nanmax(self.y) |
|
370 | 370 | |
|
371 | 371 | Y = numpy.array([10, 20, 50, 100, 200, 500, 1000, 2000]) |
|
372 | i = 1 if numpy.where(ymax < Y)[ | |
|
373 | 0][0] < 0 else numpy.where(ymax < Y)[0][0] | |
|
374 | ystep = Y[i - 1] / 5 | |
|
372 | i = 1 if numpy.where(ymax-ymin < Y)[0][0] < 0 else numpy.where(ymax-ymin < Y)[0][0] | |
|
373 | ystep = Y[i] / 5 | |
|
375 | 374 | |
|
376 | 375 | for n, ax in enumerate(self.axes): |
|
377 | 376 | if ax.firsttime: |
@@ -429,6 +428,7 class PlotData(Operation, Process): | |||
|
429 | 428 | if self.nrows == 0 or self.nplots == 0: |
|
430 | 429 | log.warning('No data', self.name) |
|
431 | 430 | fig.text(0.5, 0.5, 'No Data', fontsize='large', ha='center') |
|
431 | fig.canvas.manager.set_window_title(self.CODE) | |
|
432 | 432 | continue |
|
433 | 433 | |
|
434 | 434 | fig.tight_layout() |
@@ -436,8 +436,7 class PlotData(Operation, Process): | |||
|
436 | 436 | self.getDateTime(self.max_time).strftime('%Y/%m/%d'))) |
|
437 | 437 | # fig.canvas.draw() |
|
438 | 438 | |
|
439 |
if self.save: |
|
|
440 | self.contador += 1 | |
|
439 | if self.save and self.data.ended: | |
|
441 | 440 | channels = range(self.nrows) |
|
442 | 441 | if self.oneFigure: |
|
443 | 442 | label = '' |
@@ -445,12 +444,10 class PlotData(Operation, Process): | |||
|
445 | 444 | label = '_{}'.format(channels[n]) |
|
446 | 445 | figname = os.path.join( |
|
447 | 446 | self.save, |
|
448 |
'{}{}_{} |
|
|
447 | '{}{}_{}.png'.format( | |
|
449 | 448 | self.CODE, |
|
450 | 449 | label, |
|
451 | self.getDateTime(self.saveTime).strftime( | |
|
452 | '%y%m%d_%H%M%S'), | |
|
453 | str(self.contador), | |
|
450 | self.getDateTime(self.saveTime).strftime('%y%m%d_%H%M%S') | |
|
454 | 451 | ) |
|
455 | 452 | ) |
|
456 | 453 | log.log('Saving figure: {}'.format(figname), self.name) |
General Comments 0
You need to be logged in to leave comments.
Login now