diff --git a/schainpy/model/data/jrodata.py b/schainpy/model/data/jrodata.py index 96ad913..a811d99 100644 --- a/schainpy/model/data/jrodata.py +++ b/schainpy/model/data/jrodata.py @@ -605,8 +605,11 @@ class Spectra(JROData): noise = numpy.zeros(self.nChannels) for channel in range(self.nChannels): + #print "confuse",self.data_spc.dtype daux = self.data_spc[channel, xmin_index:xmax_index, ymin_index:ymax_index] + + #print "HI3.0",(daux.dtype),daux.shape noise[channel] = hildebrand_sekhon(daux, self.nIncohInt) return noise diff --git a/schainpy/model/graphics/jroplot_spectra.py b/schainpy/model/graphics/jroplot_spectra.py index eafac9f..9d35d54 100644 --- a/schainpy/model/graphics/jroplot_spectra.py +++ b/schainpy/model/graphics/jroplot_spectra.py @@ -142,9 +142,10 @@ class SpectraPlot(Figure): z = numpy.where(numpy.isfinite(z), z, numpy.NAN) zdB = 10*numpy.log10(z) + #print "a000",dataOut.data_spc.dtype avg = numpy.average(z, axis=1) avgdB = 10*numpy.log10(avg) - + #print "before plot" noise = dataOut.getNoise()/factor noisedB = 10*numpy.log10(noise) @@ -315,7 +316,7 @@ class CrossSpectraPlot(Figure): if len(pairsIndexList) > 4: pairsIndexList = pairsIndexList[0:4] - + if normFactor is None: factor = dataOut.normFactor else: @@ -544,7 +545,7 @@ class RTIPlot(Figure): #colormap = kwargs.get('colormap', 'jet') if HEIGHT is not None: self.HEIGHT = HEIGHT - + if not isTimeInHourRange(dataOut.datatime, xmin, xmax): return diff --git a/schainpy/model/proc/jroproc_spectra.py b/schainpy/model/proc/jroproc_spectra.py index 44d8d98..d8eb4b3 100644 --- a/schainpy/model/proc/jroproc_spectra.py +++ b/schainpy/model/proc/jroproc_spectra.py @@ -85,8 +85,10 @@ class SpectraProc(ProcessingUnit): # calculo de self-spectra fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,)) + #print "spec dtype 0",fft_volt.dtype spc = fft_volt * numpy.conjugate(fft_volt) spc = spc.real + #print "spec dtype 1",spc.dtype blocksize = 0 blocksize += dc.size diff --git a/schainpy/model/proc/jroproc_spectra_acf.py b/schainpy/model/proc/jroproc_spectra_acf.py index 4d316d2..ff6924f 100644 --- a/schainpy/model/proc/jroproc_spectra_acf.py +++ b/schainpy/model/proc/jroproc_spectra_acf.py @@ -102,10 +102,13 @@ class SpectraAFCProc(ProcessingUnit): # fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,)) spc = fft_volt * numpy.conjugate(fft_volt) + data = numpy.fft.ifft(spc, axis=1) data = numpy.fft.fftshift(data, axes=(1,)) - spc = data + spc = data.real + + blocksize = 0 blocksize += dc.size @@ -140,6 +143,24 @@ class SpectraAFCProc(ProcessingUnit): self.dataOut.flagNoData = True + if self.dataIn.type == "Spectra": + self.dataOut.copy(self.dataIn) + spc= self.dataOut.data_spc + data = numpy.fft.ifft(spc, axis=1) + data = numpy.fft.fftshift(data, axes=(1,)) + spc = data.real + spc = spc[0,:,0] / numpy.max(numpy.abs(spc[0,:,0])) + print spc + import matplotlib.pyplot as plt + #plt.plot(spc[10:]) + plt.show() + + + self.dataOut.data_spc = spc + + return True + + if code is not None: self.code = numpy.array(code).reshape(nCode,nBaud) else: diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index df3505d..affda80 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -1209,7 +1209,7 @@ class SSheightProfiles(Operation): self.__nProfiles = dataOut.nProfiles self.__nHeis = dataOut.nHeights shape = dataOut.data.shape #nchannels, nprofiles, nsamples - + print "shape",shape #last test residue = (shape[1] - self.nsamples) % self.step if residue != 0: @@ -1219,7 +1219,7 @@ 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"%(numberProfile,numberSamples,deltaHeight*self.step) + print "New number of profile: %d, number of height: %d, Resolution %d Km"%(numberProfile,numberSamples,deltaHeight*self.step) self.bufferShape = shape[0], numberSamples, numberProfile # nchannels, nsamples , nprofiles self.profileShape = shape[0], numberProfile, numberSamples # nchannels, nprofiles, nsamples