diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 71a9ccd..d7b20a5 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -50,14 +50,14 @@ class PlotData(Operation, Process): __missing = 1E30 __attrs__ = ['show', 'save', 'xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax', - 'zlimits', 'xlabel', 'ylabel', 'cb_label', 'title', 'titles', 'colorbar', - 'bgcolor', 'width', 'height', 'localtime', 'oneFigure', 'showprofile'] + 'zlimits', 'xlabel', 'ylabel', 'xaxis','cb_label', 'title', + 'colorbar', 'bgcolor', 'width', 'height', 'localtime', 'oneFigure', + 'showprofile', 'decimation'] def __init__(self, **kwargs): Operation.__init__(self, plot=True, **kwargs) - Process.__init__(self) - self.contador = 0 + Process.__init__(self) self.kwargs['code'] = self.CODE self.mp = False self.data = None @@ -87,7 +87,7 @@ class PlotData(Operation, Process): self.ymin = kwargs.get('ymin', None) self.ymax = kwargs.get('ymax', None) self.xlabel = kwargs.get('xlabel', None) - self.__MAXNUMY = kwargs.get('decimation', 300) + self.__MAXNUMY = kwargs.get('decimation', 200) self.showSNR = kwargs.get('showSNR', False) self.oneFigure = kwargs.get('oneFigure', True) self.width = kwargs.get('width', None) @@ -359,7 +359,7 @@ class PlotData(Operation, Process): if self.xaxis is 'time': dt = self.getDateTime(self.max_time) xmax = (dt.replace(hour=int(self.xmax), minute=59, second=59) - - datetime.datetime(1970, 1, 1)).total_seconds() + datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=1)).total_seconds() if self.data.localtime: xmax += time.timezone else: @@ -369,9 +369,8 @@ class PlotData(Operation, Process): ymax = self.ymax if self.ymax else numpy.nanmax(self.y) Y = numpy.array([10, 20, 50, 100, 200, 500, 1000, 2000]) - i = 1 if numpy.where(ymax < Y)[ - 0][0] < 0 else numpy.where(ymax < Y)[0][0] - ystep = Y[i - 1] / 5 + i = 1 if numpy.where(ymax-ymin < Y)[0][0] < 0 else numpy.where(ymax-ymin < Y)[0][0] + ystep = Y[i] / 5 for n, ax in enumerate(self.axes): if ax.firsttime: @@ -429,6 +428,7 @@ class PlotData(Operation, Process): if self.nrows == 0 or self.nplots == 0: log.warning('No data', self.name) fig.text(0.5, 0.5, 'No Data', fontsize='large', ha='center') + fig.canvas.manager.set_window_title(self.CODE) continue fig.tight_layout() @@ -436,8 +436,7 @@ class PlotData(Operation, Process): self.getDateTime(self.max_time).strftime('%Y/%m/%d'))) # fig.canvas.draw() - if self.save: # and self.data.ended: - self.contador += 1 + if self.save and self.data.ended: channels = range(self.nrows) if self.oneFigure: label = '' @@ -445,12 +444,10 @@ class PlotData(Operation, Process): label = '_{}'.format(channels[n]) figname = os.path.join( self.save, - '{}{}_{}{}.png'.format( + '{}{}_{}.png'.format( self.CODE, label, - self.getDateTime(self.saveTime).strftime( - '%y%m%d_%H%M%S'), - str(self.contador), + self.getDateTime(self.saveTime).strftime('%y%m%d_%H%M%S') ) ) log.log('Saving figure: {}'.format(figname), self.name)