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