@@ -421,6 +421,8 class Spectra(JROData): | |||
|
421 | 421 | |
|
422 | 422 | self.flagShiftFFT = False |
|
423 | 423 | |
|
424 | self.ippFactor = 1 | |
|
425 | ||
|
424 | 426 | def getNoisebyHildebrand(self): |
|
425 | 427 | """ |
|
426 | 428 | Determino el nivel de ruido usando el metodo Hildebrand-Sekhon |
@@ -464,19 +466,19 class Spectra(JROData): | |||
|
464 | 466 | return self.noise |
|
465 | 467 | |
|
466 | 468 | def getNoise(self, type = 1): |
|
467 | ||
|
469 | if self.noise == None: | |
|
468 | 470 | self.noise = numpy.zeros(self.nChannels) |
|
469 | 471 | |
|
470 | 472 | if type == 1: |
|
471 | noise = self.getNoisebyHildebrand() | |
|
473 | self.noise = self.getNoisebyHildebrand() | |
|
472 | 474 | |
|
473 | 475 | if type == 2: |
|
474 | noise = self.getNoisebySort() | |
|
476 | self.noise = self.getNoisebySort() | |
|
475 | 477 | |
|
476 | 478 | if type == 3: |
|
477 | noise = self.getNoisebyWindow() | |
|
479 | self.noise = self.getNoisebyWindow() | |
|
478 | 480 | |
|
479 | return noise | |
|
481 | return self.noise | |
|
480 | 482 | |
|
481 | 483 | |
|
482 | 484 | def getFreqRange(self, extrapoints=0): |
@@ -102,13 +102,13 class CrossSpectraPlot(Figure): | |||
|
102 | 102 | |
|
103 | 103 | if len(pairsIndexList) > 4: |
|
104 | 104 | pairsIndexList = pairsIndexList[0:4] |
|
105 | factor = dataOut.normFactor | |
|
105 | #factor = dataOut.normFactor | |
|
106 | 106 | x = dataOut.getVelRange(1) |
|
107 | 107 | y = dataOut.getHeiRange() |
|
108 | z = dataOut.data_spc[:,:,:]/factor | |
|
108 | z = dataOut.data_spc[:,:,:]#/factor | |
|
109 | 109 | # z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
110 | 110 | avg = numpy.abs(numpy.average(z, axis=1)) |
|
111 | noise = dataOut.getNoise()/factor | |
|
111 | noise = dataOut.getNoise()#/factor | |
|
112 | 112 | |
|
113 | 113 | zdB = 10*numpy.log10(z) |
|
114 | 114 | avgdB = 10*numpy.log10(avg) |
@@ -151,7 +151,7 class CrossSpectraPlot(Figure): | |||
|
151 | 151 | pair = dataOut.pairsList[pairsIndexList[i]] |
|
152 | 152 | str_datetime = '%s %s'%(thisDatetime.strftime("%Y/%m/%d"),thisDatetime.strftime("%H:%M:%S")) |
|
153 | 153 | title = "Ch%d: %4.2fdB: %s" %(pair[0], noisedB[pair[0]], str_datetime) |
|
154 |
zdB = 10.*numpy.log10(dataOut.data_spc[pair[0],:,:] |
|
|
154 | zdB = 10.*numpy.log10(dataOut.data_spc[pair[0],:,:]) | |
|
155 | 155 | axes0 = self.axesList[i*self.__nsubplots] |
|
156 | 156 | axes0.pcolor(x, y, zdB, |
|
157 | 157 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
@@ -159,7 +159,7 class CrossSpectraPlot(Figure): | |||
|
159 | 159 | ticksize=9, colormap=power_cmap, cblabel='') |
|
160 | 160 | |
|
161 | 161 | title = "Ch%d: %4.2fdB: %s" %(pair[1], noisedB[pair[1]], str_datetime) |
|
162 |
zdB = 10.*numpy.log10(dataOut.data_spc[pair[1],:,:] |
|
|
162 | zdB = 10.*numpy.log10(dataOut.data_spc[pair[1],:,:]) | |
|
163 | 163 | axes0 = self.axesList[i*self.__nsubplots+1] |
|
164 | 164 | axes0.pcolor(x, y, zdB, |
|
165 | 165 | xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, zmin=zmin, zmax=zmax, |
@@ -318,11 +318,11 class RTIPlot(Figure): | |||
|
318 | 318 | |
|
319 | 319 | tmin = None |
|
320 | 320 | tmax = None |
|
321 | factor = dataOut.normFactor | |
|
321 | #factor = dataOut.normFactor | |
|
322 | 322 | x = dataOut.getTimeRange() |
|
323 | 323 | y = dataOut.getHeiRange() |
|
324 | 324 | |
|
325 | z = dataOut.data_spc[channelIndexList,:,:]/factor | |
|
325 | z = dataOut.data_spc[channelIndexList,:,:]#/factor | |
|
326 | 326 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
327 | 327 | avg = numpy.average(z, axis=1) |
|
328 | 328 | |
@@ -506,14 +506,14 class SpectraPlot(Figure): | |||
|
506 | 506 | if channel not in dataOut.channelList: |
|
507 | 507 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
508 | 508 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
509 | factor = dataOut.normFactor | |
|
509 | #factor = dataOut.normFactor | |
|
510 | 510 | x = dataOut.getVelRange(1) |
|
511 | 511 | y = dataOut.getHeiRange() |
|
512 | 512 | |
|
513 | z = dataOut.data_spc[channelIndexList,:,:]/factor | |
|
513 | z = dataOut.data_spc[channelIndexList,:,:]#/factor | |
|
514 | 514 | z = numpy.where(numpy.isfinite(z), z, numpy.NAN) |
|
515 | 515 | avg = numpy.average(z, axis=1) |
|
516 | noise = dataOut.getNoise()/factor | |
|
516 | noise = dataOut.getNoise()#/factor | |
|
517 | 517 | |
|
518 | 518 | zdB = 10*numpy.log10(z) |
|
519 | 519 | avgdB = 10*numpy.log10(avg) |
@@ -765,9 +765,9 class PowerProfilePlot(Figure): | |||
|
765 | 765 | raise ValueError, "Channel %d is not in dataOut.channelList" |
|
766 | 766 | channelIndexList.append(dataOut.channelList.index(channel)) |
|
767 | 767 | |
|
768 | factor = dataOut.normFactor | |
|
768 | #factor = dataOut.normFactor | |
|
769 | 769 | y = dataOut.getHeiRange() |
|
770 | x = dataOut.data_spc[channelIndexList,:,:]/factor | |
|
770 | x = dataOut.data_spc[channelIndexList,:,:]#/factor | |
|
771 | 771 | x = numpy.where(numpy.isfinite(x), x, numpy.NAN) |
|
772 | 772 | avg = numpy.average(x, axis=1) |
|
773 | 773 | |
@@ -1107,8 +1107,8 class Noise(Figure): | |||
|
1107 | 1107 | tmax = None |
|
1108 | 1108 | x = dataOut.getTimeRange() |
|
1109 | 1109 | y = dataOut.getHeiRange() |
|
1110 | factor = dataOut.normFactor | |
|
1111 | noise = dataOut.getNoise()/factor | |
|
1110 | #factor = dataOut.normFactor | |
|
1111 | noise = dataOut.getNoise()#/factor | |
|
1112 | 1112 | noisedB = 10*numpy.log10(noise) |
|
1113 | 1113 | |
|
1114 | 1114 | #thisDatetime = dataOut.datatime |
@@ -1433,8 +1433,8 class RTIfromSpectraHeis(Figure): | |||
|
1433 | 1433 | x = dataOut.getTimeRange() |
|
1434 | 1434 | y = dataOut.getHeiRange() |
|
1435 | 1435 | |
|
1436 | factor = 1 | |
|
1437 | data = dataOut.data_spc/factor | |
|
1436 | #factor = 1 | |
|
1437 | data = dataOut.data_spc#/factor | |
|
1438 | 1438 | data = numpy.average(data,axis=1) |
|
1439 | 1439 | datadB = 10*numpy.log10(data) |
|
1440 | 1440 |
@@ -1195,6 +1195,49 class SpectraProc(ProcessingUnit): | |||
|
1195 | 1195 | |
|
1196 | 1196 | return 1 |
|
1197 | 1197 | |
|
1198 | def getNoise(self, minHei, maxHei): | |
|
1199 | ||
|
1200 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): | |
|
1201 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) | |
|
1202 | ||
|
1203 | if (maxHei > self.dataOut.heightList[-1]): | |
|
1204 | maxHei = self.dataOut.heightList[-1] | |
|
1205 | ||
|
1206 | minIndex = 0 | |
|
1207 | maxIndex = 0 | |
|
1208 | heights = self.dataOut.heightList | |
|
1209 | ||
|
1210 | inda = numpy.where(heights >= minHei) | |
|
1211 | indb = numpy.where(heights <= maxHei) | |
|
1212 | ||
|
1213 | try: | |
|
1214 | minIndex = inda[0][0] | |
|
1215 | except: | |
|
1216 | minIndex = 0 | |
|
1217 | ||
|
1218 | try: | |
|
1219 | maxIndex = indb[0][-1] | |
|
1220 | except: | |
|
1221 | maxIndex = len(heights) | |
|
1222 | ||
|
1223 | if (minIndex < 0) or (minIndex > maxIndex): | |
|
1224 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
|
1225 | ||
|
1226 | if (maxIndex >= self.dataOut.nHeights): | |
|
1227 | maxIndex = self.dataOut.nHeights-1 | |
|
1228 | ||
|
1229 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] | |
|
1230 | ||
|
1231 | noise = numpy.zeros(self.dataOut.nChannels) | |
|
1232 | ||
|
1233 | for channel in range(self.dataOut.nChannels): | |
|
1234 | daux = data_spc[channel,:,:] | |
|
1235 | noise[channel] = hildebrand_sekhon(daux, self.dataOut.nIncohInt) | |
|
1236 | ||
|
1237 | self.dataOut.noise = noise.copy() | |
|
1238 | ||
|
1239 | return 1 | |
|
1240 | ||
|
1198 | 1241 | |
|
1199 | 1242 | class IncohInt(Operation): |
|
1200 | 1243 |
General Comments 0
You need to be logged in to leave comments.
Login now