From f1a6137b399921d49bf115178054c49c1bdc4626 2019-10-15 14:52:38 From: avaldez Date: 2019-10-15 14:52:38 Subject: [PATCH] update y fix --- diff --git a/schainpy/model/graphics/jroplot_spectra.py b/schainpy/model/graphics/jroplot_spectra.py index 648ccd6..aeb3868 100644 --- a/schainpy/model/graphics/jroplot_spectra.py +++ b/schainpy/model/graphics/jroplot_spectra.py @@ -318,6 +318,7 @@ class ACFPlot(Figure): #z = numpy.where(numpy.isfinite(z), z, numpy.NAN) shape = dataOut.data_acf.shape + print "shape_plot",shape hei_index = numpy.arange(shape[2]) hei_plot = numpy.arange(nSamples)*resFactor @@ -330,7 +331,7 @@ class ACFPlot(Figure): hei_plot = numpy.array(nSampleList)*resFactor if hei_plot[-1] >= hei_index[-1]: - print ("La cantidad de puntos en altura es %d y la resolucion es %d Km"%(hei_plot.shape[0],deltaHeight*resFactor )) + print ("La cantidad de puntos en altura es %d y la resolucion es %f Km"%(hei_plot.shape[0],deltaHeight*resFactor )) raise ValueError, "resFactor %d multiplicado por el valor de %d nSamples es mayor a %d cantidad total de puntos"%(resFactor,nSamples,hei_index[-1]) #escalamiento -1 a 1 a resolucion (factor de resolucion en altura)* deltaHeight @@ -376,8 +377,8 @@ class ACFPlot(Figure): if ymin == None: ymin = numpy.nanmin(zdB) if ymax == None: ymax = numpy.nanmax(zdB) - print ("El parametro resFactor es %d y la resolucion en altura es %d"%(resFactor,deltaHeight )) - print ("La cantidad de puntos en altura es %d y la nueva resolucion es %d Km"%(hei_plot.shape[0],deltaHeight*resFactor )) + print ("El parametro resFactor es %d y la resolucion en altura es %f"%(resFactor,deltaHeight )) + print ("La cantidad de puntos en altura es %d y la nueva resolucion es %f Km"%(hei_plot.shape[0],deltaHeight*resFactor )) print ("La altura maxima es %d Km"%(hei_plot[-1]*deltaHeight )) self.isConfig = True diff --git a/schainpy/model/proc/jroproc_spectra_acf.py b/schainpy/model/proc/jroproc_spectra_acf.py index 355c4f3..41d39db 100644 --- a/schainpy/model/proc/jroproc_spectra_acf.py +++ b/schainpy/model/proc/jroproc_spectra_acf.py @@ -151,24 +151,28 @@ class SpectraAFCProc(ProcessingUnit): shape = acf.shape # nchannels, nprofiles, nsamples #import matplotlib.pyplot as plt - #acf_tmp=acf[0,:,85] + #print "test",acf.shape + #acf_tmp=acf[0,:,] #plt.plot(acf_tmp) #plt.show() - - for i in range(shape[1]): - tmp = numpy.argmax(acf[0,:,i]) - if i>30: - value = (acf[0,:,i][tmp+3]+acf[0,:,i][tmp+4])/2.0 - acf[0,:,i][tmp] = value - acf[0,:,i][tmp-1] = value - acf[0,:,i][tmp+1] = value - acf[0,:,i][tmp-2] = value - acf[0,:,i][tmp+2] = value - - import scipy as sp - from scipy import signal - acf[0,:,i] = sp.signal.medfilt(acf[0,:,i],21) - + #import time + #time.sleep(10) + + for j in range(shape[0]): + for i in range(shape[1]): + tmp = numpy.argmax(acf[j,:,i]) + if i>30: + value = (acf[j,:,i][tmp+3]+acf[j,:,i][tmp+4])/2.0 + acf[j,:,i][tmp] = value + acf[j,:,i][tmp-1] = value + acf[j,:,i][tmp+1] = value + acf[j,:,i][tmp-2] = value + acf[j,:,i][tmp+2] = value + + import scipy as sp + from scipy import signal + #acf[3,:,i] = sp.signal.medfilt(acf[3,:,i],21) + #print numpy.argmax(acf[0,:,85]) diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index a4c63f7..4f74164 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -1276,6 +1276,11 @@ class SSheightProfiles(Operation): self.__nProfiles = dataOut.nProfiles self.__nHeis = dataOut.nHeights shape = dataOut.data.shape #nchannels, nprofiles, nsamples + print "input nChannels",self.__nChannels + print "input nProfiles",self.__nProfiles + print "input nHeis",self.__nHeis + print "input Shape",shape + residue = (shape[1] - self.nsamples) % self.step @@ -1286,7 +1291,10 @@ class SSheightProfiles(Operation): numberProfile = self.nsamples numberSamples = (shape[1] - self.nsamples)/self.step - print "New number of profile: %d, number of height: %d, Resolution %d Km"%(numberProfile,numberSamples,deltaHeight*self.step) + print "new numberProfile",numberProfile + print "new numberSamples",numberSamples + + print "New number of profile: %d, number of height: %d, Resolution %f Km"%(numberProfile,numberSamples,deltaHeight*self.step) self.bufferShape = shape[0], numberSamples, numberProfile # nchannels, nsamples , nprofiles self.profileShape = shape[0], numberProfile, numberSamples # nchannels, nprofiles, nsamples @@ -1306,7 +1314,9 @@ class SSheightProfiles(Operation): self.isConfig = True for i in range(self.buffer.shape[1]): - self.buffer[:,i] = numpy.flip(dataOut.data[:,i*self.step:i*self.step + self.nsamples]) + #self.buffer[:,i] = numpy.flip(dataOut.data[:,i*self.step:i*self.step + self.nsamples]) + self.buffer[:,i] = dataOut.data[:,i*self.step:i*self.step + self.nsamples] + #self.buffer[:,j,self.__nHeis-j*self.step - self.nheights:self.__nHeis-j*self.step] = numpy.flip(dataOut.data[:,j*self.step:j*self.step + self.nheights]) for j in range(self.buffer.shape[0]):