diff --git a/schainpy/model/graphics/jroplot_parameters.py b/schainpy/model/graphics/jroplot_parameters.py index 3f563a1..ea2c5b9 100644 --- a/schainpy/model/graphics/jroplot_parameters.py +++ b/schainpy/model/graphics/jroplot_parameters.py @@ -395,7 +395,15 @@ class WeatherPlot(Plot): data = {} meta = {} - data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(250.0)) + if hasattr(dataOut, 'dataPP_POWER'): + factor = 1 + + if hasattr(dataOut, 'nFFTPoints'): + factor = dataOut.normFactor + + print("factor",factor) + data['weather'] = 10*numpy.log10(dataOut.data_360[0]/(factor)) + print("weather",data['weather']) data['azi'] = dataOut.data_azi return data, meta @@ -498,7 +506,7 @@ class WeatherPlot(Plot): cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=1, vmax=60) else: plt.clf() - cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=0, vmax=60) + cgax, pm = wrl.vis.plot_ppi(self.res_weather,r=r,az=self.res_azi,fig=self.figures[0], proj='cg', vmin=1, vmax=60) caax = cgax.parasites[0] paax = cgax.parasites[1] cbar = plt.gcf().colorbar(pm, pad=0.075) diff --git a/schainpy/model/proc/jroproc_parameters.py b/schainpy/model/proc/jroproc_parameters.py index e6aaa10..bc1c69e 100755 --- a/schainpy/model/proc/jroproc_parameters.py +++ b/schainpy/model/proc/jroproc_parameters.py @@ -1286,7 +1286,6 @@ class SpectralMoments(Operation): vec_snr = numpy.zeros(oldspec.shape[1]) # oldspec = numpy.ma.masked_invalid(oldspec) - for ind in range(oldspec.shape[1]): spec = oldspec[:,ind] @@ -1325,7 +1324,7 @@ class SpectralMoments(Operation): ss1 = m valid = numpy.arange(int(m + bb0 - ss1 + 1)) + ss1 - + #valid = numpy.arange(1,oldspec.shape[0])# valid perfil completo igual pulsepair signal_power = ((spec2[valid] - n0) * fwindow[valid]).mean() # D. Scipión added with correct definition total_power = (spec2[valid] * fwindow[valid]).mean() # D. Scipión added with correct definition power = ((spec2[valid] - n0) * fwindow[valid]).sum() @@ -4099,7 +4098,7 @@ class PedestalInformation(Operation): #print(len(self.list_adq)) utc_ped_list=[] for i in range(len(self.list_pedestal)): - print(i) + #print(i)# OJO IDENTIFICADOR DE SINCRONISMO utc_ped_list.append(self.gettimeutcfromDirFilename(path=self.path_ped,file=self.list_pedestal[i])) #utc_ped_list= utc_ped_list @@ -4384,7 +4383,7 @@ class Block360(Operation): #print("line 4049",data.dataPP_POW.shape,data.dataPP_POW[:10]) #print("line 4049",data.azimuth.shape,data.azimuth) if self.mode==0: - self.__buffer[:,self.__profIndex,:]= data.dataPP_POW + self.__buffer[:,self.__profIndex,:]= data.dataPP_POWER# PRIMER MOMENTO if self.mode==1: self.__buffer[:,self.__profIndex,:]= data.data_pow #print("me casi",self.index,data.azimuth[self.index]) diff --git a/schainpy/model/proc/jroproc_spectra.py b/schainpy/model/proc/jroproc_spectra.py index fde1262..192cafa 100644 --- a/schainpy/model/proc/jroproc_spectra.py +++ b/schainpy/model/proc/jroproc_spectra.py @@ -118,7 +118,7 @@ class SpectraProc(ProcessingUnit): self.dataOut.flagShiftFFT = False def run(self, nProfiles=None, nFFTPoints=None, pairsList=None, ippFactor=None, shift_fft=False): - + if self.dataIn.type == "Spectra": self.dataOut.copy(self.dataIn) if shift_fft: @@ -144,7 +144,7 @@ class SpectraProc(ProcessingUnit): if ippFactor == None: self.dataOut.ippFactor = 1 - + self.dataOut.nFFTPoints = nFFTPoints if self.buffer is None: @@ -214,13 +214,13 @@ class SpectraProc(ProcessingUnit): self.dataOut.pairsList = pairs return - + def selectFFTs(self, minFFT, maxFFT ): """ - Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango + Selecciona un bloque de datos en base a un grupo de valores de puntos FFTs segun el rango minFFT<= FFT <= maxFFT """ - + if (minFFT > maxFFT): raise ValueError("Error selecting heights: Height range (%d,%d) is not valid" % (minFFT, maxFFT)) @@ -250,7 +250,7 @@ class SpectraProc(ProcessingUnit): self.selectFFTsByIndex(minIndex, maxIndex) return 1 - + def getBeaconSignal(self, tauindex=0, channelindex=0, hei_ref=None): newheis = numpy.where( self.dataOut.heightList > self.dataOut.radarControllerHeaderObj.Taus[tauindex]) @@ -295,7 +295,7 @@ class SpectraProc(ProcessingUnit): def selectFFTsByIndex(self, minIndex, maxIndex): """ - + """ if (minIndex < 0) or (minIndex > maxIndex): @@ -318,7 +318,7 @@ class SpectraProc(ProcessingUnit): self.dataOut.data_spc = data_spc self.dataOut.data_cspc = data_cspc self.dataOut.data_dc = data_dc - + self.dataOut.ippSeconds = self.dataOut.ippSeconds*(self.dataOut.nFFTPoints / numpy.shape(data_cspc)[1]) self.dataOut.nFFTPoints = numpy.shape(data_cspc)[1] self.dataOut.profilesPerBlock = numpy.shape(data_cspc)[1] @@ -457,7 +457,7 @@ class removeDC(Operation): xx_inv = numpy.linalg.inv(xx) xx_aux = xx_inv[0, :] - for ich in range(num_chan): + for ich in range(num_chan): yy = jspectra[ich, ind_vel, :] jspectra[ich, freq_dc, :] = numpy.dot(xx_aux, yy) @@ -481,12 +481,12 @@ class removeDC(Operation): class removeInterference(Operation): def removeInterference2(self): - + cspc = self.dataOut.data_cspc spc = self.dataOut.data_spc - Heights = numpy.arange(cspc.shape[2]) + Heights = numpy.arange(cspc.shape[2]) realCspc = numpy.abs(cspc) - + for i in range(cspc.shape[0]): LinePower= numpy.sum(realCspc[i], axis=0) Threshold = numpy.amax(LinePower)-numpy.sort(LinePower)[len(Heights)-int(len(Heights)*0.1)] @@ -494,15 +494,15 @@ class removeInterference(Operation): InterferenceSum = numpy.sum( realCspc[i,:,SelectedHeights], axis=0 ) InterferenceThresholdMin = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.98)] InterferenceThresholdMax = numpy.sort(InterferenceSum)[int(len(InterferenceSum)*0.99)] - - + + InterferenceRange = numpy.where( ([InterferenceSum > InterferenceThresholdMin]))# , InterferenceSum < InterferenceThresholdMax]) ) #InterferenceRange = numpy.where( ([InterferenceRange < InterferenceThresholdMax])) if len(InterferenceRange)