##// END OF EJS Templates
Se cambió los títulos en SpectraPlot y RTIPlot para que muestre los canales reales luego de la operación selectChannels
joabAM -
r1386:029f5a79c540
parent child
Show More
@@ -21,12 +21,14 class SpectraPlot(Plot):
21 colormap = 'jet'
21 colormap = 'jet'
22 plot_type = 'pcolor'
22 plot_type = 'pcolor'
23 buffering = False
23 buffering = False
24 channelList = None
24
25
25 def setup(self):
26 def setup(self):
26 self.nplots = len(self.data.channels)
27 self.nplots = len(self.data.channels)
27 self.ncols = int(numpy.sqrt(self.nplots) + 0.9)
28 self.ncols = int(numpy.sqrt(self.nplots) + 0.9)
28 self.nrows = int((1.0 * self.nplots / self.ncols) + 0.9)
29 self.nrows = int((1.0 * self.nplots / self.ncols) + 0.9)
29 self.height = 2.6 * self.nrows
30 self.height = 2.6 * self.nrows
31
30 self.cb_label = 'dB'
32 self.cb_label = 'dB'
31 if self.showprofile:
33 if self.showprofile:
32 self.width = 4 * self.ncols
34 self.width = 4 * self.ncols
@@ -36,7 +38,8 class SpectraPlot(Plot):
36 self.ylabel = 'Range [km]'
38 self.ylabel = 'Range [km]'
37
39
38 def update(self, dataOut):
40 def update(self, dataOut):
39
41 if self.channelList == None:
42 self.channelList = dataOut.channelList
40 data = {}
43 data = {}
41 meta = {}
44 meta = {}
42 spc = 10*numpy.log10(dataOut.data_spc/dataOut.normFactor)
45 spc = 10*numpy.log10(dataOut.data_spc/dataOut.normFactor)
@@ -101,7 +104,7 class SpectraPlot(Plot):
101 ax.plt_noise.set_data(numpy.repeat(noise, len(y)), y)
104 ax.plt_noise.set_data(numpy.repeat(noise, len(y)), y)
102 if self.CODE == 'spc_moments':
105 if self.CODE == 'spc_moments':
103 ax.plt_mean.set_data(mean, y)
106 ax.plt_mean.set_data(mean, y)
104 self.titles.append('CH {}: {:3.2f}dB'.format(n, noise))
107 self.titles.append('CH {}: {:3.2f}dB'.format(self.channelList[n], noise))
105
108
106
109
107 class CrossSpectraPlot(Plot):
110 class CrossSpectraPlot(Plot):
@@ -204,6 +207,8 class RTIPlot(Plot):
204 CODE = 'rti'
207 CODE = 'rti'
205 colormap = 'jet'
208 colormap = 'jet'
206 plot_type = 'pcolorbuffer'
209 plot_type = 'pcolorbuffer'
210 titles = None
211 channelList = None
207
212
208 def setup(self):
213 def setup(self):
209 self.xaxis = 'time'
214 self.xaxis = 'time'
@@ -215,10 +220,11 class RTIPlot(Plot):
215 self.cb_label = 'dB'
220 self.cb_label = 'dB'
216 self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95})
221 self.plots_adjust.update({'hspace':0.8, 'left': 0.1, 'bottom': 0.08, 'right':0.95})
217 self.titles = ['{} Channel {}'.format(
222 self.titles = ['{} Channel {}'.format(
218 self.CODE.upper(), x) for x in range(self.nrows)]
223 self.CODE.upper(), x) for x in range(self.nplots)]
219
224
220 def update(self, dataOut):
225 def update(self, dataOut):
221
226 if self.channelList == None:
227 self.channelList = dataOut.channelList
222 data = {}
228 data = {}
223 meta = {}
229 meta = {}
224 data['rti'] = dataOut.getPower()
230 data['rti'] = dataOut.getPower()
@@ -231,6 +237,9 class RTIPlot(Plot):
231 self.y = self.data.yrange
237 self.y = self.data.yrange
232 self.z = self.data[self.CODE]
238 self.z = self.data[self.CODE]
233 self.z = numpy.ma.masked_invalid(self.z)
239 self.z = numpy.ma.masked_invalid(self.z)
240 if self.channelList != None:
241 self.titles = ['{} Channel {}'.format(
242 self.CODE.upper(), x) for x in self.channelList]
234
243
235 if self.decimation is None:
244 if self.decimation is None:
236 x, y, z = self.fill_gaps(self.x, self.y, self.z)
245 x, y, z = self.fill_gaps(self.x, self.y, self.z)
@@ -507,8 +507,7 class CleanRayleigh(Operation):
507 self.buffer = 0
507 self.buffer = 0
508 self.buffer2 = 0
508 self.buffer2 = 0
509 self.buffer3 = 0
509 self.buffer3 = 0
510 #self.min_hei = None
510
511 #self.max_hei = None
512
511
513 def setup(self,dataOut,min_hei,max_hei,n, timeInterval,factor_stdv):
512 def setup(self,dataOut,min_hei,max_hei,n, timeInterval,factor_stdv):
514
513
@@ -545,8 +544,7 class CleanRayleigh(Operation):
545 self.currentTime = self.__initime
544 self.currentTime = self.__initime
546 self.pairsArray = numpy.array(dataOut.pairsList)
545 self.pairsArray = numpy.array(dataOut.pairsList)
547 self.factor_stdv = factor_stdv
546 self.factor_stdv = factor_stdv
548
547 print("CHANNELS: ",[x for x in self.channels])
549
550
548
551 if n != None :
549 if n != None :
552 self.byProfiles = True
550 self.byProfiles = True
@@ -678,7 +676,7 class CleanRayleigh(Operation):
678 dataOut.data_dc = self.buffer3
676 dataOut.data_dc = self.buffer3
679 dataOut.nIncohInt *= self.nIntProfiles
677 dataOut.nIncohInt *= self.nIntProfiles
680 dataOut.utctime = self.currentTime #tiempo promediado
678 dataOut.utctime = self.currentTime #tiempo promediado
681 print("Time: ",time.localtime(dataOut.utctime))
679 #print("Time: ",time.localtime(dataOut.utctime))
682 # dataOut.data_spc = sat_spectra
680 # dataOut.data_spc = sat_spectra
683 # dataOut.data_cspc = sat_cspectra
681 # dataOut.data_cspc = sat_cspectra
684 self.buffer = 0
682 self.buffer = 0
@@ -763,26 +761,27 class CleanRayleigh(Operation):
763 if len(noval[0]) > 0: #forma de array (N,) es igual a longitud (N)
761 if len(noval[0]) > 0: #forma de array (N,) es igual a longitud (N)
764 novall = ((func2clean - mode) >= (factor_stdv*stdv)).nonzero()
762 novall = ((func2clean - mode) >= (factor_stdv*stdv)).nonzero()
765 #print(novall)
763 #print(novall)
766 #print(" ")
764 #print(" ",self.pairsArray[ii])
767 cross_pairs = self.pairsArray[ii]
765 cross_pairs = self.pairsArray[ii]
768 #Getting coherent echoes which are removed.
766 #Getting coherent echoes which are removed.
769 if len(novall[0]) > 0:
767 # if len(novall[0]) > 0:
770
768 #
771 val_spc[novall[0],cross_pairs[0],ifreq,ih] = 1
769 # val_spc[novall[0],cross_pairs[0],ifreq,ih] = 1
772 val_spc[novall[0],cross_pairs[1],ifreq,ih] = 1
770 # val_spc[novall[0],cross_pairs[1],ifreq,ih] = 1
773 val_cspc[novall[0],ii,ifreq,ih] = 1
771 # val_cspc[novall[0],ii,ifreq,ih] = 1
774 #print("OUT NOVALL 1")
772 #print("OUT NOVALL 1")
775 #Removing coherent from ISR data
773 #Removing coherent from ISR data
774 chA = self.channels.index(cross_pairs[0])
775 chB = self.channels.index(cross_pairs[1])
776
776
777 #print(spectra[:,ii,ifreq,ih])
778 new_a = numpy.delete(cspectra[:,ii,ifreq,ih], noval[0])
777 new_a = numpy.delete(cspectra[:,ii,ifreq,ih], noval[0])
779 mean_cspc = numpy.mean(new_a)
778 mean_cspc = numpy.mean(new_a)
780 new_b = numpy.delete(spectra[:,cross_pairs[0],ifreq,ih], noval[0])
779 new_b = numpy.delete(spectra[:,chA,ifreq,ih], noval[0])
781 mean_spc0 = numpy.mean(new_b)
780 mean_spc0 = numpy.mean(new_b)
782 new_c = numpy.delete(spectra[:,cross_pairs[1],ifreq,ih], noval[0])
781 new_c = numpy.delete(spectra[:,chB,ifreq,ih], noval[0])
783 mean_spc1 = numpy.mean(new_c)
782 mean_spc1 = numpy.mean(new_c)
784 spectra[noval,cross_pairs[0],ifreq,ih] = mean_spc0
783 spectra[noval,chA,ifreq,ih] = mean_spc0
785 spectra[noval,cross_pairs[1],ifreq,ih] = mean_spc1
784 spectra[noval,chB,ifreq,ih] = mean_spc1
786 cspectra[noval,ii,ifreq,ih] = mean_cspc
785 cspectra[noval,ii,ifreq,ih] = mean_cspc
787
786
788 '''
787 '''
@@ -112,7 +112,7 class selectChannels(Operation):
112 self.dataOut.data_dc = data_dc
112 self.dataOut.data_dc = data_dc
113
113
114 # self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList]
114 # self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList]
115 self.dataOut.channelList = range(len(channelIndexList))
115 self.dataOut.channelList = channelIndexList
116 self.__selectPairsByChannel(channelIndexList)
116 self.__selectPairsByChannel(channelIndexList)
117
117
118 return 1
118 return 1
General Comments 0
You need to be logged in to leave comments. Login now