##// END OF EJS Templates
Update ACF first step
avaldez -
r1240:ce4b76019d00
parent child
Show More
@@ -605,8 +605,11 class Spectra(JROData):
605 noise = numpy.zeros(self.nChannels)
605 noise = numpy.zeros(self.nChannels)
606
606
607 for channel in range(self.nChannels):
607 for channel in range(self.nChannels):
608 #print "confuse",self.data_spc.dtype
608 daux = self.data_spc[channel,
609 daux = self.data_spc[channel,
609 xmin_index:xmax_index, ymin_index:ymax_index]
610 xmin_index:xmax_index, ymin_index:ymax_index]
611
612 #print "HI3.0",(daux.dtype),daux.shape
610 noise[channel] = hildebrand_sekhon(daux, self.nIncohInt)
613 noise[channel] = hildebrand_sekhon(daux, self.nIncohInt)
611
614
612 return noise
615 return noise
@@ -142,9 +142,10 class SpectraPlot(Figure):
142 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
142 z = numpy.where(numpy.isfinite(z), z, numpy.NAN)
143 zdB = 10*numpy.log10(z)
143 zdB = 10*numpy.log10(z)
144
144
145 #print "a000",dataOut.data_spc.dtype
145 avg = numpy.average(z, axis=1)
146 avg = numpy.average(z, axis=1)
146 avgdB = 10*numpy.log10(avg)
147 avgdB = 10*numpy.log10(avg)
147
148 #print "before plot"
148 noise = dataOut.getNoise()/factor
149 noise = dataOut.getNoise()/factor
149 noisedB = 10*numpy.log10(noise)
150 noisedB = 10*numpy.log10(noise)
150
151
@@ -315,7 +316,7 class CrossSpectraPlot(Figure):
315
316
316 if len(pairsIndexList) > 4:
317 if len(pairsIndexList) > 4:
317 pairsIndexList = pairsIndexList[0:4]
318 pairsIndexList = pairsIndexList[0:4]
318
319
319 if normFactor is None:
320 if normFactor is None:
320 factor = dataOut.normFactor
321 factor = dataOut.normFactor
321 else:
322 else:
@@ -544,7 +545,7 class RTIPlot(Figure):
544 #colormap = kwargs.get('colormap', 'jet')
545 #colormap = kwargs.get('colormap', 'jet')
545 if HEIGHT is not None:
546 if HEIGHT is not None:
546 self.HEIGHT = HEIGHT
547 self.HEIGHT = HEIGHT
547
548
548 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
549 if not isTimeInHourRange(dataOut.datatime, xmin, xmax):
549 return
550 return
550
551
@@ -85,8 +85,10 class SpectraProc(ProcessingUnit):
85
85
86 # calculo de self-spectra
86 # calculo de self-spectra
87 fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
87 fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
88 #print "spec dtype 0",fft_volt.dtype
88 spc = fft_volt * numpy.conjugate(fft_volt)
89 spc = fft_volt * numpy.conjugate(fft_volt)
89 spc = spc.real
90 spc = spc.real
91 #print "spec dtype 1",spc.dtype
90
92
91 blocksize = 0
93 blocksize = 0
92 blocksize += dc.size
94 blocksize += dc.size
@@ -102,10 +102,13 class SpectraAFCProc(ProcessingUnit):
102 # fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
102 # fft_volt = numpy.fft.fftshift(fft_volt, axes=(1,))
103 spc = fft_volt * numpy.conjugate(fft_volt)
103 spc = fft_volt * numpy.conjugate(fft_volt)
104
104
105
105 data = numpy.fft.ifft(spc, axis=1)
106 data = numpy.fft.ifft(spc, axis=1)
106 data = numpy.fft.fftshift(data, axes=(1,))
107 data = numpy.fft.fftshift(data, axes=(1,))
107
108
108 spc = data
109 spc = data.real
110
111
109
112
110 blocksize = 0
113 blocksize = 0
111 blocksize += dc.size
114 blocksize += dc.size
@@ -140,6 +143,24 class SpectraAFCProc(ProcessingUnit):
140
143
141 self.dataOut.flagNoData = True
144 self.dataOut.flagNoData = True
142
145
146 if self.dataIn.type == "Spectra":
147 self.dataOut.copy(self.dataIn)
148 spc= self.dataOut.data_spc
149 data = numpy.fft.ifft(spc, axis=1)
150 data = numpy.fft.fftshift(data, axes=(1,))
151 spc = data.real
152 spc = spc[0,:,0] / numpy.max(numpy.abs(spc[0,:,0]))
153 print spc
154 import matplotlib.pyplot as plt
155 #plt.plot(spc[10:])
156 plt.show()
157
158
159 self.dataOut.data_spc = spc
160
161 return True
162
163
143 if code is not None:
164 if code is not None:
144 self.code = numpy.array(code).reshape(nCode,nBaud)
165 self.code = numpy.array(code).reshape(nCode,nBaud)
145 else:
166 else:
@@ -1209,7 +1209,7 class SSheightProfiles(Operation):
1209 self.__nProfiles = dataOut.nProfiles
1209 self.__nProfiles = dataOut.nProfiles
1210 self.__nHeis = dataOut.nHeights
1210 self.__nHeis = dataOut.nHeights
1211 shape = dataOut.data.shape #nchannels, nprofiles, nsamples
1211 shape = dataOut.data.shape #nchannels, nprofiles, nsamples
1212
1212 print "shape",shape
1213 #last test
1213 #last test
1214 residue = (shape[1] - self.nsamples) % self.step
1214 residue = (shape[1] - self.nsamples) % self.step
1215 if residue != 0:
1215 if residue != 0:
@@ -1219,7 +1219,7 class SSheightProfiles(Operation):
1219 numberProfile = self.nsamples
1219 numberProfile = self.nsamples
1220 numberSamples = (shape[1] - self.nsamples)/self.step
1220 numberSamples = (shape[1] - self.nsamples)/self.step
1221
1221
1222 print "New number of profile: %d, number of height: %d, Resolution %d"%(numberProfile,numberSamples,deltaHeight*self.step)
1222 print "New number of profile: %d, number of height: %d, Resolution %d Km"%(numberProfile,numberSamples,deltaHeight*self.step)
1223
1223
1224 self.bufferShape = shape[0], numberSamples, numberProfile # nchannels, nsamples , nprofiles
1224 self.bufferShape = shape[0], numberSamples, numberProfile # nchannels, nsamples , nprofiles
1225 self.profileShape = shape[0], numberProfile, numberSamples # nchannels, nprofiles, nsamples
1225 self.profileShape = shape[0], numberProfile, numberSamples # nchannels, nprofiles, nsamples
General Comments 0
You need to be logged in to leave comments. Login now