##// END OF EJS Templates
Update plot for moments pow, dop, width, snr
Juan C. Espinoza -
r1229:42740733db03
parent child
Show More
@@ -1203,9 +1203,11 class PlotterData(object):
1203 self.tm = tm
1203 self.tm = tm
1204 self.type = dataOut.type
1204 self.type = dataOut.type
1205 self.parameters = getattr(dataOut, 'parameters', [])
1205 self.parameters = getattr(dataOut, 'parameters', [])
1206
1206 if hasattr(dataOut, 'meta'):
1207 if hasattr(dataOut, 'meta'):
1207 self.meta.update(dataOut.meta)
1208 self.meta.update(dataOut.meta)
1208 self.channels = dataOut.channelList
1209
1210 self.pairs = dataOut.pairsList
1209 self.interval = dataOut.getTimeInterval()
1211 self.interval = dataOut.getTimeInterval()
1210 self.localtime = dataOut.useLocalTime
1212 self.localtime = dataOut.useLocalTime
1211 if 'spc' in self.plottypes or 'cspc' in self.plottypes or 'spc_moments' in self.plottypes:
1213 if 'spc' in self.plottypes or 'cspc' in self.plottypes or 'spc_moments' in self.plottypes:
@@ -1264,6 +1266,11 class PlotterData(object):
1264 else:
1266 else:
1265 self.data[plot] = buffer
1267 self.data[plot] = buffer
1266
1268
1269 if dataOut.channelList is None:
1270 self.channels = range(buffer.shape[0])
1271 else:
1272 self.channels = dataOut.channelList
1273
1267 def normalize_heights(self):
1274 def normalize_heights(self):
1268 '''
1275 '''
1269 Ensure same-dimension of the data for different heighList
1276 Ensure same-dimension of the data for different heighList
@@ -224,7 +224,7 class Plot(Operation):
224 self.throttle = kwargs.get('throttle', 2)
224 self.throttle = kwargs.get('throttle', 2)
225 self.exp_code = kwargs.get('exp_code', None)
225 self.exp_code = kwargs.get('exp_code', None)
226 self.plot_server = kwargs.get('plot_server', False)
226 self.plot_server = kwargs.get('plot_server', False)
227 self.sender_period = kwargs.get('sender_period', 2)
227 self.sender_period = kwargs.get('sender_period', 1)
228 self.__throttle_plot = apply_throttle(self.throttle)
228 self.__throttle_plot = apply_throttle(self.throttle)
229 self.data = PlotterData(
229 self.data = PlotterData(
230 self.CODE, self.throttle, self.exp_code, self.buffering, snr=self.showSNR)
230 self.CODE, self.throttle, self.exp_code, self.buffering, snr=self.showSNR)
@@ -672,6 +672,7 class Plot(Operation):
672
672
673 if self.sender_counter < self.sender_period:
673 if self.sender_counter < self.sender_period:
674 self.sender_counter += 1
674 self.sender_counter += 1
675 return
675
676
676 self.sender_counter = 1
677 self.sender_counter = 1
677 self.data.meta['titles'] = self.titles
678 self.data.meta['titles'] = self.titles
@@ -749,14 +750,15 class Plot(Operation):
749 if self.localtime:
750 if self.localtime:
750 t -= time.timezone
751 t -= time.timezone
751
752
752 if self.xmin is None:
753 if 'buffer' in self.plot_type:
753 self.tmin = t
754 if self.xmin is None:
754 else:
755 self.tmin = t
755 self.tmin = (
756 else:
756 self.getDateTime(t).replace(
757 self.tmin = (
757 hour=self.xmin,
758 self.getDateTime(t).replace(
758 minute=0,
759 hour=self.xmin,
759 second=0) - self.getDateTime(0)).total_seconds()
760 minute=0,
761 second=0) - self.getDateTime(0)).total_seconds()
760
762
761 self.data.setup()
763 self.data.setup()
762 self.isConfig = True
764 self.isConfig = True
@@ -154,7 +154,7 class CrossSpectraPlot(Plot):
154 noise = self.data['noise'][n][-1]
154 noise = self.data['noise'][n][-1]
155 pair = self.data.pairs[n]
155 pair = self.data.pairs[n]
156 ax = self.axes[4 * n]
156 ax = self.axes[4 * n]
157 spc0 = 10.*numpy.log10(spc[pair[0]]/self.data.factor)
157 spc0 = 10.*numpy.log10(spc[pair[0]]/self.data.factor)
158 if ax.firsttime:
158 if ax.firsttime:
159 self.xmax = self.xmax if self.xmax else numpy.nanmax(x)
159 self.xmax = self.xmax if self.xmax else numpy.nanmax(x)
160 self.xmin = self.xmin if self.xmin else -self.xmax
160 self.xmin = self.xmin if self.xmin else -self.xmax
@@ -363,12 +363,32 class SnrPlot(RTIPlot):
363
363
364 class DopplerPlot(RTIPlot):
364 class DopplerPlot(RTIPlot):
365 '''
365 '''
366 Plot for DOPPLER Data
366 Plot for DOPPLER Data (1st moment)
367 '''
367 '''
368
368
369 CODE = 'dop'
369 CODE = 'dop'
370 colormap = 'jet'
370 colormap = 'jet'
371 plot_name = 'Doppler'
371 plot_name = 'DopplerShift'
372
373
374 class PowerPlot(RTIPlot):
375 '''
376 Plot for Power Data (0 moment)
377 '''
378
379 CODE = 'pow'
380 colormap = 'jet'
381 plot_name = 'TotalPower'
382
383
384 class SpectralWidthPlot(RTIPlot):
385 '''
386 Plot for Spectral Width Data (2nd moment)
387 '''
388
389 CODE = 'width'
390 colormap = 'jet'
391 plot_name = 'SpectralWidth'
372
392
373
393
374 class SkyMapPlot(Plot):
394 class SkyMapPlot(Plot):
General Comments 0
You need to be logged in to leave comments. Login now