From 42740733db03c17da8cdeafe56fb40689141d341 2019-08-06 20:40:47 From: Juan C. Espinoza Date: 2019-08-06 20:40:47 Subject: [PATCH] Update plot for moments pow, dop, width, snr --- diff --git a/schainpy/model/data/jrodata.py b/schainpy/model/data/jrodata.py index 5a3bb3e..bd3b703 100644 --- a/schainpy/model/data/jrodata.py +++ b/schainpy/model/data/jrodata.py @@ -1203,9 +1203,11 @@ class PlotterData(object): self.tm = tm self.type = dataOut.type self.parameters = getattr(dataOut, 'parameters', []) + if hasattr(dataOut, 'meta'): self.meta.update(dataOut.meta) - self.channels = dataOut.channelList + + self.pairs = dataOut.pairsList self.interval = dataOut.getTimeInterval() self.localtime = dataOut.useLocalTime if 'spc' in self.plottypes or 'cspc' in self.plottypes or 'spc_moments' in self.plottypes: @@ -1264,6 +1266,11 @@ class PlotterData(object): else: self.data[plot] = buffer + if dataOut.channelList is None: + self.channels = range(buffer.shape[0]) + else: + self.channels = dataOut.channelList + def normalize_heights(self): ''' Ensure same-dimension of the data for different heighList diff --git a/schainpy/model/graphics/jroplot_base.py b/schainpy/model/graphics/jroplot_base.py index ec57ba2..1da00c6 100644 --- a/schainpy/model/graphics/jroplot_base.py +++ b/schainpy/model/graphics/jroplot_base.py @@ -224,7 +224,7 @@ class Plot(Operation): self.throttle = kwargs.get('throttle', 2) self.exp_code = kwargs.get('exp_code', None) self.plot_server = kwargs.get('plot_server', False) - self.sender_period = kwargs.get('sender_period', 2) + self.sender_period = kwargs.get('sender_period', 1) self.__throttle_plot = apply_throttle(self.throttle) self.data = PlotterData( self.CODE, self.throttle, self.exp_code, self.buffering, snr=self.showSNR) @@ -672,6 +672,7 @@ class Plot(Operation): if self.sender_counter < self.sender_period: self.sender_counter += 1 + return self.sender_counter = 1 self.data.meta['titles'] = self.titles @@ -749,14 +750,15 @@ class Plot(Operation): if self.localtime: t -= time.timezone - if self.xmin is None: - self.tmin = t - else: - self.tmin = ( - self.getDateTime(t).replace( - hour=self.xmin, - minute=0, - second=0) - self.getDateTime(0)).total_seconds() + if 'buffer' in self.plot_type: + if self.xmin is None: + self.tmin = t + else: + self.tmin = ( + self.getDateTime(t).replace( + hour=self.xmin, + minute=0, + second=0) - self.getDateTime(0)).total_seconds() self.data.setup() self.isConfig = True diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 688db09..7287693 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -154,7 +154,7 @@ class CrossSpectraPlot(Plot): noise = self.data['noise'][n][-1] pair = self.data.pairs[n] ax = self.axes[4 * n] - spc0 = 10.*numpy.log10(spc[pair[0]]/self.data.factor) + spc0 = 10.*numpy.log10(spc[pair[0]]/self.data.factor) if ax.firsttime: self.xmax = self.xmax if self.xmax else numpy.nanmax(x) self.xmin = self.xmin if self.xmin else -self.xmax @@ -363,12 +363,32 @@ class SnrPlot(RTIPlot): class DopplerPlot(RTIPlot): ''' - Plot for DOPPLER Data + Plot for DOPPLER Data (1st moment) ''' CODE = 'dop' colormap = 'jet' - plot_name = 'Doppler' + plot_name = 'DopplerShift' + + +class PowerPlot(RTIPlot): + ''' + Plot for Power Data (0 moment) + ''' + + CODE = 'pow' + colormap = 'jet' + plot_name = 'TotalPower' + + +class SpectralWidthPlot(RTIPlot): + ''' + Plot for Spectral Width Data (2nd moment) + ''' + + CODE = 'width' + colormap = 'jet' + plot_name = 'SpectralWidth' class SkyMapPlot(Plot):