@@ -933,7 +933,7 class ProfileSelector(Operation): | |||||
933 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) |
|
933 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) | |
934 |
|
934 | |||
935 | """ |
|
935 | """ | |
936 |
|
936 | print "HOLA MUNDO CRUEL" | ||
937 | if rangeList is not None: |
|
937 | if rangeList is not None: | |
938 | if type(rangeList[0]) not in (tuple, list): |
|
938 | if type(rangeList[0]) not in (tuple, list): | |
939 | rangeList = [rangeList] |
|
939 | rangeList = [rangeList] | |
@@ -1357,9 +1357,11 class voltACFLags(Operation): | |||||
1357 | def setup(self,dataOut ,lags = None,mode =None, fullBuffer= None ,pairsList = None,nAvg = 1): |
|
1357 | def setup(self,dataOut ,lags = None,mode =None, fullBuffer= None ,pairsList = None,nAvg = 1): | |
1358 |
|
1358 | |||
1359 | self.lags = lags |
|
1359 | self.lags = lags | |
|
1360 | print self.lags | |||
1360 | self.mode = mode |
|
1361 | self.mode = mode | |
1361 | self.fullBuffer= fullBuffer |
|
1362 | self.fullBuffer= fullBuffer | |
1362 | self.nAvg = nAvg |
|
1363 | self.nAvg = nAvg | |
|
1364 | self.pairsList = pairsList | |||
1363 | nChannels = dataOut.nChannels |
|
1365 | nChannels = dataOut.nChannels | |
1364 | nProfiles = dataOut.nProfiles |
|
1366 | nProfiles = dataOut.nProfiles | |
1365 | nHeights = dataOut.nHeights |
|
1367 | nHeights = dataOut.nHeights | |
@@ -1374,7 +1376,7 class voltACFLags(Operation): | |||||
1374 | if pairsList == None: |
|
1376 | if pairsList == None: | |
1375 |
|
|
1377 | print "Pairs list selected by default (1,0)" | |
1376 |
|
|
1378 | pairsList = [(0,1)] | |
1377 |
|
|
1379 | self.pairsList= pairsList | |
1378 |
|
1380 | |||
1379 | if lags == None: |
|
1381 | if lags == None: | |
1380 | if mode=='time': |
|
1382 | if mode=='time': | |
@@ -1390,12 +1392,12 class voltACFLags(Operation): | |||||
1390 | elif mode =='height': |
|
1392 | elif mode =='height': | |
1391 | self.tmp = numpy.zeros(len(pairsList), (len(self.lags), nProfiles),dtype='complex') |
|
1393 | self.tmp = numpy.zeros(len(pairsList), (len(self.lags), nProfiles),dtype='complex') | |
1392 |
|
1394 | |||
1393 | print "lags", len(self.lags) |
|
1395 | print "lags", len(self.lags),self.lags | |
1394 | print "mode",self.mode |
|
1396 | print "mode",self.mode | |
1395 | print "nChannels", nChannels |
|
1397 | print "nChannels", nChannels | |
1396 | print "nProfiles", nProfiles |
|
1398 | print "nProfiles", nProfiles | |
1397 | print "nHeights" , nHeights |
|
1399 | print "nHeights" , nHeights | |
1398 | print "pairsList", pairsList |
|
1400 | print "pairsList", pairsList,len(self.pairsList) | |
1399 | print "fullBuffer", fullBuffer |
|
1401 | print "fullBuffer", fullBuffer | |
1400 | #print "type(pairsList)",type(pairsList) |
|
1402 | #print "type(pairsList)",type(pairsList) | |
1401 | print "tmp.shape",self.tmp.shape |
|
1403 | print "tmp.shape",self.tmp.shape | |
@@ -1408,18 +1410,15 class voltACFLags(Operation): | |||||
1408 | if not self.isConfig: |
|
1410 | if not self.isConfig: | |
1409 | self.setup(dataOut, lags = lags,mode = mode, fullBuffer= fullBuffer ,pairsList = pairsList,nAvg=nAvg) |
|
1411 | self.setup(dataOut, lags = lags,mode = mode, fullBuffer= fullBuffer ,pairsList = pairsList,nAvg=nAvg) | |
1410 | self.isConfig = True |
|
1412 | self.isConfig = True | |
1411 |
|
||||
1412 |
|
|
1413 | if dataOut.type == "Voltage": | |
1413 |
|
||||
1414 | data_pre = dataOut.data #data |
|
1414 | data_pre = dataOut.data #data | |
1415 |
|
1415 | print "size",data_pre.shape | ||
1416 |
|
||||
1417 |
|
|
1416 | # Here is the loop :D | |
1418 | for l in range(len(pairsList)): |
|
1417 | for l in range(len(self.pairsList)): | |
1419 |
|
|
1418 | ch0 = self.pairsList[l][0] | |
1420 |
|
|
1419 | ch1 = self.pairsList[l][1] | |
1421 |
|
||||
1422 |
|
|
1420 | for i in range(len(self.lags)): | |
|
1421 | print i,"hola dios" | |||
1423 |
|
|
1422 | idx = self.lags[i] | |
1424 |
|
|
1423 | if self.mode == 'time': | |
1425 |
|
|
1424 | acf0 = data_pre[ch0,:self.__nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) # pair,lag,height | |
@@ -1430,9 +1429,7 class voltACFLags(Operation): | |||||
1430 |
|
|
1429 | self.tmp[l,i,:acf0.shape[0],:]= acf0 | |
1431 | else: |
|
1430 | else: | |
1432 |
|
|
1431 | self.tmp[l,i,:]= numpy.sum(acf0,axis=0) | |
1433 |
|
||||
1434 | if self.fullBuffer: |
|
1432 | if self.fullBuffer: | |
1435 |
|
||||
1436 | self.tmp = numpy.sum(numpy.reshape(self.tmp,(self.tmp.shape[0],self.tmp.shape[1],self.tmp.shape[2]/self.nAvg,self.nAvg,self.tmp.shape[3])),axis=3) |
|
1433 | self.tmp = numpy.sum(numpy.reshape(self.tmp,(self.tmp.shape[0],self.tmp.shape[1],self.tmp.shape[2]/self.nAvg,self.nAvg,self.tmp.shape[3])),axis=3) | |
1437 | dataOut.nAvg = self.nAvg |
|
1434 | dataOut.nAvg = self.nAvg | |
1438 |
|
1435 | |||
@@ -1447,7 +1444,6 class voltACFLags(Operation): | |||||
1447 | for j in range(shape[2]): |
|
1444 | for j in range(shape[2]): | |
1448 | self.tmp[i,:,j]= self.tmp[i,:,j].real / numpy.max(numpy.abs(self.tmp[i,:,j])) |
|
1445 | self.tmp[i,:,j]= self.tmp[i,:,j].real / numpy.max(numpy.abs(self.tmp[i,:,j])) | |
1449 |
|
1446 | |||
1450 |
|
||||
1451 | #import matplotlib.pyplot as plt |
|
1447 | #import matplotlib.pyplot as plt | |
1452 | #print "test",self.tmp.shape |
|
1448 | #print "test",self.tmp.shape | |
1453 | #print self.tmp[0,0,0] |
|
1449 | #print self.tmp[0,0,0] |
General Comments 0
You need to be logged in to leave comments.
Login now