@@ -134,20 +134,169 class VoltageProcessor: | |||
|
134 | 134 | self.voltageOutObj.flagNoData = True |
|
135 | 135 | |
|
136 | 136 | self.decoderIndex += 1 |
|
137 | ||
|
137 | 138 | |
|
138 | def removeDC(self): | |
|
139 | def filterByHei(self, window): | |
|
139 | 140 | pass |
|
141 | ||
|
140 | 142 | |
|
141 | def removeSignalInt(self): | |
|
142 |
|
|
|
143 | def selectChannels(self, channelList): | |
|
144 | """ | |
|
145 | Selecciona un bloque de datos en base a canales y pares segun el channelList y el pairList | |
|
146 | ||
|
147 | Input: | |
|
148 | channelList : lista sencilla de canales a seleccionar por ej. (2,3,7) | |
|
149 | pairList : tupla de pares que se desea selecionar por ej. ( (0,1), (0,2) ) | |
|
150 | ||
|
151 | Affected: | |
|
152 | self.dataOutObj.datablock | |
|
153 | self.dataOutObj.nChannels | |
|
154 | self.dataOutObj.m_SystemHeader.numChannels | |
|
155 | self.voltageOutObj.m_ProcessingHeader.blockSize | |
|
156 | ||
|
157 | Return: | |
|
158 | None | |
|
159 | """ | |
|
160 | if not(channelList): | |
|
161 | return | |
|
162 | ||
|
163 | channels = 0 | |
|
164 | profiles = self.voltageOutObj.nProfiles | |
|
165 | heights = self.voltageOutObj.m_ProcessingHeader.numHeights | |
|
166 | ||
|
167 | #self spectra | |
|
168 | channels = len(channelList) | |
|
169 | data = numpy.zeros( (channels,profiles,heights), dtype='complex' ) | |
|
170 | for index,channel in enumerate(channelList): | |
|
171 | data[index,:,:] = self.voltageOutObj.data_spc[channel,:,:] | |
|
143 | 172 | |
|
144 | def selChannel(self): | |
|
145 |
|
|
|
173 | self.voltageOutObj.datablock = data | |
|
174 | ||
|
175 | #fill the m_ProcessingHeader.spectraComb up | |
|
176 | channels = len(channelList) | |
|
177 | ||
|
178 | self.voltageOutObj.channelList = channelList | |
|
179 | self.voltageOutObj.nChannels = nchannels | |
|
180 | self.voltageOutObj.m_ProcessingHeader.totalSpectra = nchannels | |
|
181 | self.voltageOutObj.m_SystemHeader.numChannels = nchannels | |
|
182 | self.voltageOutObj.m_ProcessingHeader.blockSize = data.size | |
|
183 | ||
|
146 | 184 | |
|
147 | def selRange(self): | |
|
148 |
|
|
|
185 | def selectHeightsByValue(self, minHei, maxHei): | |
|
186 | """ | |
|
187 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango | |
|
188 | minHei <= height <= maxHei | |
|
189 | ||
|
190 | Input: | |
|
191 | minHei : valor minimo de altura a considerar | |
|
192 | maxHei : valor maximo de altura a considerar | |
|
193 | ||
|
194 | Affected: | |
|
195 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex | |
|
196 | ||
|
197 | Return: | |
|
198 | None | |
|
199 | """ | |
|
200 | minIndex = 0 | |
|
201 | maxIndex = 0 | |
|
202 | data = self.dataOutObj.heightList | |
|
203 | ||
|
204 | for i,val in enumerate(data): | |
|
205 | if val < minHei: | |
|
206 | continue | |
|
207 | else: | |
|
208 | minIndex = i; | |
|
209 | break | |
|
210 | ||
|
211 | for i,val in enumerate(data): | |
|
212 | if val <= maxHei: | |
|
213 | maxIndex = i; | |
|
214 | else: | |
|
215 | break | |
|
216 | ||
|
217 | self.selectHeightsByIndex(minIndex, maxIndex) | |
|
218 | ||
|
219 | ||
|
220 | def selectHeightsByIndex(self, minIndex, maxIndex): | |
|
221 | """ | |
|
222 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango | |
|
223 | minIndex <= index <= maxIndex | |
|
224 | ||
|
225 | Input: | |
|
226 | minIndex : valor minimo de altura a considerar | |
|
227 | maxIndex : valor maximo de altura a considerar | |
|
228 | ||
|
229 | Affected: | |
|
230 | self.voltageOutObj.datablock | |
|
231 | self.voltageOutObj.m_ProcessingHeader.numHeights | |
|
232 | self.voltageOutObj.m_ProcessingHeader.blockSize | |
|
233 | self.voltageOutObj.heightList | |
|
234 | self.voltageOutObj.nHeights | |
|
235 | self.voltageOutObj.m_RadarControllerHeader.numHeights | |
|
236 | ||
|
237 | Return: | |
|
238 | None | |
|
239 | """ | |
|
240 | channels = self.voltageOutObj.nChannels | |
|
241 | profiles = self.voltageOutObj.nProfiles | |
|
242 | newheis = maxIndex - minIndex + 1 | |
|
243 | firstHeight = 0 | |
|
244 | ||
|
245 | #voltage | |
|
246 | data = numpy.zeros( (channels,profiles,newheis), dtype='complex' ) | |
|
247 | for i in range(channels): | |
|
248 | data[i] = self.voltageOutObj.data_spc[i,:,minIndex:maxIndex+1] | |
|
249 | ||
|
250 | self.voltageOutObj.datablock = data | |
|
251 | ||
|
252 | firstHeight = self.dataOutObj.heightList[minIndex] | |
|
253 | ||
|
254 | self.voltageOutObj.nHeights = newheis | |
|
255 | self.voltageOutObj.m_ProcessingHeader.blockSize = data.size | |
|
256 | self.voltageOutObj.m_ProcessingHeader.numHeights = newheis | |
|
257 | self.voltageOutObj.m_ProcessingHeader.firstHeight = firstHeight | |
|
258 | self.voltageOutObj.m_RadarControllerHeader = newheis | |
|
259 | ||
|
260 | xi = firstHeight | |
|
261 | step = self.voltageOutObj.m_ProcessingHeader.deltaHeight | |
|
262 | xf = xi + newheis * step | |
|
263 | self.voltageOutObj.heightList = numpy.arange(xi, xf, step) | |
|
264 | ||
|
265 | ||
|
266 | def selectProfiles(self, minIndex, maxIndex): | |
|
267 | """ | |
|
268 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango | |
|
269 | minIndex <= index <= maxIndex | |
|
270 | ||
|
271 | Input: | |
|
272 | minIndex : valor minimo de altura a considerar | |
|
273 | maxIndex : valor maximo de altura a considerar | |
|
274 | ||
|
275 | Affected: | |
|
276 | self.voltageOutObj.datablock | |
|
277 | self.voltageOutObj.m_ProcessingHeader.numHeights | |
|
278 | self.voltageOutObj.heightList | |
|
279 | ||
|
280 | Return: | |
|
281 | None | |
|
282 | """ | |
|
283 | channels = self.voltageOutObj.nChannels | |
|
284 | heights = self.voltageOutObj.m_ProcessingHeader.numHeights | |
|
285 | newprofiles = maxIndex - minIndex + 1 | |
|
286 | ||
|
287 | #voltage | |
|
288 | data = numpy.zeros( (channels,newprofiles,heights), dtype='complex' ) | |
|
289 | for i in range(channels): | |
|
290 | data[i,:,:] = self.voltageOutObj.data_spc[i,minIndex:maxIndex+1,:] | |
|
291 | ||
|
292 | self.voltageOutObj.datablock = data | |
|
293 | ||
|
294 | self.voltageOutObj.m_ProcessingHeader.blockSize = data.size | |
|
295 | self.voltageOutObj.nProfiles = newprofiles | |
|
296 | self.voltageOutObj.m_SystemHeader.numProfiles = newprofiles | |
|
297 | ||
|
149 | 298 | |
|
150 |
def sel |
|
|
299 | def selectNtxs(self, ntx): | |
|
151 | 300 | pass |
|
152 | 301 | |
|
153 | 302 |
General Comments 0
You need to be logged in to leave comments.
Login now