@@ -556,7 +556,10 class Project(Process): | |||
|
556 | 556 | conf = self.configurations[key] |
|
557 | 557 | conf.createObjects() |
|
558 | 558 | if conf.inputId is not None: |
|
559 | conf.object.setInput(self.configurations[conf.inputId].object) | |
|
559 | if isinstance(conf.inputId, list): | |
|
560 | conf.object.setInput([self.configurations[x].object for x in conf.inputId]) | |
|
561 | else: | |
|
562 | conf.object.setInput([self.configurations[conf.inputId].object]) | |
|
560 | 563 | |
|
561 | 564 | def monitor(self): |
|
562 | 565 |
|
1 | NO CONTENT: modified file |
@@ -29,10 +29,19 class ProcessingUnit(object): | |||
|
29 | 29 | self.dataOut = None |
|
30 | 30 | self.isConfig = False |
|
31 | 31 | self.operations = [] |
|
32 | self.name = 'Test' | |
|
33 | self.inputs = [] | |
|
32 | 34 | |
|
33 | 35 | def setInput(self, unit): |
|
34 | 36 | |
|
35 | self.dataIn = unit.dataOut | |
|
37 | attr = 'dataIn' | |
|
38 | for i, u in enumerate(unit): | |
|
39 | if i==0: | |
|
40 | self.dataIn = u.dataOut | |
|
41 | self.inputs.append('dataIn') | |
|
42 | else: | |
|
43 | setattr(self, 'dataIn{}'.format(i), u.dataOut) | |
|
44 | self.inputs.append('dataIn{}'.format(i)) | |
|
36 | 45 | |
|
37 | 46 | def getAllowedArgs(self): |
|
38 | 47 | if hasattr(self, '__attrs__'): |
@@ -86,7 +95,16 class ProcessingUnit(object): | |||
|
86 | 95 | #op.queue.put(self.dataOut) |
|
87 | 96 | op.queue.put(aux) |
|
88 | 97 | |
|
89 | return 'Error' if self.dataOut.error else self.dataOut.isReady() | |
|
98 | try: | |
|
99 | if self.dataOut.runNextUnit: | |
|
100 | runNextUnit = self.dataOut.runNextUnit | |
|
101 | ||
|
102 | else: | |
|
103 | runNextUnit = self.dataOut.isReady() | |
|
104 | except: | |
|
105 | runNextUnit = self.dataOut.isReady() | |
|
106 | ||
|
107 | return 'Error' if self.dataOut.error else runNextUnit | |
|
90 | 108 | |
|
91 | 109 | def setup(self): |
|
92 | 110 |
@@ -104,10 +104,11 class ParametersProc(ProcessingUnit): | |||
|
104 | 104 | self.dataOut.heightList = self.dataIn.heightList |
|
105 | 105 | self.dataOut.frequency = self.dataIn.frequency |
|
106 | 106 | # self.dataOut.noise = self.dataIn.noise |
|
107 | self.dataOut.runNextUnit = self.dataIn.runNextUnit | |
|
107 | 108 | |
|
108 | def run(self): | |
|
109 | ||
|
109 | def run(self, runNextUnit = 0): | |
|
110 | 110 | |
|
111 | self.dataIn.runNextUnit = runNextUnit | |
|
111 | 112 | #print("HOLA MUNDO SOY YO") |
|
112 | 113 | #---------------------- Voltage Data --------------------------- |
|
113 | 114 | |
@@ -4908,7 +4909,7 class Block360_vRF4(Operation): | |||
|
4908 | 4909 | data_e = None |
|
4909 | 4910 | |
|
4910 | 4911 | angles = self.putData(data=dataOut, attr = self.attr, flagMode=flagMode) |
|
4911 | ||
|
4912 | #print(angles) | |
|
4912 | 4913 | if self.__profIndex > 1: |
|
4913 | 4914 | case_flag = self.checkcase(angles,flagMode) |
|
4914 | 4915 | |
@@ -4995,5 +4996,93 class Block360_vRF4(Operation): | |||
|
4995 | 4996 | dataOut.data_ele = data_e |
|
4996 | 4997 | dataOut.utctime = avgdatatime |
|
4997 | 4998 | dataOut.flagNoData = False |
|
4999 | #print(data_360.shape) | |
|
5000 | #print(dataOut.heightList) | |
|
4998 | 5001 | |
|
4999 | 5002 | return dataOut |
|
5003 | ||
|
5004 | class MergeProc(ProcessingUnit): | |
|
5005 | ||
|
5006 | def __init__(self): | |
|
5007 | ProcessingUnit.__init__(self) | |
|
5008 | ||
|
5009 | def run(self, attr_data, mode=0): | |
|
5010 | ||
|
5011 | #exit(1) | |
|
5012 | self.dataOut = getattr(self, self.inputs[0]) | |
|
5013 | data_inputs = [getattr(self, attr) for attr in self.inputs] | |
|
5014 | #print(data_inputs) | |
|
5015 | #print(numpy.shape([getattr(data, attr_data) for data in data_inputs][1])) | |
|
5016 | #exit(1) | |
|
5017 | if mode==0: | |
|
5018 | data = numpy.concatenate([getattr(data, attr_data) for data in data_inputs]) | |
|
5019 | setattr(self.dataOut, attr_data, data) | |
|
5020 | ||
|
5021 | if mode==1: #Hybrid | |
|
5022 | #data = numpy.concatenate([getattr(data, attr_data) for data in data_inputs],axis=1) | |
|
5023 | #setattr(self.dataOut, attr_data, data) | |
|
5024 | setattr(self.dataOut, 'dataLag_spc', [getattr(data, attr_data) for data in data_inputs][0]) | |
|
5025 | setattr(self.dataOut, 'dataLag_spc_LP', [getattr(data, attr_data) for data in data_inputs][1]) | |
|
5026 | setattr(self.dataOut, 'dataLag_cspc', [getattr(data, attr_data_2) for data in data_inputs][0]) | |
|
5027 | setattr(self.dataOut, 'dataLag_cspc_LP', [getattr(data, attr_data_2) for data in data_inputs][1]) | |
|
5028 | #setattr(self.dataOut, 'nIncohInt', [getattr(data, attr_data_3) for data in data_inputs][0]) | |
|
5029 | #setattr(self.dataOut, 'nIncohInt_LP', [getattr(data, attr_data_3) for data in data_inputs][1]) | |
|
5030 | ''' | |
|
5031 | print(self.dataOut.dataLag_spc_LP.shape) | |
|
5032 | print(self.dataOut.dataLag_cspc_LP.shape) | |
|
5033 | exit(1) | |
|
5034 | ''' | |
|
5035 | ||
|
5036 | #self.dataOut.dataLag_spc_LP = numpy.transpose(self.dataOut.dataLag_spc_LP[0],(2,0,1)) | |
|
5037 | #self.dataOut.dataLag_cspc_LP = numpy.transpose(self.dataOut.dataLag_cspc_LP,(3,1,2,0)) | |
|
5038 | ''' | |
|
5039 | print("Merge") | |
|
5040 | print(numpy.shape(self.dataOut.dataLag_spc)) | |
|
5041 | print(numpy.shape(self.dataOut.dataLag_spc_LP)) | |
|
5042 | print(numpy.shape(self.dataOut.dataLag_cspc)) | |
|
5043 | print(numpy.shape(self.dataOut.dataLag_cspc_LP)) | |
|
5044 | exit(1) | |
|
5045 | ''' | |
|
5046 | #print(numpy.sum(self.dataOut.dataLag_spc_LP[2,:,164])/128) | |
|
5047 | #print(numpy.sum(self.dataOut.dataLag_cspc_LP[0,:,30,1])/128) | |
|
5048 | #exit(1) | |
|
5049 | #print(self.dataOut.NDP) | |
|
5050 | #print(self.dataOut.nNoiseProfiles) | |
|
5051 | ||
|
5052 | #self.dataOut.nIncohInt_LP = 128 | |
|
5053 | self.dataOut.nProfiles_LP = 128#self.dataOut.nIncohInt_LP | |
|
5054 | self.dataOut.nIncohInt_LP = self.dataOut.nIncohInt | |
|
5055 | self.dataOut.NLAG = 16 | |
|
5056 | self.dataOut.NRANGE = 200 | |
|
5057 | self.dataOut.NSCAN = 128 | |
|
5058 | #print(numpy.shape(self.dataOut.data_spc)) | |
|
5059 | ||
|
5060 | #exit(1) | |
|
5061 | ||
|
5062 | if mode==2: #HAE 2022 | |
|
5063 | data = numpy.sum([getattr(data, attr_data) for data in data_inputs],axis=0) | |
|
5064 | setattr(self.dataOut, attr_data, data) | |
|
5065 | ||
|
5066 | self.dataOut.nIncohInt *= 2 | |
|
5067 | #meta = self.dataOut.getFreqRange(1)/1000. | |
|
5068 | self.dataOut.freqRange = self.dataOut.getFreqRange(1)/1000. | |
|
5069 | ||
|
5070 | #exit(1) | |
|
5071 | ||
|
5072 | if mode==7: #RM | |
|
5073 | ||
|
5074 | f = [getattr(data, attr_data) for data in data_inputs][0] | |
|
5075 | g = [getattr(data, attr_data) for data in data_inputs][1] | |
|
5076 | ||
|
5077 | data = numpy.concatenate((f,g),axis=2) | |
|
5078 | #print(data) | |
|
5079 | setattr(self.dataOut, attr_data, data) | |
|
5080 | #print(self.dataOut.dataPP_POWER.shape) | |
|
5081 | #CONSTRUIR NUEVA ALTURAS | |
|
5082 | #print("hei_merge",self.dataOut.heightList) | |
|
5083 | dh = self.dataOut.heightList[1]-self.dataOut.heightList[0] | |
|
5084 | heightList_2 = (self.dataOut.heightList[-1]+dh) + numpy.arange(g.shape[-1], dtype=numpy.float) * dh | |
|
5085 | ||
|
5086 | self.dataOut.heightList = numpy.concatenate((self.dataOut.heightList,heightList_2)) | |
|
5087 | #print("hei_merge_total",self.dataOut.heightList) | |
|
5088 | #exit(1) |
@@ -954,7 +954,7 class ProfileSelector(Operation): | |||
|
954 | 954 | return True |
|
955 | 955 | |
|
956 | 956 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None, nProfiles=None): |
|
957 | ||
|
957 | #print("before",dataOut.data.shape) | |
|
958 | 958 | """ |
|
959 | 959 | ProfileSelector: |
|
960 | 960 | |
@@ -1002,7 +1002,7 class ProfileSelector(Operation): | |||
|
1002 | 1002 | dataOut.nProfiles = len(profileList) |
|
1003 | 1003 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
1004 | 1004 | dataOut.flagNoData = False |
|
1005 | ||
|
1005 | #print(dataOut.data.shape) | |
|
1006 | 1006 | return dataOut |
|
1007 | 1007 | |
|
1008 | 1008 | """ |
@@ -1694,12 +1694,10 class PulsePair_vRF(Operation): | |||
|
1694 | 1694 | return data_power, data_intensity, data_velocity, data_snrPP,data_specwidth,data_ccf, avgdatatime |
|
1695 | 1695 | |
|
1696 | 1696 | def run(self, dataOut,n = None,removeDC= False, overlapping= False,**kwargs): |
|
1697 | #print("hey") | |
|
1698 | #print(dataOut.data.shape) | |
|
1699 | #exit(1) | |
|
1697 | ||
|
1700 | 1698 | if dataOut.flagDataAsBlock: |
|
1701 |
n = dataOut.nProfile |
|
|
1702 | #print(self.__profIndex) | |
|
1699 | n = dataOut.nProfiles | |
|
1700 | ||
|
1703 | 1701 | if not self.isConfig: |
|
1704 | 1702 | self.setup(dataOut = dataOut, n = n , removeDC=removeDC , **kwargs) |
|
1705 | 1703 | self.isConfig = True |
General Comments 0
You need to be logged in to leave comments.
Login now