@@ -1363,6 +1363,7 class voltACFLags(Operation): | |||||
1363 | self.lags = lags |
|
1363 | self.lags = lags | |
1364 | print self.lags |
|
1364 | print self.lags | |
1365 | self.mode = mode |
|
1365 | self.mode = mode | |
|
1366 | self.buffer2 = [] | |||
1366 | self.fullBuffer= fullBuffer |
|
1367 | self.fullBuffer= fullBuffer | |
1367 | self.nAvg = nAvg |
|
1368 | self.nAvg = nAvg | |
1368 | self.pairsList = [pairsList] |
|
1369 | self.pairsList = [pairsList] | |
@@ -1403,7 +1404,8 class voltACFLags(Operation): | |||||
1403 | elif mode =='time': |
|
1404 | elif mode =='time': | |
1404 | self.tmp = numpy.zeros((len(self.pairsList), len(self.lags), nHeights),dtype='complex') |
|
1405 | self.tmp = numpy.zeros((len(self.pairsList), len(self.lags), nHeights),dtype='complex') | |
1405 | elif mode =='height': |
|
1406 | elif mode =='height': | |
1406 |
self.tmp = numpy.zeros((len(self.pairsList), len(self.lags), n |
|
1407 | self.tmp = numpy.zeros((len(self.pairsList), len(self.lags), nHeights),dtype='complex') | |
|
1408 | #self.tmp = numpy.zeros((len(self.pairsList), len(self.lags), nProfiles),dtype='complex') | |||
1407 |
|
1409 | |||
1408 | print "lags", len(self.lags),self.lags |
|
1410 | print "lags", len(self.lags),self.lags | |
1409 | print "mode",self.mode |
|
1411 | print "mode",self.mode | |
@@ -1438,19 +1440,50 class voltACFLags(Operation): | |||||
1438 |
|
1440 | |||
1439 | data_pre = self.buffer #data |
|
1441 | data_pre = self.buffer #data | |
1440 | for l in range(len(self.pairsList)): |
|
1442 | for l in range(len(self.pairsList)): | |
|
1443 | #print "l",l | |||
1441 | ch0 = self.pairsList[l][0] |
|
1444 | ch0 = self.pairsList[l][0] | |
1442 | ch1 = self.pairsList[l][1] |
|
1445 | ch1 = self.pairsList[l][1] | |
1443 | for i in range(len(self.lags)): |
|
1446 | #for i in range(len(self.lags)): | |
1444 |
|
|
1447 | for i in range(self.__nProfiles): | |
|
1448 | k=i%len(self.lags) | |||
|
1449 | idx = self.lags[k] | |||
|
1450 | ||||
1445 | if self.mode == 'time': |
|
1451 | if self.mode == 'time': | |
1446 | acf0 = data_pre[ch0,:self.__nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) # pair,lag,height |
|
|||
1447 | else: |
|
|||
1448 | acf0 = data_pre[ch0,:,:self.__nHeights-idx]*numpy.conj(data_pre[ch1,:,idx:]) # pair,lag,profile |
|
|||
1449 |
|
1452 | |||
1450 | if self.fullBuffer: |
|
1453 | acf0 = data_pre[ch0,:self.__nProfiles-idx,:]*numpy.conj(data_pre[ch1,idx:,:]) # pair,lag,height | |
1451 | self.tmp[l,i,:acf0.shape[0],:]= acf0 |
|
|||
1452 | else: |
|
1454 | else: | |
1453 | self.tmp[l,i,:]= numpy.sum(acf0,axis=0) |
|
1455 | #print "ESTE ES :D" | |
|
1456 | if idx==0: | |||
|
1457 | acf0 = data_pre[ch0,k,:self.__nHeis]*numpy.conj(data_pre[ch1,k,idx:]) | |||
|
1458 | #acf0 = data_pre[ch0,:,:self.__nHeis-idx]*numpy.conj(data_pre[ch1,:,idx:]) # pair,lag,profile | |||
|
1459 | else: | |||
|
1460 | #print "primera parte del array",(data_pre[ch1,k,idx:].shape) | |||
|
1461 | #print (data_pre[ch1,i+1,:]) | |||
|
1462 | #print "segunda parte del array 6 primeros",(data_pre[ch1,i+1,:idx]) | |||
|
1463 | acu=int(i/(len(self.lags)))*len(self.lags) | |||
|
1464 | #print ("acu",acu) | |||
|
1465 | if k+acu+1==self.__nProfiles: | |||
|
1466 | acu=acu-1 | |||
|
1467 | acf0 = data_pre[ch0,k+acu,:self.__nHeis]*numpy.conj(numpy.concatenate((data_pre[ch1,k+acu,idx:],data_pre[ch1,k+acu+1,:idx]), axis=0)) # pair,lag,profile | |||
|
1468 | ||||
|
1469 | #if k== len(self.lags)-1: | |||
|
1470 | self.tmp[l,k,:]= acf0 | |||
|
1471 | if k == len(self.lags)-1: | |||
|
1472 | self.buffer2.append(self.tmp) | |||
|
1473 | ||||
|
1474 | if i==self.__nProfiles-1: | |||
|
1475 | self.tmp = numpy.sum(self.buffer2,axis = 0) | |||
|
1476 | print self.tmp.shape | |||
|
1477 | self.buffer2=[] | |||
|
1478 | ||||
|
1479 | ||||
|
1480 | ||||
|
1481 | ||||
|
1482 | #if self.fullBuffer: | |||
|
1483 | # self.tmp[l,i,:acf0.shape[0],:]= acf0 | |||
|
1484 | #else: | |||
|
1485 | # #print "l",l ,"i",i ,acf0.shape | |||
|
1486 | # self.tmp[l,i,:]= numpy.sum(acf0,axis=0) | |||
1454 | if self.fullBuffer: |
|
1487 | if self.fullBuffer: | |
1455 | 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) |
|
1488 | 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) | |
1456 | dataOut.nAvg = self.nAvg |
|
1489 | dataOut.nAvg = self.nAvg |
@@ -16,8 +16,8 if __name__ == '__main__': | |||||
16 |
|
16 | |||
17 | desc = "High altitude experiment LONG " |
|
17 | desc = "High altitude experiment LONG " | |
18 | filename = "schain.xml" |
|
18 | filename = "schain.xml" | |
19 |
dpath = '/media/ |
|
19 | dpath = '/media/topside/UUI/gyro20' | |
20 |
figpath = "/media/ |
|
20 | figpath = "/media/topside/UUI/pics_long_test400" | |
21 | remotefolder = "/home/wmaster/graficos" |
|
21 | remotefolder = "/home/wmaster/graficos" | |
22 | t=['0','24'] |
|
22 | t=['0','24'] | |
23 | db_range=['15','35'] |
|
23 | db_range=['15','35'] |
@@ -16,8 +16,8 if __name__ == '__main__': | |||||
16 |
|
16 | |||
17 | desc = "High altitude experiment SHORT " |
|
17 | desc = "High altitude experiment SHORT " | |
18 | filename = "schain.xml" |
|
18 | filename = "schain.xml" | |
19 |
dpath = '/media/ |
|
19 | dpath = '/media/topside/UUI/gyro20' | |
20 |
figpath = "/media/ |
|
20 | figpath = "/media/topside/UUI/pics_short" | |
21 | remotefolder = "/home/wmaster/graficos" |
|
21 | remotefolder = "/home/wmaster/graficos" | |
22 | t=['0','24'] |
|
22 | t=['0','24'] | |
23 | db_range=['15','35'] |
|
23 | db_range=['15','35'] | |
@@ -68,7 +68,7 if __name__ == '__main__': | |||||
68 | procUnitConfObj1SPC.addParameter(name='pairsList', value='(1,0),(3,2),(5,4),(7,6)', format='pairsList') |
|
68 | procUnitConfObj1SPC.addParameter(name='pairsList', value='(1,0),(3,2),(5,4),(7,6)', format='pairsList') | |
69 |
|
69 | |||
70 | opObj11 = procUnitConfObj1SPC.addOperation(name='IncohInt', optype='other') |
|
70 | opObj11 = procUnitConfObj1SPC.addOperation(name='IncohInt', optype='other') | |
71 |
opObj11.addParameter(name='timeInterval', value=' |
|
71 | opObj11.addParameter(name='timeInterval', value='10', format='int')#600 | |
72 |
|
72 | |||
73 | procUnitConfObj2SPC = controllerObj.addProcUnit(datatype='SpectraAFCProc', inputId=procUnitConfObj1SPC.getId()) |
|
73 | procUnitConfObj2SPC = controllerObj.addProcUnit(datatype='SpectraAFCProc', inputId=procUnitConfObj1SPC.getId()) | |
74 |
|
74 | |||
@@ -115,8 +115,8 if __name__ == '__main__': | |||||
115 | #opObj11.addParameter(name='zmax', value=-0.5, format='int') |
|
115 | #opObj11.addParameter(name='zmax', value=-0.5, format='int') | |
116 | #opObj11.addParameter(name='ymin', value='0', format='int') |
|
116 | #opObj11.addParameter(name='ymin', value='0', format='int') | |
117 | #opObj11.addParameter(name='ymax', value='0.5', format='int') |
|
117 | #opObj11.addParameter(name='ymax', value='0.5', format='int') | |
118 |
|
|
118 | opObj11.addParameter(name='xmin', value='0', format='int') | |
119 |
|
|
119 | opObj11.addParameter(name='xmax', value='1.2', format='int') | |
120 | opObj11.addParameter(name='show', value='1', format='int') |
|
120 | opObj11.addParameter(name='show', value='1', format='int') | |
121 | opObj11.addParameter(name='save', value='1', format='int') |
|
121 | opObj11.addParameter(name='save', value='1', format='int') | |
122 | opObj11.addParameter(name='figpath', value=figpath) |
|
122 | opObj11.addParameter(name='figpath', value=figpath) |
General Comments 0
You need to be logged in to leave comments.
Login now