@@ -37,13 +37,12 class VoltageProcessor: | |||||
37 | plotterObjList = [] |
|
37 | plotterObjList = [] | |
38 | m_Voltage= Voltage() |
|
38 | m_Voltage= Voltage() | |
39 |
|
39 | |||
40 | m_ProfileSelector= ProfileSelector() |
|
40 | m_ProfileSelector = ProfileSelector() | |
41 |
|
41 | |||
42 | m_Decoder= Decoder() |
|
42 | m_Decoder = Decoder() | |
43 |
|
43 | |||
44 | m_CoherentIntegrator= CoherentIntegrator() |
|
44 | m_CoherentIntegrator = CoherentIntegrator() | |
45 |
|
45 | |||
46 |
|
||||
47 | def __init__(self, dataInObj, dataOutObj=None): |
|
46 | def __init__(self, dataInObj, dataOutObj=None): | |
48 | ''' |
|
47 | ''' | |
49 | Constructor |
|
48 | Constructor | |
@@ -205,7 +204,7 class VoltageProcessor: | |||||
205 |
|
204 | |||
206 | def selectChannels(self, channelList): |
|
205 | def selectChannels(self, channelList): | |
207 | """ |
|
206 | """ | |
208 |
Selecciona un bloque de datos en base a canales |
|
207 | Selecciona un bloque de datos en base a canales segun el channelList | |
209 |
|
208 | |||
210 | Input: |
|
209 | Input: | |
211 | channelList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
210 | channelList : lista sencilla de canales a seleccionar por ej. [2,3,7] | |
@@ -228,19 +227,16 class VoltageProcessor: | |||||
228 | if channel not in self.dataOutObj.channelList: |
|
227 | if channel not in self.dataOutObj.channelList: | |
229 | raise ValueError, "The value %d in channelList is not valid" %channel |
|
228 | raise ValueError, "The value %d in channelList is not valid" %channel | |
230 |
|
229 | |||
231 |
n |
|
230 | nChannels = len(channelList) | |
232 | profiles = self.dataOutObj.nProfiles |
|
231 | ||
233 | heights = self.dataOutObj.nHeights #m_ProcessingHeader.numHeights |
|
232 | data = self.dataOutObj.data[channelList,:] | |
234 |
|
233 | |||
235 | data = numpy.zeros( (nchannels,heights), dtype='complex' ) |
|
|||
236 | for index,channel in enumerate(channelList): |
|
|||
237 | data[index,:] = self.dataOutObj.data[channel,:] |
|
|||
238 |
|
||||
239 | self.dataOutObj.data = data |
|
234 | self.dataOutObj.data = data | |
240 | self.dataOutObj.channelList = channelList |
|
235 | self.dataOutObj.channelList = channelList | |
241 |
self.dataOutObj.nChannels = n |
|
236 | self.dataOutObj.nChannels = nChannels | |
242 | self.dataOutObj.m_ProcessingHeader.totalSpectra = nchannels |
|
237 | ||
243 |
self.dataOutObj.m_ |
|
238 | self.dataOutObj.m_ProcessingHeader.totalSpectra = nChannels | |
|
239 | self.dataOutObj.m_SystemHeader.numChannels = nChannels | |||
244 | self.dataOutObj.m_ProcessingHeader.blockSize = data.size |
|
240 | self.dataOutObj.m_ProcessingHeader.blockSize = data.size | |
245 | return 1 |
|
241 | return 1 | |
246 |
|
242 | |||
@@ -321,7 +317,6 class VoltageProcessor: | |||||
321 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
317 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
322 |
|
318 | |||
323 | nHeights = maxIndex - minIndex + 1 |
|
319 | nHeights = maxIndex - minIndex + 1 | |
324 | firstHeight = 0 |
|
|||
325 |
|
320 | |||
326 | #voltage |
|
321 | #voltage | |
327 | data = self.dataOutObj.data[:,minIndex:maxIndex+1] |
|
322 | data = self.dataOutObj.data[:,minIndex:maxIndex+1] | |
@@ -401,13 +396,11 class Decoder: | |||||
401 |
|
396 | |||
402 | data = None |
|
397 | data = None | |
403 | profCounter = 1 |
|
398 | profCounter = 1 | |
404 |
nCode = n |
|
399 | nCode = None | |
405 |
nBaud = |
|
400 | nBaud = None | |
406 | codeIndex = 0 |
|
401 | codeIndex = 0 | |
407 | code = code #this is a List |
|
402 | code = None | |
408 | fft_code = None |
|
|||
409 | flag = False |
|
403 | flag = False | |
410 | setCodeFft = False |
|
|||
411 |
|
404 | |||
412 | def __init__(self,code, ncode, nbaud): |
|
405 | def __init__(self,code, ncode, nbaud): | |
413 |
|
406 | |||
@@ -417,9 +410,7 class Decoder: | |||||
417 | self.nBaud = nbaud |
|
410 | self.nBaud = nbaud | |
418 | self.codeIndex = 0 |
|
411 | self.codeIndex = 0 | |
419 | self.code = code #this is a List |
|
412 | self.code = code #this is a List | |
420 | self.fft_code = None |
|
|||
421 | self.flag = False |
|
413 | self.flag = False | |
422 | self.setCodeFft = False |
|
|||
423 |
|
414 | |||
424 | def exe(self, data, ndata=None, type = 0): |
|
415 | def exe(self, data, ndata=None, type = 0): | |
425 |
|
416 | |||
@@ -445,9 +436,7 class Decoder: | |||||
445 | conv = fft_data.copy() |
|
436 | conv = fft_data.copy() | |
446 | conv.fill(0) |
|
437 | conv.fill(0) | |
447 |
|
438 | |||
448 | conv = fft_data*fft_code # This other way to calculate multiplication between bidimensional arrays |
|
439 | conv = fft_data*fft_code | |
449 | # for i in range(ndata): |
|
|||
450 | # conv[i,:] = fft_data[i,:]*fft_code[i] |
|
|||
451 |
|
440 | |||
452 | self.data = numpy.fft.ifft(conv,axis=1) |
|
441 | self.data = numpy.fft.ifft(conv,axis=1) | |
453 | self.flag = True |
|
442 | self.flag = True | |
@@ -483,7 +472,7 class CoherentIntegrator: | |||||
483 | data = None |
|
472 | data = None | |
484 | buffer = None |
|
473 | buffer = None | |
485 | flag = False |
|
474 | flag = False | |
486 | nCohInt = N |
|
475 | nCohInt = None | |
487 |
|
476 | |||
488 | def __init__(self, N): |
|
477 | def __init__(self, N): | |
489 |
|
478 |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now