@@ -1173,7 +1173,7 class PlotterData(object): | |||||
1173 | plot = 'snr' |
|
1173 | plot = 'snr' | |
1174 | self.data[plot] = {} |
|
1174 | self.data[plot] = {} | |
1175 |
|
1175 | |||
1176 | if 'spc' in self.data or 'rti' in self.data: |
|
1176 | if 'spc' in self.data or 'rti' in self.data or 'cspc' in self.data: | |
1177 | self.data['noise'] = {} |
|
1177 | self.data['noise'] = {} | |
1178 | if 'noise' not in self.plottypes: |
|
1178 | if 'noise' not in self.plottypes: | |
1179 | self.plottypes.append('noise') |
|
1179 | self.plottypes.append('noise') | |
@@ -1209,6 +1209,7 class PlotterData(object): | |||||
1209 | if 'spc' in self.plottypes or 'cspc' in self.plottypes: |
|
1209 | if 'spc' in self.plottypes or 'cspc' in self.plottypes: | |
1210 | self.xrange = (dataOut.getFreqRange(1)/1000., |
|
1210 | self.xrange = (dataOut.getFreqRange(1)/1000., | |
1211 | dataOut.getAcfRange(1), dataOut.getVelRange(1)) |
|
1211 | dataOut.getAcfRange(1), dataOut.getVelRange(1)) | |
|
1212 | self.factor = dataOut.normFactor | |||
1212 | self.__heights.append(dataOut.heightList) |
|
1213 | self.__heights.append(dataOut.heightList) | |
1213 | self.__all_heights.update(dataOut.heightList) |
|
1214 | self.__all_heights.update(dataOut.heightList) | |
1214 | self.__times.append(tm) |
|
1215 | self.__times.append(tm) | |
@@ -1218,7 +1219,8 class PlotterData(object): | |||||
1218 | z = dataOut.data_spc/dataOut.normFactor |
|
1219 | z = dataOut.data_spc/dataOut.normFactor | |
1219 | buffer = 10*numpy.log10(z) |
|
1220 | buffer = 10*numpy.log10(z) | |
1220 | if plot == 'cspc': |
|
1221 | if plot == 'cspc': | |
1221 |
|
|
1222 | z = dataOut.data_spc/dataOut.normFactor | |
|
1223 | buffer = (dataOut.data_spc, dataOut.data_cspc) | |||
1222 | if plot == 'noise': |
|
1224 | if plot == 'noise': | |
1223 | buffer = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) |
|
1225 | buffer = 10*numpy.log10(dataOut.getNoise()/dataOut.normFactor) | |
1224 | if plot == 'rti': |
|
1226 | if plot == 'rti': | |
@@ -1242,8 +1244,11 class PlotterData(object): | |||||
1242 | if plot == 'param': |
|
1244 | if plot == 'param': | |
1243 | buffer = dataOut.data_param |
|
1245 | buffer = dataOut.data_param | |
1244 |
|
1246 | |||
1245 |
if 'spc' |
|
1247 | if plot == 'spc': | |
1246 | self.data[plot] = buffer |
|
1248 | self.data[plot] = buffer | |
|
1249 | elif plot == 'cspc': | |||
|
1250 | self.data['spc'] = buffer[0] | |||
|
1251 | self.data['cspc'] = buffer[1] | |||
1247 | else: |
|
1252 | else: | |
1248 | if self.buffering: |
|
1253 | if self.buffering: | |
1249 | self.data[plot][tm] = buffer |
|
1254 | self.data[plot][tm] = buffer |
@@ -672,7 +672,7 class Plot(Operation): | |||||
672 | ax.set_title('{} {} {}'.format( |
|
672 | ax.set_title('{} {} {}'.format( | |
673 | self.titles[n], |
|
673 | self.titles[n], | |
674 | self.getDateTime(self.data.max_time).strftime( |
|
674 | self.getDateTime(self.data.max_time).strftime( | |
675 |
' |
|
675 | '%H:%M:%S'), | |
676 | self.time_label), |
|
676 | self.time_label), | |
677 | size=8) |
|
677 | size=8) | |
678 | else: |
|
678 | else: |
@@ -112,6 +112,7 class SpectraPlot(Plot): | |||||
112 | class CrossSpectraPlot(Plot): |
|
112 | class CrossSpectraPlot(Plot): | |
113 |
|
113 | |||
114 | CODE = 'cspc' |
|
114 | CODE = 'cspc' | |
|
115 | colormap = 'jet' | |||
115 | zmin_coh = None |
|
116 | zmin_coh = None | |
116 | zmax_coh = None |
|
117 | zmax_coh = None | |
117 | zmin_phase = None |
|
118 | zmin_phase = None | |
@@ -150,31 +151,32 class CrossSpectraPlot(Plot): | |||||
150 | noise = self.data['noise'][n][-1] |
|
151 | noise = self.data['noise'][n][-1] | |
151 | pair = self.data.pairs[n] |
|
152 | pair = self.data.pairs[n] | |
152 | ax = self.axes[4 * n] |
|
153 | ax = self.axes[4 * n] | |
153 | ax3 = self.axes[4 * n + 3] |
|
154 | spc0 = 10.*numpy.log10(spc[pair[0]]/self.data.factor) | |
154 | if ax.firsttime: |
|
155 | if ax.firsttime: | |
155 | self.xmax = self.xmax if self.xmax else numpy.nanmax(x) |
|
156 | self.xmax = self.xmax if self.xmax else numpy.nanmax(x) | |
156 | self.xmin = self.xmin if self.xmin else -self.xmax |
|
157 | self.xmin = self.xmin if self.xmin else -self.xmax | |
157 | self.zmin = self.zmin if self.zmin else numpy.nanmin(spc) |
|
158 | self.zmin = self.zmin if self.zmin else numpy.nanmin(spc) | |
158 | self.zmax = self.zmax if self.zmax else numpy.nanmax(spc) |
|
159 | self.zmax = self.zmax if self.zmax else numpy.nanmax(spc) | |
159 |
ax.plt = ax.pcolormesh(x, y, spc |
|
160 | ax.plt = ax.pcolormesh(x , y , spc0.T, | |
160 | vmin=self.zmin, |
|
161 | vmin=self.zmin, | |
161 | vmax=self.zmax, |
|
162 | vmax=self.zmax, | |
162 | cmap=plt.get_cmap(self.colormap) |
|
163 | cmap=plt.get_cmap(self.colormap) | |
163 | ) |
|
164 | ) | |
164 | else: |
|
165 | else: | |
165 |
ax.plt.set_array(spc |
|
166 | ax.plt.set_array(spc0.T.ravel()) | |
166 |
self.titles.append('CH {}: {:3.2f}dB'.format( |
|
167 | self.titles.append('CH {}: {:3.2f}dB'.format(pair[0], noise)) | |
167 |
|
168 | |||
168 | ax = self.axes[4 * n + 1] |
|
169 | ax = self.axes[4 * n + 1] | |
|
170 | spc1 = 10.*numpy.log10(spc[pair[1]]/self.data.factor) | |||
169 | if ax.firsttime: |
|
171 | if ax.firsttime: | |
170 |
ax.plt = ax.pcolormesh(x, y, spc |
|
172 | ax.plt = ax.pcolormesh(x , y, spc1.T, | |
171 | vmin=self.zmin, |
|
173 | vmin=self.zmin, | |
172 | vmax=self.zmax, |
|
174 | vmax=self.zmax, | |
173 | cmap=plt.get_cmap(self.colormap) |
|
175 | cmap=plt.get_cmap(self.colormap) | |
174 | ) |
|
176 | ) | |
175 | else: |
|
177 | else: | |
176 |
ax.plt.set_array(spc |
|
178 | ax.plt.set_array(spc1.T.ravel()) | |
177 |
self.titles.append('CH {}: {:3.2f}dB'.format( |
|
179 | self.titles.append('CH {}: {:3.2f}dB'.format(pair[1], noise)) | |
178 |
|
180 | |||
179 | out = cspc[n] / numpy.sqrt(spc[pair[0]] * spc[pair[1]]) |
|
181 | out = cspc[n] / numpy.sqrt(spc[pair[0]] * spc[pair[1]]) | |
180 | coh = numpy.abs(out) |
|
182 | coh = numpy.abs(out) | |
@@ -611,3 +613,4 class PolarMapPlot(Plot): | |||||
611 | self.save_labels = ['{}-{}'.format(lbl, label) for lbl in self.labels] |
|
613 | self.save_labels = ['{}-{}'.format(lbl, label) for lbl in self.labels] | |
612 | self.titles = ['{} {}'.format( |
|
614 | self.titles = ['{} {}'.format( | |
613 | self.data.parameters[x], title) for x in self.channels] |
|
615 | self.data.parameters[x], title) for x in self.channels] | |
|
616 | No newline at end of file |
@@ -190,8 +190,7 def MPDecorator(BaseClass): | |||||
190 | self.sender = None |
|
190 | self.sender = None | |
191 | self.receiver = None |
|
191 | self.receiver = None | |
192 | self.name = BaseClass.__name__ |
|
192 | self.name = BaseClass.__name__ | |
193 | if 'plot' in self.name.lower(): |
|
193 | if 'plot' in self.name.lower() and not self.name.endswith('_'): | |
194 | if not self.name.endswith('_'): |
|
|||
195 |
|
|
194 | self.name = '{}{}'.format(self.CODE.upper(), 'Plot') | |
196 | self.start_time = time.time() |
|
195 | self.start_time = time.time() | |
197 |
|
196 | |||
@@ -294,7 +293,7 def MPDecorator(BaseClass): | |||||
294 | op(**kwargs) |
|
293 | op(**kwargs) | |
295 | elif optype == 'other' and not self.dataOut.flagNoData: |
|
294 | elif optype == 'other' and not self.dataOut.flagNoData: | |
296 | self.dataOut = op.run(self.dataOut, **kwargs) |
|
295 | self.dataOut = op.run(self.dataOut, **kwargs) | |
297 | elif optype == 'external': |
|
296 | elif optype == 'external' and not self.dataOut.flagNoData: | |
298 | if not self.dataOut.flagNoData or self.dataOut.error: |
|
297 | if not self.dataOut.flagNoData or self.dataOut.error: | |
299 | self.publish(self.dataOut, opId) |
|
298 | self.publish(self.dataOut, opId) | |
300 |
|
299 |
General Comments 0
You need to be logged in to leave comments.
Login now