@@ -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 | |
@@ -1372,16 +1374,16 class voltACFLags(Operation): | |||||
1372 | print "Mode lags equal height." |
|
1374 | print "Mode lags equal height." | |
1373 |
|
1375 | |||
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': | |
1381 | self.lags = numpy.arange(0,nProfiles)# -nProfiles+1, nProfiles |
|
1383 | self.lags = numpy.arange(0,nProfiles)# -nProfiles+1, nProfiles | |
1382 |
|
|
1384 | print "self.lags", len(self.lags) | |
1383 | if mode=='height': |
|
1385 | if mode=='height': | |
1384 | self.lags = numpy.arange(0,nHeights)# -nHeights+1, nHeights |
|
1386 | self.lags = numpy.arange(0,nHeights)# -nHeights+1, nHeights | |
1385 |
|
1387 | |||
1386 | if fullBuffer: |
|
1388 | if fullBuffer: | |
1387 | self.tmp = numpy.zeros((len(pairsList), len(self.lags), nProfiles, nHeights), dtype = 'complex')*numpy.nan |
|
1389 | self.tmp = numpy.zeros((len(pairsList), len(self.lags), nProfiles, nHeights), dtype = 'complex')*numpy.nan | |
@@ -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 | |
@@ -1403,36 +1405,31 class voltACFLags(Operation): | |||||
1403 |
|
1405 | |||
1404 | def run(self, dataOut, lags =None,mode ='time',fullBuffer= False ,pairsList = None,nAvg = 1): |
|
1406 | def run(self, dataOut, lags =None,mode ='time',fullBuffer= False ,pairsList = None,nAvg = 1): | |
1405 |
|
1407 | |||
1406 |
|
|
1408 | dataOut.flagNoData = True | |
1407 |
|
1409 | |||
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 |
|
1413 | if dataOut.type == "Voltage": | ||
1412 | 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 |
|
1416 | # Here is the loop :D | ||
1417 | # Here is the loop :D |
|
1417 | for l in range(len(self.pairsList)): | |
1418 | for l in range(len(pairsList)): |
|
1418 | ch0 = self.pairsList[l][0] | |
1419 |
|
|
1419 | ch1 = self.pairsList[l][1] | |
1420 | ch1 = pairsList[l][1] |
|
1420 | for i in range(len(self.lags)): | |
1421 |
|
1421 | print i,"hola dios" | ||
1422 | for i in range(len(self.lags)): |
|
1422 | idx = self.lags[i] | |
1423 | idx = self.lags[i] |
|
1423 | if self.mode == 'time': | |
1424 | if self.mode == 'time': |
|
1424 | acf0 = data_pre[ch0,:self.__nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) # pair,lag,height | |
1425 | acf0 = data_pre[ch0,:self.__nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) # pair,lag,height |
|
1425 | else: | |
1426 | else: |
|
1426 | acf0 = data_pre[ch0,:,:self.__nHeights-idx]*numpy.conj(data_pre[ch1,:,idx:]) # pair,lag,profile | |
1427 | acf0 = data_pre[ch0,:,:self.__nHeights-idx]*numpy.conj(data_pre[ch1,:,idx:]) # pair,lag,profile |
|
1427 | ||
1428 |
|
1428 | if self.fullBuffer: | ||
1429 | if self.fullBuffer: |
|
1429 | self.tmp[l,i,:acf0.shape[0],:]= acf0 | |
1430 | self.tmp[l,i,:acf0.shape[0],:]= acf0 |
|
1430 | else: | |
1431 | else: |
|
1431 | self.tmp[l,i,:]= numpy.sum(acf0,axis=0) | |
1432 | 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] | |
@@ -1467,7 +1463,7 class voltACFLags(Operation): | |||||
1467 | dataOut.nPairs = len(pairsList) |
|
1463 | dataOut.nPairs = len(pairsList) | |
1468 | dataOut.lagRange = numpy.array(self.lags)*delta |
|
1464 | dataOut.lagRange = numpy.array(self.lags)*delta | |
1469 | dataOut.flagDataAsBlock = True |
|
1465 | dataOut.flagDataAsBlock = True | |
1470 |
|
|
1466 | dataOut.flagNoData = False | |
1471 |
|
1467 | |||
1472 | import time |
|
1468 | import time | |
1473 | ################################################# |
|
1469 | ################################################# |
General Comments 0
You need to be logged in to leave comments.
Login now