@@ -1,10 +1,14 | |||
|
1 | 1 | import numpy |
|
2 | 2 | |
|
3 | 3 | from jroproc_base import ProcessingUnit, Operation |
|
4 | from schainpy.model.data.jrodata import Correlation | |
|
4 | from schainpy.model.data.jrodata import Correlation, hildebrand_sekhon | |
|
5 | 5 | |
|
6 | 6 | class CorrelationProc(ProcessingUnit): |
|
7 | 7 | |
|
8 | pairsList = None | |
|
9 | ||
|
10 | data_cf = None | |
|
11 | ||
|
8 | 12 | def __init__(self): |
|
9 | 13 | |
|
10 | 14 | ProcessingUnit.__init__(self) |
@@ -40,6 +44,8 class CorrelationProc(ProcessingUnit): | |||
|
40 | 44 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
41 | 45 | # self.dataOut.nIncohInt = 1 |
|
42 | 46 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
47 | self.dataOut.nProfiles = self.dataIn.nProfiles | |
|
48 | self.dataOut.utctime = self.dataIn.utctime | |
|
43 | 49 | # self.dataOut.windowOfFilter = self.dataIn.windowOfFilter |
|
44 | 50 | |
|
45 | 51 | # self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nPoints |
@@ -80,48 +86,9 class CorrelationProc(ProcessingUnit): | |||
|
80 | 86 | self.dataOut.SNR = (SPot/NPot)[pairsAutoCorr] |
|
81 | 87 | self.dataOut.data_corr[:,:,indR,:] = jspectra |
|
82 | 88 | |
|
83 | return 1 | |
|
84 | ||
|
85 | ||
|
86 | def calculateNormFactor(self): | |
|
87 | ||
|
88 | pairsList = self.dataOut.pairsList | |
|
89 | pairsAutoCorr = self.dataOut.pairsAutoCorr | |
|
90 | nHeights = self.dataOut.nHeights | |
|
91 | nPairs = len(pairsList) | |
|
92 | normFactor = numpy.zeros((nPairs,nHeights)) | |
|
93 | ||
|
94 | indR = numpy.where(self.dataOut.lagR == 0)[0][0] | |
|
95 | indT = numpy.where(self.dataOut.lagT == 0)[0][0] | |
|
96 | ||
|
97 | for l in range(len(pairsList)): | |
|
98 | firstChannel = pairsList[l][0] | |
|
99 | secondChannel = pairsList[l][1] | |
|
100 | ||
|
101 | AC1 = pairsAutoCorr[firstChannel] | |
|
102 | AC2 = pairsAutoCorr[secondChannel] | |
|
103 | ||
|
104 | if (AC1 >= 0 and AC2 >= 0): | |
|
105 | ||
|
106 | data1 = numpy.abs(self.dataOut.data_corr[AC1,:,indR,:]) | |
|
107 | data2 = numpy.abs(self.dataOut.data_corr[AC2,:,indR,:]) | |
|
108 | maxim1 = data1.max(axis = 0) | |
|
109 | maxim2 = data1.max(axis = 0) | |
|
110 | maxim = numpy.sqrt(maxim1*maxim2) | |
|
111 | else: | |
|
112 | #In case there is no autocorrelation for the pair | |
|
113 | data = numpy.abs(self.dataOut.data_corr[l,:,indR,:]) | |
|
114 | maxim = numpy.max(data, axis = 0) | |
|
115 | ||
|
116 | normFactor[l,:] = maxim | |
|
117 | ||
|
118 | self.dataOut.normFactor = normFactor | |
|
119 | ||
|
120 | return 1 | |
|
121 | ||
|
122 | def run(self, lagT=None, lagR=None, pairsList=None, | |
|
123 | nPoints=None, nAvg=None, bufferSize=None, | |
|
124 | fullT = False, fullR = False, removeDC = False): | |
|
89 | return 1 | |
|
90 | ||
|
91 | def run(self, lags=None, mode = 'time', pairsList=None, fullBuffer=False, nAvg = 1, removeDC = False, splitCF=False): | |
|
125 | 92 | |
|
126 | 93 | self.dataOut.flagNoData = True |
|
127 | 94 | |
@@ -133,114 +100,79 class CorrelationProc(ProcessingUnit): | |||
|
133 | 100 | |
|
134 | 101 | if self.dataIn.type == "Voltage": |
|
135 | 102 | |
|
136 | if pairsList == None: | |
|
137 | pairsList = [numpy.array([0,0])] | |
|
138 | ||
|
139 | if nPoints == None: | |
|
140 | nPoints = 128 | |
|
141 | #------------------------------------------------------------ | |
|
142 | #Condicionales para calcular Correlaciones en Tiempo y Rango | |
|
143 | if fullT: | |
|
144 | lagT = numpy.arange(nPoints*2 - 1) - nPoints + 1 | |
|
145 | elif lagT == None: | |
|
146 | lagT = numpy.array([0]) | |
|
147 | else: | |
|
148 | lagT = numpy.array(lagT) | |
|
149 | ||
|
150 | if fullR: | |
|
151 | lagR = numpy.arange(self.dataOut.nHeights) | |
|
152 | elif lagR == None: | |
|
153 | lagR = numpy.array([0]) | |
|
154 | #------------------------------------------------------------- | |
|
155 | ||
|
156 | if nAvg == None: | |
|
157 | nAvg = 1 | |
|
158 | ||
|
159 | if bufferSize == None: | |
|
160 | bufferSize = 0 | |
|
161 | ||
|
162 | deltaH = self.dataIn.heightList[1] - self.dataIn.heightList[0] | |
|
163 | self.dataOut.lagR = numpy.round(numpy.array(lagR)/deltaH) | |
|
164 | self.dataOut.pairsList = pairsList | |
|
165 | self.dataOut.nPoints = nPoints | |
|
166 | # channels = numpy.sort(list(set(list(itertools.chain.from_iterable(pairsList))))) | |
|
103 | nChannels = self.dataIn.nChannels | |
|
104 | nProfiles = self.dataIn.nProfiles | |
|
105 | nHeights = self.dataIn.nHeights | |
|
106 | data_pre = self.dataIn.data | |
|
167 | 107 | |
|
168 | if self.buffer is None: | |
|
108 | #--------------- Remover DC ------------ | |
|
109 | if removeDC: | |
|
110 | data_pre = self.removeDC(data_pre) | |
|
169 | 111 | |
|
170 | self.buffer = numpy.zeros((self.dataIn.nChannels,self.dataIn.nProfiles,self.dataIn.nHeights),dtype='complex') | |
|
171 | ||
|
172 | ||
|
173 | self.buffer[:,self.profIndex,:] = self.dataIn.data.copy()[:,:] | |
|
112 | #--------------------------------------------- | |
|
113 | # pairsList = list(ccfList) | |
|
114 | # for i in acfList: | |
|
115 | # pairsList.append((i,i)) | |
|
116 | # | |
|
117 | # ccf_pairs = numpy.arange(len(ccfList)) | |
|
118 | # acf_pairs = numpy.arange(len(ccfList),len(pairsList)) | |
|
119 | self.__updateObjFromVoltage() | |
|
120 | #---------------------------------------------------------------------- | |
|
121 | #Creating temporal buffers | |
|
122 | if fullBuffer: | |
|
123 | tmp = numpy.zeros((len(pairsList), len(lags), nProfiles, nHeights), dtype = 'complex')*numpy.nan | |
|
124 | elif mode == 'time': | |
|
125 | if lags == None: | |
|
126 | lags = numpy.arange(-nProfiles+1, nProfiles) | |
|
127 | tmp = numpy.zeros((len(pairsList), len(lags), nHeights),dtype='complex') | |
|
128 | elif mode == 'height': | |
|
129 | if lags == None: | |
|
130 | lags = numpy.arange(-nHeights+1, nHeights) | |
|
131 | tmp = numpy.zeros(len(pairsList), (len(lags), nProfiles),dtype='complex') | |
|
174 | 132 | |
|
175 | self.profIndex += 1 | |
|
176 | ||
|
177 | if self.firstdatatime == None: | |
|
133 | #For loop | |
|
134 | for l in range(len(pairsList)): | |
|
178 | 135 | |
|
179 | self.firstdatatime = self.dataIn.utctime | |
|
180 | ||
|
181 | if self.profIndex == nPoints: | |
|
182 |
|
|
|
183 | tmp = self.buffer[:,0:nPoints,:] | |
|
184 | self.buffer = None | |
|
185 | self.buffer = tmp | |
|
186 | ||
|
187 | #--------------- Remover DC ------------ | |
|
188 | if removeDC: | |
|
189 | self.buffer = self.removeDC(self.buffer) | |
|
190 | #--------------------------------------------- | |
|
191 | self.dataOut.data_volts = self.buffer | |
|
192 | self.__updateObjFromVoltage() | |
|
193 | self.dataOut.data_corr = numpy.zeros((len(pairsList), | |
|
194 | len(lagT),len(lagR), | |
|
195 | self.dataIn.nHeights), | |
|
196 | dtype='complex') | |
|
197 | ||
|
198 | for l in range(len(pairsList)): | |
|
199 | ||
|
200 | firstChannel = pairsList[l][0] | |
|
201 | secondChannel = pairsList[l][1] | |
|
202 | ||
|
203 | tmp = None | |
|
204 | tmp = numpy.zeros((len(lagT),len(lagR),self.dataIn.nHeights),dtype='complex') | |
|
136 | ch0 = pairsList[l][0] | |
|
137 | ch1 = pairsList[l][1] | |
|
138 | ||
|
139 | for i in range(len(lags)): | |
|
140 | idx = lags[i] | |
|
205 | 141 | |
|
206 |
f |
|
|
142 | if idx >= 0: | |
|
143 | if mode == 'time': | |
|
144 | ccf0 = data_pre[ch0,:nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) #time | |
|
145 | else: | |
|
146 | ccf0 = data_pre[ch0,:,nHeights-idx]*numpy.conj(data_pre[ch1,:,idx:]) #heights | |
|
147 | else: | |
|
148 | if mode == 'time': | |
|
149 | ccf0 = data_pre[ch0,-idx:,:]*numpy.conj(data_pre[ch1,:nProfiles+idx,:]) #time | |
|
150 | else: | |
|
151 | ccf0 = data_pre[ch0,:,-idx:]*numpy.conj(data_pre[ch1,:,:nHeights+idx]) #heights | |
|
207 | 152 | |
|
208 | for r in range(len(lagR)): | |
|
209 |
|
|
|
210 |
|
|
|
211 | idxR = lagR[r] | |
|
212 |
|
|
|
213 | if idxT >= 0: | |
|
214 | vStacked = numpy.vstack((self.buffer[secondChannel,idxT:,:], | |
|
215 | numpy.zeros((idxT,self.dataIn.nHeights),dtype='complex'))) | |
|
216 | else: | |
|
217 | vStacked = numpy.vstack((numpy.zeros((-idxT,self.dataIn.nHeights),dtype='complex'), | |
|
218 | self.buffer[secondChannel,:(nPoints + idxT),:])) | |
|
219 | ||
|
220 | if idxR >= 0: | |
|
221 | hStacked = numpy.hstack((vStacked[:,idxR:],numpy.zeros((nPoints,idxR),dtype='complex'))) | |
|
222 | else: | |
|
223 | hStacked = numpy.hstack((numpy.zeros((nPoints,-idxR),dtype='complex'),vStacked[:,(self.dataOut.nHeights + idxR)])) | |
|
224 | ||
|
225 | ||
|
226 | tmp[t,r,:] = numpy.sum((numpy.conjugate(self.buffer[firstChannel,:,:])*hStacked),axis=0) | |
|
227 | ||
|
228 | ||
|
229 | hStacked = None | |
|
230 | vStacked = None | |
|
231 | ||
|
232 | self.dataOut.data_corr[l,:,:,:] = tmp[:,:,:] | |
|
233 |
|
|
|
234 | #Se Calcula los factores de Normalizacion | |
|
235 | self.dataOut.pairsAutoCorr = self.dataOut.getPairsAutoCorr() | |
|
236 | self.dataOut.lagT = lagT*self.dataIn.ippSeconds*self.dataIn.nCohInt | |
|
237 | self.dataOut.lagR = lagR | |
|
238 | ||
|
239 | self.calculateNormFactor() | |
|
240 | ||
|
241 | self.dataOut.flagNoData = False | |
|
242 | self.buffer = None | |
|
243 | self.firstdatatime = None | |
|
244 | self.profIndex = 0 | |
|
245 | ||
|
246 | return No newline at end of file | |
|
153 | if fullBuffer: | |
|
154 | tmp[l,i,:ccf0.shape[0],:] = ccf0 | |
|
155 | else: | |
|
156 | tmp[l,i,:] = numpy.sum(ccf0, axis=0) | |
|
157 | ||
|
158 | #----------------------------------------------------------------- | |
|
159 | if fullBuffer: | |
|
160 | tmp = numpy.sum(numpy.reshape(tmp,(tmp.shape[0],tmp.shape[1],tmp.shape[2]/nAvg,nAvg,tmp.shape[3])),axis=3) | |
|
161 | self.dataOut.nAvg = nAvg | |
|
162 | ||
|
163 | self.dataOut.data_cf = tmp | |
|
164 | self.dataOut.mode = mode | |
|
165 | self.dataOut.nLags = len(lags) | |
|
166 | self.dataOut.pairsList = pairsList | |
|
167 | self.dataOut.nPairs = len(pairsList) | |
|
168 | ||
|
169 | #Se Calcula los factores de Normalizacion | |
|
170 | if mode == 'time': | |
|
171 | delta = self.dataIn.ippSeconds*self.dataIn.nCohInt | |
|
172 | else: | |
|
173 | delta = self.dataIn.heightList[1] - self.dataIn.heightList[0] | |
|
174 | self.dataOut.lagRange = numpy.array(lags)*delta | |
|
175 | # self.dataOut.nCohInt = self.dataIn.nCohInt*nAvg | |
|
176 | self.dataOut.flagNoData = False | |
|
177 | a = self.dataOut.normFactor | |
|
178 | return No newline at end of file |
@@ -86,21 +86,19 class ParametersProc(ProcessingUnit): | |||
|
86 | 86 | #---------------------- Correlation Data --------------------------- |
|
87 | 87 | |
|
88 | 88 | if self.dataIn.type == "Correlation": |
|
89 | acf_ind, ccf_ind, acf_pairs, ccf_pairs, data_acf, data_ccf = self.dataIn.splitFunctions() | |
|
89 | 90 | |
|
90 | if self.dataIn.data_ccf is not None: | |
|
91 |
|
|
|
92 | else: | |
|
93 | self.dataOut.data_pre = self.dataIn.data_acf.copy() | |
|
91 | self.dataOut.data_pre = (self.dataIn.data_cf[acf_ind,:], self.dataIn.data_cf[ccf_ind,:,:]) | |
|
92 | self.dataOut.normFactor = (self.dataIn.normFactor[acf_ind,:], self.dataIn.normFactor[ccf_ind,:]) | |
|
93 | self.dataOut.groupList = (acf_pairs, ccf_pairs) | |
|
94 | 94 | |
|
95 | 95 | self.dataOut.abscissaList = self.dataIn.lagRange |
|
96 | 96 | self.dataOut.noise = self.dataIn.noise |
|
97 | self.dataOut.normFactor = self.dataIn.normFactor | |
|
98 | 97 | self.dataOut.data_SNR = self.dataIn.SNR |
|
99 | self.dataOut.groupList = self.dataIn.pairsList | |
|
100 | 98 | self.dataOut.flagNoData = False |
|
101 | 99 | self.dataOut.nAvg = self.dataIn.nAvg |
|
102 | 100 | |
|
103 |
|
|
|
101 | #---------------------- Parameters Data --------------------------- | |
|
104 | 102 | |
|
105 | 103 | if self.dataIn.type == "Parameters": |
|
106 | 104 | self.dataOut.copy(self.dataIn) |
@@ -123,11 +121,19 class SpectralMoments(Operation): | |||
|
123 | 121 | |
|
124 | 122 | Type of dataIn: Spectra |
|
125 | 123 | |
|
124 | Configuration Parameters: | |
|
125 | ||
|
126 | dirCosx : Cosine director in X axis | |
|
127 | dirCosy : Cosine director in Y axis | |
|
128 | ||
|
129 | elevation : | |
|
130 | azimuth : | |
|
131 | ||
|
126 | 132 | Input: |
|
127 | 133 | channelList : simple channel list to select e.g. [2,3,7] |
|
128 | 134 | self.dataOut.data_pre : Spectral data |
|
129 | 135 | self.dataOut.abscissaList : List of frequencies |
|
130 |
self.dataOut.noise |
|
|
136 | self.dataOut.noise : Noise level per channel | |
|
131 | 137 | |
|
132 | 138 | Affected: |
|
133 | 139 | self.dataOut.data_param : Parameters per channel |
@@ -135,20 +141,16 class SpectralMoments(Operation): | |||
|
135 | 141 | |
|
136 | 142 | ''' |
|
137 | 143 | |
|
138 |
def run(self, dataOut |
|
|
144 | def run(self, dataOut): | |
|
139 | 145 | |
|
140 | 146 | dataOut.data_pre = dataOut.data_pre[0] |
|
141 | 147 | data = dataOut.data_pre |
|
142 | 148 | absc = dataOut.abscissaList[:-1] |
|
143 | 149 | noise = dataOut.noise |
|
144 | ||
|
145 |
data_param = numpy.zeros(( |
|
|
146 | ||
|
147 | if channelList== None: | |
|
148 | channelList = dataOut.channelList | |
|
149 | dataOut.channelList = channelList | |
|
150 | ||
|
151 | for ind in channelList: | |
|
150 | nChannel = data.shape[0] | |
|
151 | data_param = numpy.zeros((nChannel, 4, data.shape[2])) | |
|
152 | ||
|
153 | for ind in range(nChannel): | |
|
152 | 154 | data_param[ind,:,:] = self.__calculateMoments(data[ind,:,:], absc, noise[ind]) |
|
153 | 155 | |
|
154 | 156 | dataOut.data_param = data_param[:,1:,:] |
@@ -277,26 +279,30 class SALags(Operation): | |||
|
277 | 279 | |
|
278 | 280 | ''' |
|
279 | 281 | def run(self, dataOut): |
|
280 | data = dataOut.data_pre | |
|
281 | 282 | data_acf = dataOut.data_pre[0] |
|
282 | 283 | data_ccf = dataOut.data_pre[1] |
|
284 | normFactor_acf = dataOut.normFactor[0] | |
|
285 | normFactor_ccf = dataOut.normFactor[1] | |
|
286 | pairs_acf = dataOut.groupList[0] | |
|
287 | pairs_ccf = dataOut.groupList[1] | |
|
283 | 288 | |
|
284 | normFactor = dataOut.normFactor | |
|
285 | 289 | nHeights = dataOut.nHeights |
|
286 |
absc = dataOut.abscissaList |
|
|
290 | absc = dataOut.abscissaList | |
|
287 | 291 | noise = dataOut.noise |
|
288 | 292 | SNR = dataOut.data_SNR |
|
289 | # pairsList = dataOut.groupList | |
|
290 | 293 | nChannels = dataOut.nChannels |
|
294 | # pairsList = dataOut.groupList | |
|
291 | 295 | # pairsAutoCorr, pairsCrossCorr = self.__getPairsAutoCorr(pairsList, nChannels) |
|
292 | dataOut.data_param = numpy.zeros((len(pairsCrossCorr)*2 + 1, nHeights)) | |
|
293 | ||
|
294 | dataNorm = numpy.abs(data) | |
|
295 | for l in range(len(pairsList)): | |
|
296 | dataNorm[l,:,:] = dataNorm[l,:,:]/normFactor[l,:] | |
|
296 | ||
|
297 | for l in range(len(pairs_acf)): | |
|
298 | data_acf[l,:,:] = data_acf[l,:,:]/normFactor_acf[l,:] | |
|
299 | ||
|
300 | for l in range(len(pairs_ccf)): | |
|
301 | data_ccf[l,:,:] = data_ccf[l,:,:]/normFactor_ccf[l,:] | |
|
297 | 302 | |
|
298 | self.dataOut.data_param[:-1,:] = self.__calculateTaus(dataNorm, pairsCrossCorr, pairsAutoCorr, absc) | |
|
299 |
|
|
|
303 | dataOut.data_param = numpy.zeros((len(pairs_ccf)*2 + 1, nHeights)) | |
|
304 | dataOut.data_param[:-1,:] = self.__calculateTaus(data_acf, data_ccf, absc) | |
|
305 | dataOut.data_param[-1,:] = self.__calculateLag1Phase(data_acf, absc) | |
|
300 | 306 | return |
|
301 | 307 | |
|
302 | 308 | # def __getPairsAutoCorr(self, pairsList, nChannels): |
@@ -318,29 +324,30 class SALags(Operation): | |||
|
318 | 324 | # |
|
319 | 325 | # return pairsAutoCorr, pairsCrossCorr |
|
320 | 326 | |
|
321 |
def __calculateTaus(self, data, |
|
|
327 | def __calculateTaus(self, data_acf, data_ccf, lagRange): | |
|
322 | 328 | |
|
323 |
|
|
|
329 | lag0 = data_acf.shape[1]/2 | |
|
324 | 330 | #Funcion de Autocorrelacion |
|
325 |
|
|
|
331 | mean_acf = stats.nanmean(data_acf, axis = 0) | |
|
326 | 332 | |
|
327 | 333 | #Obtencion Indice de TauCross |
|
328 |
ind |
|
|
334 | ind_ccf = data_ccf.argmax(axis = 1) | |
|
329 | 335 | #Obtencion Indice de TauAuto |
|
330 |
ind |
|
|
331 | CCValue = data[pairsCrossCorr,Pt0,:] | |
|
332 | for i in range(pairsCrossCorr.size): | |
|
333 | indAuto[i,:] = numpy.abs(dataAutoCorr - CCValue[i,:]).argmin(axis = 0) | |
|
336 | ind_acf = numpy.zeros(ind_ccf.shape,dtype = 'int') | |
|
337 | ccf_lag0 = data_ccf[:,lag0,:] | |
|
338 | ||
|
339 | for i in range(ccf_lag0.shape[0]): | |
|
340 | ind_acf[i,:] = numpy.abs(mean_acf - ccf_lag0[i,:]).argmin(axis = 0) | |
|
334 | 341 | |
|
335 | 342 | #Obtencion de TauCross y TauAuto |
|
336 |
tau |
|
|
337 |
tau |
|
|
343 | tau_ccf = lagRange[ind_ccf] | |
|
344 | tau_acf = lagRange[ind_acf] | |
|
338 | 345 | |
|
339 |
Nan1, Nan2 = numpy.where(tau |
|
|
346 | Nan1, Nan2 = numpy.where(tau_ccf == lagRange[0]) | |
|
340 | 347 | |
|
341 |
tau |
|
|
342 |
tau |
|
|
343 |
tau = numpy.vstack((tau |
|
|
348 | tau_ccf[Nan1,Nan2] = numpy.nan | |
|
349 | tau_acf[Nan1,Nan2] = numpy.nan | |
|
350 | tau = numpy.vstack((tau_ccf,tau_acf)) | |
|
344 | 351 | |
|
345 | 352 | return tau |
|
346 | 353 | |
@@ -595,7 +602,8 class WindProfiler(Operation): | |||
|
595 | 602 | return velUVW |
|
596 | 603 | |
|
597 | 604 | # def techniqueDBS(self, velRadial0, dirCosx, disrCosy, azimuth, correct, horizontalOnly, heiRang, SNR0): |
|
598 | def techniqueDBS(self, velRadial0, heiRang, SNR0, kwargs): | |
|
605 | ||
|
606 | def techniqueDBS(self, kwargs): | |
|
599 | 607 | """ |
|
600 | 608 | Function that implements Doppler Beam Swinging (DBS) technique. |
|
601 | 609 | |
@@ -606,6 +614,9 class WindProfiler(Operation): | |||
|
606 | 614 | |
|
607 | 615 | Parameters affected: Winds, height range, SNR |
|
608 | 616 | """ |
|
617 | velRadial0 = kwargs['velRadial'] | |
|
618 | heiRang = kwargs['heightList'] | |
|
619 | SNR0 = kwargs['SNR'] | |
|
609 | 620 | |
|
610 | 621 | if kwargs.has_key('dirCosx') and kwargs.has_key('dirCosy'): |
|
611 | 622 | theta_x = numpy.array(kwargs['dirCosx']) |
@@ -639,8 +650,9 class WindProfiler(Operation): | |||
|
639 | 650 | |
|
640 | 651 | return winds, heiRang1, SNR1 |
|
641 | 652 | |
|
642 |
def __calculateDistance(self, posx, posy, pairs |
|
|
653 | def __calculateDistance(self, posx, posy, pairs_ccf, azimuth = None): | |
|
643 | 654 | |
|
655 | nPairs = len(pairs_ccf) | |
|
644 | 656 | posx = numpy.asarray(posx) |
|
645 | 657 | posy = numpy.asarray(posy) |
|
646 | 658 | |
@@ -654,28 +666,31 class WindProfiler(Operation): | |||
|
654 | 666 | posy1 = posy |
|
655 | 667 | |
|
656 | 668 | #Calculo de Distancias |
|
657 |
distx = numpy.zeros( |
|
|
658 |
disty = numpy.zeros( |
|
|
659 |
dist = numpy.zeros( |
|
|
660 |
ang = numpy.zeros( |
|
|
661 | ||
|
662 |
for i in range( |
|
|
663 |
distx[i] = posx1[pairs |
|
|
664 |
disty[i] = posy1[pairs |
|
|
669 | distx = numpy.zeros(nPairs) | |
|
670 | disty = numpy.zeros(nPairs) | |
|
671 | dist = numpy.zeros(nPairs) | |
|
672 | ang = numpy.zeros(nPairs) | |
|
673 | ||
|
674 | for i in range(nPairs): | |
|
675 | distx[i] = posx1[pairs_ccf[i][1]] - posx1[pairs_ccf[i][0]] | |
|
676 | disty[i] = posy1[pairs_ccf[i][1]] - posy1[pairs_ccf[i][0]] | |
|
665 | 677 | dist[i] = numpy.sqrt(distx[i]**2 + disty[i]**2) |
|
666 | 678 | ang[i] = numpy.arctan2(disty[i],distx[i]) |
|
667 | #Calculo de Matrices | |
|
668 | nPairs = len(pairs) | |
|
669 | ang1 = numpy.zeros((nPairs, 2, 1)) | |
|
670 | dist1 = numpy.zeros((nPairs, 2, 1)) | |
|
671 | 679 | |
|
672 | for j in range(nPairs): | |
|
673 | dist1[j,0,0] = dist[pairs[j][0]] | |
|
674 | dist1[j,1,0] = dist[pairs[j][1]] | |
|
675 | ang1[j,0,0] = ang[pairs[j][0]] | |
|
676 | ang1[j,1,0] = ang[pairs[j][1]] | |
|
677 |
|
|
|
678 | return distx,disty, dist1,ang1 | |
|
680 | return distx, disty, dist, ang | |
|
681 | #Calculo de Matrices | |
|
682 | # nPairs = len(pairs) | |
|
683 | # ang1 = numpy.zeros((nPairs, 2, 1)) | |
|
684 | # dist1 = numpy.zeros((nPairs, 2, 1)) | |
|
685 | # | |
|
686 | # for j in range(nPairs): | |
|
687 | # dist1[j,0,0] = dist[pairs[j][0]] | |
|
688 | # dist1[j,1,0] = dist[pairs[j][1]] | |
|
689 | # ang1[j,0,0] = ang[pairs[j][0]] | |
|
690 | # ang1[j,1,0] = ang[pairs[j][1]] | |
|
691 | # | |
|
692 | # return distx,disty, dist1,ang1 | |
|
693 | ||
|
679 | 694 | |
|
680 | 695 | def __calculateVelVer(self, phase, lagTRange, _lambda): |
|
681 | 696 | |
@@ -686,12 +701,14 class WindProfiler(Operation): | |||
|
686 | 701 | |
|
687 | 702 | def __calculateVelHorDir(self, dist, tau1, tau2, ang): |
|
688 | 703 | nPairs = tau1.shape[0] |
|
689 | vel = numpy.zeros((nPairs,3,tau1.shape[2])) | |
|
704 | nHeights = tau1.shape[1] | |
|
705 | vel = numpy.zeros((nPairs,3,nHeights)) | |
|
706 | dist1 = numpy.reshape(dist, (dist.size,1)) | |
|
690 | 707 | |
|
691 | 708 | angCos = numpy.cos(ang) |
|
692 | 709 | angSin = numpy.sin(ang) |
|
693 | 710 | |
|
694 | vel0 = dist*tau1/(2*tau2**2) | |
|
711 | vel0 = dist1*tau1/(2*tau2**2) | |
|
695 | 712 | vel[:,0,:] = (vel0*angCos).sum(axis = 1) |
|
696 | 713 | vel[:,1,:] = (vel0*angSin).sum(axis = 1) |
|
697 | 714 | |
@@ -700,26 +717,28 class WindProfiler(Operation): | |||
|
700 | 717 | |
|
701 | 718 | return vel |
|
702 | 719 | |
|
703 | def __getPairsAutoCorr(self, pairsList, nChannels): | |
|
704 | ||
|
705 | pairsAutoCorr = numpy.zeros(nChannels, dtype = 'int')*numpy.nan | |
|
706 | ||
|
707 | for l in range(len(pairsList)): | |
|
708 | firstChannel = pairsList[l][0] | |
|
709 | secondChannel = pairsList[l][1] | |
|
710 | ||
|
711 | #Obteniendo pares de Autocorrelacion | |
|
712 | if firstChannel == secondChannel: | |
|
713 | pairsAutoCorr[firstChannel] = int(l) | |
|
714 | ||
|
715 | pairsAutoCorr = pairsAutoCorr.astype(int) | |
|
716 | ||
|
717 | pairsCrossCorr = range(len(pairsList)) | |
|
718 | pairsCrossCorr = numpy.delete(pairsCrossCorr,pairsAutoCorr) | |
|
719 | ||
|
720 | return pairsAutoCorr, pairsCrossCorr | |
|
720 | # def __getPairsAutoCorr(self, pairsList, nChannels): | |
|
721 | # | |
|
722 | # pairsAutoCorr = numpy.zeros(nChannels, dtype = 'int')*numpy.nan | |
|
723 | # | |
|
724 | # for l in range(len(pairsList)): | |
|
725 | # firstChannel = pairsList[l][0] | |
|
726 | # secondChannel = pairsList[l][1] | |
|
727 | # | |
|
728 | # #Obteniendo pares de Autocorrelacion | |
|
729 | # if firstChannel == secondChannel: | |
|
730 | # pairsAutoCorr[firstChannel] = int(l) | |
|
731 | # | |
|
732 | # pairsAutoCorr = pairsAutoCorr.astype(int) | |
|
733 | # | |
|
734 | # pairsCrossCorr = range(len(pairsList)) | |
|
735 | # pairsCrossCorr = numpy.delete(pairsCrossCorr,pairsAutoCorr) | |
|
736 | # | |
|
737 | # return pairsAutoCorr, pairsCrossCorr | |
|
721 | 738 | |
|
722 | def techniqueSA(self, pairsSelected, pairsList, nChannels, tau, azimuth, _lambda, position_x, position_y, lagTRange, correctFactor): | |
|
739 | # def techniqueSA(self, pairsSelected, pairsList, nChannels, tau, azimuth, _lambda, position_x, position_y, lagTRange, correctFactor): | |
|
740 | def techniqueSA(self, kwargs): | |
|
741 | ||
|
723 | 742 |
|
|
724 | 743 | Function that implements Spaced Antenna (SA) technique. |
|
725 | 744 | |
@@ -730,28 +749,42 class WindProfiler(Operation): | |||
|
730 | 749 | |
|
731 | 750 | Parameters affected: Winds |
|
732 | 751 | """ |
|
733 | #Cross Correlation pairs obtained | |
|
734 | pairsAutoCorr, pairsCrossCorr = self.__getPairsAutoCorr(pairsList, nChannels) | |
|
735 | pairsArray = numpy.array(pairsList)[pairsCrossCorr] | |
|
736 | pairsSelArray = numpy.array(pairsSelected) | |
|
737 | pairs = [] | |
|
752 | position_x = kwargs['positionX'] | |
|
753 | position_y = kwargs['positionY'] | |
|
754 | azimuth = kwargs['azimuth'] | |
|
755 | ||
|
756 | if kwargs.has_key('correctFactor'): | |
|
757 | correctFactor = kwargs['correctFactor'] | |
|
758 | else: | |
|
759 | correctFactor = 1 | |
|
760 | ||
|
761 | groupList = kwargs['groupList'] | |
|
762 | pairs_ccf = groupList[1] | |
|
763 | tau = kwargs['tau'] | |
|
764 | _lambda = kwargs['_lambda'] | |
|
738 | 765 | |
|
739 |
# |
|
|
740 | for i in range(pairsSelArray.shape[0]/2): | |
|
741 | ind1 = numpy.where(numpy.all(pairsArray == pairsSelArray[2*i], axis = 1))[0][0] | |
|
742 | ind2 = numpy.where(numpy.all(pairsArray == pairsSelArray[2*i + 1], axis = 1))[0][0] | |
|
743 | pairs.append((ind1,ind2)) | |
|
766 | #Cross Correlation pairs obtained | |
|
767 | # pairsAutoCorr, pairsCrossCorr = self.__getPairsAutoCorr(pairssList, nChannels) | |
|
768 | # pairsArray = numpy.array(pairsList)[pairsCrossCorr] | |
|
769 | # pairsSelArray = numpy.array(pairsSelected) | |
|
770 | # pairs = [] | |
|
771 | # | |
|
772 | # #Wind estimation pairs obtained | |
|
773 | # for i in range(pairsSelArray.shape[0]/2): | |
|
774 | # ind1 = numpy.where(numpy.all(pairsArray == pairsSelArray[2*i], axis = 1))[0][0] | |
|
775 | # ind2 = numpy.where(numpy.all(pairsArray == pairsSelArray[2*i + 1], axis = 1))[0][0] | |
|
776 | # pairs.append((ind1,ind2)) | |
|
744 | 777 | |
|
745 | 778 | indtau = tau.shape[0]/2 |
|
746 | 779 | tau1 = tau[:indtau,:] |
|
747 | 780 | tau2 = tau[indtau:-1,:] |
|
748 | tau1 = tau1[pairs,:] | |
|
749 | tau2 = tau2[pairs,:] | |
|
781 | # tau1 = tau1[pairs,:] | |
|
782 | # tau2 = tau2[pairs,:] | |
|
750 | 783 | phase1 = tau[-1,:] |
|
751 | 784 | |
|
752 | 785 | #--------------------------------------------------------------------- |
|
753 | 786 | #Metodo Directo |
|
754 |
distx, disty, dist, ang = self.__calculateDistance(position_x, position_y, pairs |
|
|
787 | distx, disty, dist, ang = self.__calculateDistance(position_x, position_y, pairs_ccf,azimuth) | |
|
755 | 788 | winds = self.__calculateVelHorDir(dist, tau1, tau2, ang) |
|
756 | 789 | winds = stats.nanmean(winds, axis=0) |
|
757 | 790 | #--------------------------------------------------------------------- |
@@ -1008,58 +1041,42 class WindProfiler(Operation): | |||
|
1008 | 1041 | SNR = dataOut.data_SNR |
|
1009 | 1042 | |
|
1010 | 1043 | if technique == 'DBS': |
|
1011 | # if kwargs.has_key('dirCosx') and kwargs.has_key('dirCosy'): | |
|
1012 | # theta_x = numpy.array(kwargs['dirCosx']) | |
|
1013 | # theta_y = numpy.array(kwargs['dirCosy']) | |
|
1014 | # else: | |
|
1015 | # elev = numpy.array(kwargs['elevation']) | |
|
1016 | # azim = numpy.array(kwargs['azimuth']) | |
|
1017 | # theta_x, theta_y = self.__calculateCosDir(elev, azim) | |
|
1018 | # azimuth = kwargs['correctAzimuth'] | |
|
1019 | # if kwargs.has_key('horizontalOnly'): | |
|
1020 | # horizontalOnly = kwargs['horizontalOnly'] | |
|
1021 | # else: horizontalOnly = False | |
|
1022 | # if kwargs.has_key('correctFactor'): | |
|
1023 | # correctFactor = kwargs['correctFactor'] | |
|
1024 | # else: correctFactor = 1 | |
|
1025 | # if kwargs.has_key('channelList'): | |
|
1026 | # channelList = kwargs['channelList'] | |
|
1027 | # if len(channelList) == 2: | |
|
1028 | # horizontalOnly = True | |
|
1029 | # arrayChannel = numpy.array(channelList) | |
|
1030 | # param = param[arrayChannel,:,:] | |
|
1031 | # theta_x = theta_x[arrayChannel] | |
|
1032 | # theta_y = theta_y[arrayChannel] | |
|
1033 | ||
|
1034 | velRadial0 = param[:,1,:] #Radial velocity | |
|
1035 | # dataOut.data_output, dataOut.heightList, dataOut.data_SNR = self.techniqueDBS(velRadial0, theta_x, theta_y, azimuth, correctFactor, horizontalOnly, heightList, SNR) #DBS Function | |
|
1036 | dataOut.data_output, dataOut.heightList, dataOut.data_SNR = self.techniqueDBS(velRadial0, heightList, SNR, kwargs) #DBS Function | |
|
1044 | ||
|
1045 | kwargs['velRadial'] = param[:,1,:] #Radial velocity | |
|
1046 | kwargs['heightList'] = heightList | |
|
1047 | kwargs['SNR'] = SNR | |
|
1048 | ||
|
1049 | dataOut.data_output, dataOut.heightList, dataOut.data_SNR = self.techniqueDBS(kwargs) #DBS Function | |
|
1037 | 1050 | dataOut.utctimeInit = dataOut.utctime |
|
1038 | 1051 | dataOut.outputInterval = dataOut.paramInterval |
|
1039 | 1052 | |
|
1040 | 1053 | elif technique == 'SA': |
|
1041 | 1054 | |
|
1042 | 1055 | #Parameters |
|
1043 | position_x = kwargs['positionX'] | |
|
1044 | position_y = kwargs['positionY'] | |
|
1045 | azimuth = kwargs['azimuth'] | |
|
1046 | ||
|
1047 | if kwargs.has_key('crosspairsList'): | |
|
1048 | pairs = kwargs['crosspairsList'] | |
|
1049 | else: | |
|
1050 | pairs = None | |
|
1051 | ||
|
1052 | if kwargs.has_key('correctFactor'): | |
|
1053 | correctFactor = kwargs['correctFactor'] | |
|
1054 | else: | |
|
1055 | correctFactor = 1 | |
|
1056 | ||
|
1057 | tau = dataOut.data_param | |
|
1058 | _lambda = dataOut.C/dataOut.frequency | |
|
1059 | pairsList = dataOut.groupList | |
|
1060 | nChannels = dataOut.nChannels | |
|
1061 | ||
|
1062 | dataOut.data_output = self.techniqueSA(pairs, pairsList, nChannels, tau, azimuth, _lambda, position_x, position_y, absc, correctFactor) | |
|
1056 | # position_x = kwargs['positionX'] | |
|
1057 | # position_y = kwargs['positionY'] | |
|
1058 | # azimuth = kwargs['azimuth'] | |
|
1059 | # | |
|
1060 | # if kwargs.has_key('crosspairsList'): | |
|
1061 | # pairs = kwargs['crosspairsList'] | |
|
1062 | # else: | |
|
1063 | # pairs = None | |
|
1064 | # | |
|
1065 | # if kwargs.has_key('correctFactor'): | |
|
1066 | # correctFactor = kwargs['correctFactor'] | |
|
1067 | # else: | |
|
1068 | # correctFactor = 1 | |
|
1069 | ||
|
1070 | # tau = dataOut.data_param | |
|
1071 | # _lambda = dataOut.C/dataOut.frequency | |
|
1072 | # pairsList = dataOut.groupList | |
|
1073 | # nChannels = dataOut.nChannels | |
|
1074 | ||
|
1075 | kwargs['groupList'] = dataOut.groupList | |
|
1076 | kwargs['tau'] = dataOut.data_param | |
|
1077 | kwargs['_lambda'] = dataOut.C/dataOut.frequency | |
|
1078 | # dataOut.data_output = self.techniqueSA(pairs, pairsList, nChannels, tau, azimuth, _lambda, position_x, position_y, absc, correctFactor) | |
|
1079 | dataOut.data_output = self.techniqueSA(kwargs) | |
|
1063 | 1080 | dataOut.utctimeInit = dataOut.utctime |
|
1064 | 1081 | dataOut.outputInterval = dataOut.timeInterval |
|
1065 | 1082 | |
@@ -1435,7 +1452,7 class NonSpecularMeteorDetection(Operation): | |||
|
1435 | 1452 | |
|
1436 | 1453 | #--------------- Specular Meteor ---------------- |
|
1437 | 1454 | |
|
1438 |
class M |
|
|
1455 | class SMDetection(Operation): | |
|
1439 | 1456 | ''' |
|
1440 | 1457 | Function DetectMeteors() |
|
1441 | 1458 | Project developed with paper: |
@@ -1515,20 +1532,20 class MeteorDetection(Operation): | |||
|
1515 | 1532 | if channelPositions == None: |
|
1516 | 1533 | # channelPositions = [(2.5,0), (0,2.5), (0,0), (0,4.5), (-2,0)] #T |
|
1517 | 1534 | channelPositions = [(4.5,2), (2,4.5), (2,2), (2,0), (0,2)] #Estrella |
|
1518 |
meteorOps = M |
|
|
1535 | meteorOps = SMOperations() | |
|
1519 | 1536 | pairslist0, distances = meteorOps.getPhasePairs(channelPositions) |
|
1520 | ||
|
1521 | #Get Beacon signal | |
|
1522 | newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) | |
|
1523 | ||
|
1524 | if hei_ref != None: | |
|
1525 | newheis = numpy.where(self.dataOut.heightList>hei_ref) | |
|
1526 | ||
|
1527 | 1537 | heiRang = dataOut.getHeiRange() |
|
1538 | #Get Beacon signal - No Beacon signal anymore | |
|
1539 | # newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) | |
|
1540 | # | |
|
1541 | # if hei_ref != None: | |
|
1542 | # newheis = numpy.where(self.dataOut.heightList>hei_ref) | |
|
1543 | # | |
|
1544 | ||
|
1528 | 1545 | |
|
1529 | 1546 | #****************REMOVING HARDWARE PHASE DIFFERENCES*************** |
|
1530 | 1547 | # see if the user put in pre defined phase shifts |
|
1531 |
voltsPShift = |
|
|
1548 | voltsPShift = dataOut.data_pre.copy() | |
|
1532 | 1549 | |
|
1533 | 1550 | # if predefinedPhaseShifts != None: |
|
1534 | 1551 | # hardwarePhaseShifts = numpy.array(predefinedPhaseShifts)*numpy.pi/180 |
@@ -1554,14 +1571,14 class MeteorDetection(Operation): | |||
|
1554 | 1571 | voltsPShift[i] = voltsPShift[i] - voltsDC[i] |
|
1555 | 1572 | |
|
1556 | 1573 | #Don't considerate last heights, theyre used to calculate Hardware Phase Shift |
|
1557 | voltsPShift = voltsPShift[:,:,:newheis[0][0]] | |
|
1574 | # voltsPShift = voltsPShift[:,:,:newheis[0][0]] | |
|
1558 | 1575 | |
|
1559 | 1576 | #************ FIND POWER OF DATA W/COH OR NON COH DETECTION (3.4) ********** |
|
1560 | 1577 | #Coherent Detection |
|
1561 | 1578 | if cohDetection: |
|
1562 | 1579 | #use coherent detection to get the net power |
|
1563 | 1580 | cohDet_thresh = cohDet_thresh*numpy.pi/180 |
|
1564 |
voltsPShift = self.__coherentDetection(voltsPShift, cohDet_timeStep, |
|
|
1581 | voltsPShift = self.__coherentDetection(voltsPShift, cohDet_timeStep, dataOut.timeInterval, pairslist0, cohDet_thresh) | |
|
1565 | 1582 | |
|
1566 | 1583 | #Non-coherent detection! |
|
1567 | 1584 | powerNet = numpy.nansum(numpy.abs(voltsPShift[:,:,:])**2,0) |
@@ -1569,7 +1586,7 class MeteorDetection(Operation): | |||
|
1569 | 1586 | |
|
1570 | 1587 | #********** FIND THE NOISE LEVEL AND POSSIBLE METEORS **************** |
|
1571 | 1588 | #Get noise |
|
1572 |
noise, noise1 = self.__getNoise(powerNet, noise_timeStep, |
|
|
1589 | noise, noise1 = self.__getNoise(powerNet, noise_timeStep, dataOut.timeInterval) | |
|
1573 | 1590 | # noise = self.getNoise1(powerNet, noise_timeStep, self.dataOut.timeInterval) |
|
1574 | 1591 | #Get signal threshold |
|
1575 | 1592 | signalThresh = noise_multiple*noise |
@@ -1579,10 +1596,10 class MeteorDetection(Operation): | |||
|
1579 | 1596 | |
|
1580 | 1597 | #************** REMOVE MULTIPLE DETECTIONS (3.5) *************************** |
|
1581 | 1598 | #Parameters |
|
1582 |
heiRange = |
|
|
1599 | heiRange = dataOut.getHeiRange() | |
|
1583 | 1600 | rangeInterval = heiRange[1] - heiRange[0] |
|
1584 | 1601 | rangeLimit = multDet_rangeLimit/rangeInterval |
|
1585 |
timeLimit = multDet_timeLimit/ |
|
|
1602 | timeLimit = multDet_timeLimit/dataOut.timeInterval | |
|
1586 | 1603 | #Multiple detection removals |
|
1587 | 1604 | listMeteors1 = self.__removeMultipleDetections(listMeteors, rangeLimit, timeLimit) |
|
1588 | 1605 | #************ END OF REMOVE MULTIPLE DETECTIONS ********************** |
@@ -1592,20 +1609,20 class MeteorDetection(Operation): | |||
|
1592 | 1609 | phaseThresh = phaseThresh*numpy.pi/180 |
|
1593 | 1610 | thresh = [phaseThresh, noise_multiple, SNRThresh] |
|
1594 | 1611 | #Meteor reestimation (Errors N 1, 6, 12, 17) |
|
1595 |
listMeteors2, listMeteorsPower, listMeteorsVolts = self.__meteorReestimation(listMeteors1, voltsPShift, pairslist0, thresh, noise, |
|
|
1612 | listMeteors2, listMeteorsPower, listMeteorsVolts = self.__meteorReestimation(listMeteors1, voltsPShift, pairslist0, thresh, noise, dataOut.timeInterval, dataOut.frequency) | |
|
1596 | 1613 | # listMeteors2, listMeteorsPower, listMeteorsVolts = self.meteorReestimation3(listMeteors2, listMeteorsPower, listMeteorsVolts, voltsPShift, pairslist, thresh, noise) |
|
1597 | 1614 | #Estimation of decay times (Errors N 7, 8, 11) |
|
1598 |
listMeteors3 = self.__estimateDecayTime(listMeteors2, listMeteorsPower, |
|
|
1615 | listMeteors3 = self.__estimateDecayTime(listMeteors2, listMeteorsPower, dataOut.timeInterval, dataOut.frequency) | |
|
1599 | 1616 | #******************* END OF METEOR REESTIMATION ******************* |
|
1600 | 1617 | |
|
1601 | 1618 | #********************* METEOR PARAMETERS CALCULATION (3.11, 3.12, 3.13) ************************** |
|
1602 | 1619 | #Calculating Radial Velocity (Error N 15) |
|
1603 | 1620 | radialStdThresh = 10 |
|
1604 |
listMeteors4 = self.__getRadialVelocity(listMeteors3, listMeteorsVolts, radialStdThresh, pairslist0, |
|
|
1621 | listMeteors4 = self.__getRadialVelocity(listMeteors3, listMeteorsVolts, radialStdThresh, pairslist0, dataOut.timeInterval) | |
|
1605 | 1622 | |
|
1606 | 1623 | if len(listMeteors4) > 0: |
|
1607 | 1624 | #Setting New Array |
|
1608 |
date = |
|
|
1625 | date = dataOut.utctime | |
|
1609 | 1626 | arrayParameters = self.__setNewArrays(listMeteors4, date, heiRang) |
|
1610 | 1627 | |
|
1611 | 1628 | #Correcting phase offset |
@@ -1641,12 +1658,12 class MeteorDetection(Operation): | |||
|
1641 | 1658 | |
|
1642 | 1659 | #***************************+ PASS DATA TO NEXT STEP ********************** |
|
1643 | 1660 | # arrayFinal = arrayParameters.reshape((1,arrayParameters.shape[0],arrayParameters.shape[1])) |
|
1644 |
|
|
|
1661 | dataOut.data_param = arrayParameters | |
|
1645 | 1662 | |
|
1646 | 1663 | if arrayParameters == None: |
|
1647 |
|
|
|
1664 | dataOut.flagNoData = True | |
|
1648 | 1665 | else: |
|
1649 |
|
|
|
1666 | dataOut.flagNoData = True | |
|
1650 | 1667 | |
|
1651 | 1668 | return |
|
1652 | 1669 | |
@@ -2162,7 +2179,7 class MeteorDetection(Operation): | |||
|
2162 | 2179 | |
|
2163 | 2180 | return arrayParameters |
|
2164 | 2181 | |
|
2165 |
class CorrectM |
|
|
2182 | class CorrectSMPhases(Operation): | |
|
2166 | 2183 | |
|
2167 | 2184 | def run(self, dataOut, phaseOffsets, hmin = 50, hmax = 150, azimuth = 45, channelPositions = None): |
|
2168 | 2185 | |
@@ -2178,7 +2195,7 class CorrectMeteorPhases(Operation): | |||
|
2178 | 2195 | # arrayParameters[:,8:12] = numpy.unwrap(arrayParameters[:,8:12] + phaseOffsets) |
|
2179 | 2196 | arrayParameters[:,8:12] = numpy.angle(numpy.exp(1j*(arrayParameters[:,8:12] + phaseOffsets))) |
|
2180 | 2197 | |
|
2181 |
meteorOps = M |
|
|
2198 | meteorOps = SMOperations() | |
|
2182 | 2199 | if channelPositions == None: |
|
2183 | 2200 | # channelPositions = [(2.5,0), (0,2.5), (0,0), (0,4.5), (-2,0)] #T |
|
2184 | 2201 | channelPositions = [(4.5,2), (2,4.5), (2,2), (2,0), (0,2)] #Estrella |
@@ -2191,7 +2208,7 class CorrectMeteorPhases(Operation): | |||
|
2191 | 2208 | dataOut.data_param = arrayParameters |
|
2192 | 2209 | return |
|
2193 | 2210 | |
|
2194 | class PhaseCalibration(Operation): | |
|
2211 | class SMPhaseCalibration(Operation): | |
|
2195 | 2212 | |
|
2196 | 2213 | __buffer = None |
|
2197 | 2214 | |
@@ -2274,7 +2291,7 class PhaseCalibration(Operation): | |||
|
2274 | 2291 | return coeffs[0]*numpy.exp(-0.5*((t - coeffs[1]) / coeffs[2])**2) |
|
2275 | 2292 | |
|
2276 | 2293 | def __getPhases(self, azimuth, h, pairsList, d, gammas, meteorsArray): |
|
2277 |
meteorOps = M |
|
|
2294 | meteorOps = SMOperations() | |
|
2278 | 2295 | nchan = 4 |
|
2279 | 2296 | pairx = pairsList[0] |
|
2280 | 2297 | pairy = pairsList[1] |
@@ -2365,7 +2382,7 class PhaseCalibration(Operation): | |||
|
2365 | 2382 | if channelPositions == None: |
|
2366 | 2383 | # channelPositions = [(2.5,0), (0,2.5), (0,0), (0,4.5), (-2,0)] #T |
|
2367 | 2384 | channelPositions = [(4.5,2), (2,4.5), (2,2), (2,0), (0,2)] #Estrella |
|
2368 |
meteorOps = M |
|
|
2385 | meteorOps = SMOperations() | |
|
2369 | 2386 | pairslist0, distances = meteorOps.getPhasePairs(channelPositions) |
|
2370 | 2387 | |
|
2371 | 2388 | # distances1 = [-distances[0]*lamb, distances[1]*lamb, -distances[2]*lamb, distances[3]*lamb] |
@@ -2391,7 +2408,7 class PhaseCalibration(Operation): | |||
|
2391 | 2408 | |
|
2392 | 2409 | return |
|
2393 | 2410 | |
|
2394 |
class M |
|
|
2411 | class SMOperations(): | |
|
2395 | 2412 | |
|
2396 | 2413 | def __init__(self): |
|
2397 | 2414 |
General Comments 0
You need to be logged in to leave comments.
Login now