@@ -556,7 +556,10 class Project(Process): | |||||
556 | conf = self.configurations[key] |
|
556 | conf = self.configurations[key] | |
557 | conf.createObjects() |
|
557 | conf.createObjects() | |
558 | if conf.inputId is not None: |
|
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 | def monitor(self): |
|
564 | def monitor(self): | |
562 |
|
565 |
@@ -1198,9 +1198,9 class Weather_vRF_Plot(Plot): | |||||
1198 | else: |
|
1198 | else: | |
1199 | ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max)) |
|
1199 | ax.set_xlim(numpy.radians(self.ang_min),numpy.radians(self.ang_max)) | |
1200 | ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax) |
|
1200 | ax.plt = ax.pcolormesh(theta, r, z, cmap=self.colormap, vmin=self.zmin, vmax=self.zmax) | |
1201 |
|
1201 | |||
1202 | ax.grid(True) |
|
1202 | ax.grid(True) | |
1203 |
|
1203 | |||
1204 | if len(self.channels) !=1: |
|
1204 | if len(self.channels) !=1: | |
1205 | self.titles = ['PPI {} at EL: {} Channel {}'.format(self.self.labels[x], str(round(numpy.mean(data['ele']),1)), x) for x in range(self.nrows)] |
|
1205 | self.titles = ['PPI {} at EL: {} Channel {}'.format(self.self.labels[x], str(round(numpy.mean(data['ele']),1)), x) for x in range(self.nrows)] | |
1206 | else: |
|
1206 | else: |
@@ -29,10 +29,19 class ProcessingUnit(object): | |||||
29 | self.dataOut = None |
|
29 | self.dataOut = None | |
30 | self.isConfig = False |
|
30 | self.isConfig = False | |
31 | self.operations = [] |
|
31 | self.operations = [] | |
|
32 | self.name = 'Test' | |||
|
33 | self.inputs = [] | |||
32 |
|
34 | |||
33 | def setInput(self, unit): |
|
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 | def getAllowedArgs(self): |
|
46 | def getAllowedArgs(self): | |
38 | if hasattr(self, '__attrs__'): |
|
47 | if hasattr(self, '__attrs__'): | |
@@ -86,7 +95,16 class ProcessingUnit(object): | |||||
86 | #op.queue.put(self.dataOut) |
|
95 | #op.queue.put(self.dataOut) | |
87 | op.queue.put(aux) |
|
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 | def setup(self): |
|
109 | def setup(self): | |
92 |
|
110 |
@@ -104,10 +104,11 class ParametersProc(ProcessingUnit): | |||||
104 | self.dataOut.heightList = self.dataIn.heightList |
|
104 | self.dataOut.heightList = self.dataIn.heightList | |
105 | self.dataOut.frequency = self.dataIn.frequency |
|
105 | self.dataOut.frequency = self.dataIn.frequency | |
106 | # self.dataOut.noise = self.dataIn.noise |
|
106 | # self.dataOut.noise = self.dataIn.noise | |
|
107 | self.dataOut.runNextUnit = self.dataIn.runNextUnit | |||
107 |
|
108 | |||
108 | def run(self): |
|
109 | def run(self, runNextUnit = 0): | |
109 |
|
||||
110 |
|
110 | |||
|
111 | self.dataIn.runNextUnit = runNextUnit | |||
111 | #print("HOLA MUNDO SOY YO") |
|
112 | #print("HOLA MUNDO SOY YO") | |
112 | #---------------------- Voltage Data --------------------------- |
|
113 | #---------------------- Voltage Data --------------------------- | |
113 |
|
114 | |||
@@ -4080,7 +4081,7 class PedestalInformation(Operation): | |||||
4080 | dt = datetime.datetime.utcfromtimestamp(self.utctime) |
|
4081 | dt = datetime.datetime.utcfromtimestamp(self.utctime) | |
4081 | path = os.path.join(self.path, dt.strftime('%Y-%m-%dT%H-00-00')) |
|
4082 | path = os.path.join(self.path, dt.strftime('%Y-%m-%dT%H-00-00')) | |
4082 | self.filename = os.path.join(path, 'pos@{}.000.h5'.format(int(self.utcfile))) |
|
4083 | self.filename = os.path.join(path, 'pos@{}.000.h5'.format(int(self.utcfile))) | |
4083 |
|
4084 | |||
4084 | for n in range(self.nTries): |
|
4085 | for n in range(self.nTries): | |
4085 | ok = False |
|
4086 | ok = False | |
4086 | try: |
|
4087 | try: | |
@@ -4097,7 +4098,7 class PedestalInformation(Operation): | |||||
4097 | log.warning('Waiting {}s for position file to be ready...'.format(self.delay), self.name) |
|
4098 | log.warning('Waiting {}s for position file to be ready...'.format(self.delay), self.name) | |
4098 | time.sleep(self.delay) |
|
4099 | time.sleep(self.delay) | |
4099 | continue |
|
4100 | continue | |
4100 |
|
4101 | |||
4101 | if not ok: |
|
4102 | if not ok: | |
4102 | log.error('No new position files found in {}'.format(path)) |
|
4103 | log.error('No new position files found in {}'.format(path)) | |
4103 | raise IOError('No new position files found in {}'.format(path)) |
|
4104 | raise IOError('No new position files found in {}'.format(path)) | |
@@ -4908,7 +4909,7 class Block360_vRF4(Operation): | |||||
4908 | data_e = None |
|
4909 | data_e = None | |
4909 |
|
4910 | |||
4910 | angles = self.putData(data=dataOut, attr = self.attr, flagMode=flagMode) |
|
4911 | angles = self.putData(data=dataOut, attr = self.attr, flagMode=flagMode) | |
4911 |
|
4912 | #print(angles) | ||
4912 | if self.__profIndex > 1: |
|
4913 | if self.__profIndex > 1: | |
4913 | case_flag = self.checkcase(angles,flagMode) |
|
4914 | case_flag = self.checkcase(angles,flagMode) | |
4914 |
|
4915 | |||
@@ -4995,5 +4996,93 class Block360_vRF4(Operation): | |||||
4995 | dataOut.data_ele = data_e |
|
4996 | dataOut.data_ele = data_e | |
4996 | dataOut.utctime = avgdatatime |
|
4997 | dataOut.utctime = avgdatatime | |
4997 | dataOut.flagNoData = False |
|
4998 | dataOut.flagNoData = False | |
|
4999 | #print(data_360.shape) | |||
|
5000 | #print(dataOut.heightList) | |||
4998 |
|
5001 | |||
4999 | return dataOut |
|
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 | return True |
|
954 | return True | |
955 |
|
955 | |||
956 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None, nProfiles=None): |
|
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 | ProfileSelector: |
|
959 | ProfileSelector: | |
960 |
|
960 | |||
@@ -1002,7 +1002,7 class ProfileSelector(Operation): | |||||
1002 | dataOut.nProfiles = len(profileList) |
|
1002 | dataOut.nProfiles = len(profileList) | |
1003 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
1003 | dataOut.profileIndex = dataOut.nProfiles - 1 | |
1004 | dataOut.flagNoData = False |
|
1004 | dataOut.flagNoData = False | |
1005 |
|
1005 | #print(dataOut.data.shape) | ||
1006 | return dataOut |
|
1006 | return dataOut | |
1007 |
|
1007 | |||
1008 | """ |
|
1008 | """ | |
@@ -1694,12 +1694,10 class PulsePair_vRF(Operation): | |||||
1694 | return data_power, data_intensity, data_velocity, data_snrPP,data_specwidth,data_ccf, avgdatatime |
|
1694 | return data_power, data_intensity, data_velocity, data_snrPP,data_specwidth,data_ccf, avgdatatime | |
1695 |
|
1695 | |||
1696 | def run(self, dataOut,n = None,removeDC= False, overlapping= False,**kwargs): |
|
1696 | def run(self, dataOut,n = None,removeDC= False, overlapping= False,**kwargs): | |
1697 | #print("hey") |
|
1697 | ||
1698 | #print(dataOut.data.shape) |
|
|||
1699 | #exit(1) |
|
|||
1700 | if dataOut.flagDataAsBlock: |
|
1698 | if dataOut.flagDataAsBlock: | |
1701 |
n = dataOut.nProfile |
|
1699 | n = dataOut.nProfiles | |
1702 | #print(self.__profIndex) |
|
1700 | ||
1703 | if not self.isConfig: |
|
1701 | if not self.isConfig: | |
1704 | self.setup(dataOut = dataOut, n = n , removeDC=removeDC , **kwargs) |
|
1702 | self.setup(dataOut = dataOut, n = n , removeDC=removeDC , **kwargs) | |
1705 | self.isConfig = True |
|
1703 | self.isConfig = True |
General Comments 0
You need to be logged in to leave comments.
Login now