@@ -3,16 +3,32 import os | |||||
3 | #import imageio |
|
3 | #import imageio | |
4 | import imageio.v2 as imageio |
|
4 | import imageio.v2 as imageio | |
5 | # Ubicación de la base de datos |
|
5 | # Ubicación de la base de datos | |
|
6 | ''' | |||
6 |
|
|
7 | #path = '/home/soporte/Downloads/plots_C0/S/6/6_evento0/' | |
7 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R60.0km/V_PPI_EL_8.0CH0/' |
|
8 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R60.0km/V_PPI_EL_8.0CH0/' | |
8 |
|
||||
9 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-05-31T12-00-17/plotsC0_PL_R60.0km_removeDC/V_PPI_EL_8.0CH0/' |
|
9 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-05-31T12-00-17/plotsC0_PL_R60.0km_removeDC/V_PPI_EL_8.0CH0/' | |
10 |
|
||||
11 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R15.0km_removeDC/Z_PPI_EL_2.0CH0/' |
|
10 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R15.0km_removeDC/Z_PPI_EL_2.0CH0/' | |
12 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R15.0km/Z_PPI_EL_8.0CH0/' |
|
11 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R15.0km/Z_PPI_EL_8.0CH0/' | |
13 |
|
||||
14 |
|
||||
15 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/W_E.2CH0/' |
|
12 | path= '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/W_E.2CH0/' | |
|
13 | ''' | |||
|
14 | #-------------------------------------------------------------------------------------------------------- | |||
|
15 | #pulse pair | |||
|
16 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R28.0km/Z_PPI_EL_2.0CH0/' | |||
|
17 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R28.0km/W_PPI_WE_L8.0CH0/' | |||
|
18 | #--------------------------------------------------------------------------------------------------------- | |||
|
19 | #pulse pair REMOVEDC | |||
|
20 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R28.0km_removeDC/V_PPI_EL_2.0CH0/' | |||
|
21 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_PL_R28.0km_removeDC/W_PPI_WE_L8.0CH0/' | |||
|
22 | #---------------------------------------------------------------------------------------------------------- | |||
|
23 | #Spectro | |||
|
24 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R28.0km/V_PPI_EL_2.0CH0/' | |||
|
25 | path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R28.0km/W_PPI_WE_L8.0CH0/' | |||
|
26 | ||||
|
27 | #--------------------------------------------------------------------------------------------------------- | |||
|
28 | #Spectro REMOVEDC | |||
|
29 | path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R28.0km_removeDC/V_PPI_EL_8.0CH0/' | |||
|
30 | #path = '/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/plotsC0_FD_PL_R28.0km_removeDC/W_PPI_WE_L2.0CH0/' | |||
|
31 | ||||
16 |
|
32 | |||
17 |
|
33 | |||
18 | archivos = sorted(os.listdir(path)) |
|
34 | archivos = sorted(os.listdir(path)) | |
@@ -30,4 +46,6 for x in range(0, len(archivos)): | |||||
30 | img_array.append(leer_imagen) |
|
46 | img_array.append(leer_imagen) | |
31 |
|
47 | |||
32 | #Guardar Gif |
|
48 | #Guardar Gif | |
33 |
imageio.mimwrite('evento_PL_PP_ |
|
49 | #imageio.mimwrite('/home/soporte/Documents/giff_28km/evento_PL_PP_8_28KM_W', img_array, 'GIF', duration=0.5) | |
|
50 | #imageio.mimwrite('/home/soporte/Documents/giff_28km/evento_PL_PP_8_28KM_W_reDC', img_array, 'GIF', duration=0.5) | |||
|
51 | imageio.mimwrite('/home/soporte/Documents/giff_28kmFD/evento_PL_FD_8_28KM_V_reDC', img_array, 'GIF', duration=0.5) |
@@ -16,7 +16,7 PARAM = { | |||||
16 | 'P': {'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, |
|
16 | 'P': {'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, | |
17 | 'D': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, |
|
17 | 'D': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, | |
18 | 'Z': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity ', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':0}, |
|
18 | 'Z': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity ', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':0}, | |
19 |
'W': {'zmin': 0, 'zmax': 15, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': ' |
|
19 | 'W': {'zmin': 0, 'zmax': 15, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': 'm/s', 'ch':0} | |
20 | } |
|
20 | } | |
21 |
|
21 | |||
22 | def max_index(r, sample_rate, ipp): |
|
22 | def max_index(r, sample_rate, ipp): | |
@@ -372,4 +372,4 if __name__ == '__main__': | |||||
372 |
|
372 | |||
373 | main(args) |
|
373 | main(args) | |
374 |
|
374 | |||
375 | # python sophy_proc.py HYO_PM@2022-06-09T15-05-12 --parameters V --plot --save --show --range 36 |
|
375 | # python sophy_proc.py HYO_PM@2022-06-09T15-05-12 --parameters V --plot --save --show --range 36S |
@@ -12,13 +12,14 PATH = '/home/soporte/Documents/EVENTO/' | |||||
12 |
|
12 | |||
13 | PARAM = { |
|
13 | PARAM = { | |
14 | 'S': {'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
14 | 'S': {'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, | |
|
15 | 'SNR': {'zmin': -40, 'zmax': -20, 'colormap': 'jet', 'label': 'SNR', 'wrname': 'snr','cb_label': 'dB', 'ch':0}, | |||
15 | #'V': {'name': 'dataPP_DOP', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
16 | #'V': {'name': 'dataPP_DOP', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, | |
16 | 'V': {'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
17 | 'V': {'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, | |
17 | 'R': {'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, |
|
18 | 'R': {'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, | |
18 | 'P': {'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, |
|
19 | 'P': {'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, | |
19 |
'D': {'zmin': - |
|
20 | 'D': {'zmin': -30, 'zmax': 80, 'colormap': 'gist_ncar','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, | |
20 | 'Z': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, |
|
21 | 'Z': {'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, | |
21 |
'W': {'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': ' |
|
22 | 'W': {'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': 'm/s', 'ch':1} | |
22 | } |
|
23 | } | |
23 |
|
24 | |||
24 | def max_index(r, sample_rate, ipp): |
|
25 | def max_index(r, sample_rate, ipp): | |
@@ -55,6 +56,8 def main(args): | |||||
55 | #path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R'+str(args.range)+'km') |
|
56 | #path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R'+str(args.range)+'km') | |
56 | #path_save = os.path.join(PATH, experiment, 'paramC0_PL_R'+str(args.range)+'km') |
|
57 | #path_save = os.path.join(PATH, experiment, 'paramC0_PL_R'+str(args.range)+'km') | |
57 | RMIX = 1.62 |
|
58 | RMIX = 1.62 | |
|
59 | H0=-1.68 | |||
|
60 | MASK =0.3 | |||
58 |
|
61 | |||
59 | from schainpy.controller import Project |
|
62 | from schainpy.controller import Project | |
60 |
|
63 | |||
@@ -80,8 +83,6 def main(args): | |||||
80 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) |
|
83 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) | |
81 |
|
84 | |||
82 |
|
85 | |||
83 |
|
||||
84 |
|
||||
85 | if conf['usrp_tx']['code_type_2']: |
|
86 | if conf['usrp_tx']['code_type_2']: | |
86 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] |
|
87 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] | |
87 | code = [] |
|
88 | code = [] | |
@@ -95,26 +96,32 def main(args): | |||||
95 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
96 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario | |
96 | op.addParameter(name='n', value=len(code), format='int') |
|
97 | op.addParameter(name='n', value=len(code), format='int') | |
97 | ncode = len(code) |
|
98 | ncode = len(code) | |
|
99 | print("codes",codes) | |||
|
100 | print("nCode",len(code)) | |||
98 | else: |
|
101 | else: | |
99 | ncode = 1 |
|
102 | ncode = 1 | |
100 |
|
103 | |||
101 | op = voltage.addOperation(name='setH0') |
|
|||
102 | op.addParameter(name='h0', value='-1.68') |
|
|||
103 |
|
104 | |||
104 | if args.range > 0: |
|
105 | if args.range > 0: | |
105 | op = voltage.addOperation(name='selectHeights') |
|
106 | op = voltage.addOperation(name='selectHeights') | |
106 | op.addParameter(name='minIndex', value='0', format='int') |
|
107 | op.addParameter(name='minIndex', value='0', format='int') | |
107 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
108 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') | |
108 |
|
109 | |||
|
110 | ||||
|
111 | op = voltage.addOperation(name='setH0') | |||
|
112 | op.addParameter(name='h0', value='-1.68' , format='float') | |||
|
113 | ||||
|
114 | ||||
109 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') |
|
115 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') | |
110 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') |
|
116 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') | |
111 |
|
|
117 | op.addParameter(name='removeDC', value=1, format='int') | |
112 |
|
118 | |||
113 |
|
119 | |||
114 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) |
|
120 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) | |
|
121 | proc.addParameter(name='runNextUnit', value=True) | |||
115 |
|
122 | |||
116 | opObj10 = proc.addOperation(name="WeatherRadar") |
|
123 | opObj10 = proc.addOperation(name="WeatherRadar") | |
117 | opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') |
|
124 | #opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') | |
118 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
125 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) | |
119 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
126 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) | |
120 |
|
127 | |||
@@ -144,30 +151,48 def main(args): | |||||
144 | op.addParameter(name='save_code', value=param) |
|
151 | op.addParameter(name='save_code', value=param) | |
145 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
152 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) | |
146 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
153 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) | |
147 | op.addParameter(name='bgcolor',value='black') |
|
154 | op.addParameter(name='bgcolor', value='black') | |
148 |
op.addParameter(name=' |
|
155 | if MASK: op.addParameter(name='mask', value=MASK, format='float') | |
|
156 | if args.server: | |||
|
157 | op.addParameter(name='server', value='0.0.0.0:4444') | |||
|
158 | op.addParameter(name='exp_code', value='400') | |||
149 |
|
159 | |||
150 | desc = { |
|
160 | desc = { | |
151 | 'Data': { |
|
161 | 'Data': { | |
152 | 'data_param': PARAM[param]['wrname'], |
|
162 | 'data_param': {PARAM[param]['wrname']: ['H', 'V']}, | |
153 | 'utctime': 'time' |
|
163 | 'utctime': 'time' | |
154 | }, |
|
164 | }, | |
155 | 'Metadata': { |
|
165 | 'Metadata': { | |
156 | 'heightList': 'range', |
|
166 | 'heightList': 'range', | |
157 | 'data_azi': 'azimuth', |
|
167 | 'data_azi': 'azimuth', | |
158 | 'data_ele': 'elevation', |
|
168 | 'data_ele': 'elevation', | |
|
169 | 'mode_op': 'scan_type', | |||
|
170 | 'h0': 'range_correction', | |||
159 | } |
|
171 | } | |
160 | } |
|
172 | } | |
161 |
|
173 | |||
162 | if args.save: |
|
174 | if args.save: | |
163 |
|
|
175 | writer = proc.addOperation(name='HDFWriter') | |
164 |
|
|
176 | writer.addParameter(name='path', value=path_save, format='str') | |
165 |
|
|
177 | writer.addParameter(name='Reset', value=True) | |
166 |
|
|
178 | writer.addParameter(name='setType', value='weather') | |
167 |
|
|
179 | writer.addParameter(name='description', value=json.dumps(desc)) | |
168 |
|
|
180 | writer.addParameter(name='blocksPerFile', value='1',format='int') | |
169 |
|
|
181 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') | |
170 |
|
|
182 | writer.addParameter(name='dataList', value='data_param,utctime') | |
|
183 | writer.addParameter(name='weather_var', value=param) | |||
|
184 | writer.addParameter(name='mask', value=MASK, format='float') | |||
|
185 | # meta | |||
|
186 | writer.addParameter(name='latitude', value='-12.040436') | |||
|
187 | writer.addParameter(name='longitude', value='-75.295893') | |||
|
188 | writer.addParameter(name='altitude', value='3379.2147') | |||
|
189 | writer.addParameter(name='heading', value='0') | |||
|
190 | writer.addParameter(name='radar_name', value='SOPHy') | |||
|
191 | writer.addParameter(name='institution', value='IGP') | |||
|
192 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') | |||
|
193 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') | |||
|
194 | writer.addParameter(name='range_unit', value='km') | |||
|
195 | ||||
171 | project.start() |
|
196 | project.start() | |
172 |
|
197 | |||
173 |
|
198 | |||
@@ -189,6 +214,8 if __name__ == '__main__': | |||||
189 | help='Show matplotlib plot.') |
|
214 | help='Show matplotlib plot.') | |
190 | parser.add_argument('--online', action='store_true', |
|
215 | parser.add_argument('--online', action='store_true', | |
191 | help='Set online mode.') |
|
216 | help='Set online mode.') | |
|
217 | parser.add_argument('--server', action='store_true', | |||
|
218 | help='Send to realtime') | |||
192 | parser.add_argument('--start_time', default='', |
|
219 | parser.add_argument('--start_time', default='', | |
193 | help='Set start time.') |
|
220 | help='Set start time.') | |
194 |
|
221 |
@@ -19,7 +19,7 PARAM = { | |||||
19 | 'P': {'name': 'PhiD_P', 'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, |
|
19 | 'P': {'name': 'PhiD_P', 'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'º', 'ch':0}, | |
20 | 'D': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'gist_ncar','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, |
|
20 | 'D': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'gist_ncar','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, | |
21 | 'Z': {'name': 'Zdb', 'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, |
|
21 | 'Z': {'name': 'Zdb', 'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, | |
22 |
'W': {'name': 'Sigmav_W', 'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': ' |
|
22 | 'W': {'name': 'Sigmav_W', 'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': 'm/s', 'ch':1} | |
23 | } |
|
23 | } | |
24 |
|
24 | |||
25 | def max_index(r, sample_rate, ipp): |
|
25 | def max_index(r, sample_rate, ipp): | |
@@ -51,11 +51,12 def main(args): | |||||
51 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION |
|
51 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION | |
52 | path = os.path.join(PATH, experiment, 'rawdata') |
|
52 | path = os.path.join(PATH, experiment, 'rawdata') | |
53 | path_ped = os.path.join(PATH, experiment, 'position') |
|
53 | path_ped = os.path.join(PATH, experiment, 'position') | |
54 |
|
|
54 | path_plots = os.path.join(PATH, experiment, 'plotsC0_FD_PL_R'+str(args.range)+'km_removeDC') | |
55 |
|
|
55 | path_save = os.path.join(PATH, experiment, 'paramC0_FD_PL_R'+str(args.range)+'km_removeDC') | |
56 | path_plots = os.path.join(PATH, experiment, 'plotsC0_FD_PL_R'+str(args.range)+'km') |
|
56 | #path_plots = os.path.join(PATH, experiment, 'plotsC0_FD_PL_R'+str(args.range)+'km') | |
57 | path_save = os.path.join(PATH, experiment, 'paramC0_FD_PL_R'+str(args.range)+'km') |
|
57 | #path_save = os.path.join(PATH, experiment, 'paramC0_FD_PL_R'+str(args.range)+'km') | |
58 | RMIX = 1.62 |
|
58 | RMIX = 1.62 | |
|
59 | MASK =0.3 | |||
59 |
|
60 | |||
60 | from schainpy.controller import Project |
|
61 | from schainpy.controller import Project | |
61 |
|
62 | |||
@@ -112,8 +113,8 def main(args): | |||||
112 | procB.addParameter(name='nFFTPoints', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') |
|
113 | procB.addParameter(name='nFFTPoints', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') | |
113 | procB.addParameter(name='nProfiles', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') |
|
114 | procB.addParameter(name='nProfiles', value=int(conf['usrp_tx']['repetitions_2'])/2, format='int') | |
114 |
|
115 | |||
115 |
|
|
116 | opObj11 = procB.addOperation(name='removeDC') | |
116 |
|
|
117 | opObj11.addParameter(name='mode', value=2) | |
117 |
|
118 | |||
118 | proc= project.addProcUnit(datatype='ParametersProc',inputId=procB.getId()) |
|
119 | proc= project.addProcUnit(datatype='ParametersProc',inputId=procB.getId()) | |
119 |
|
120 | |||
@@ -123,7 +124,7 def main(args): | |||||
123 | #---------------------------------------NEW PROCESSING ----------------------------------------------------- |
|
124 | #---------------------------------------NEW PROCESSING ----------------------------------------------------- | |
124 |
|
125 | |||
125 | opObj10 = proc.addOperation(name="WeatherRadar") |
|
126 | opObj10 = proc.addOperation(name="WeatherRadar") | |
126 | opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') |
|
127 | #opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') | |
127 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
128 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) | |
128 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
129 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) | |
129 |
|
130 | |||
@@ -156,27 +157,44 def main(args): | |||||
156 | op.addParameter(name='bgcolor',value='black') |
|
157 | op.addParameter(name='bgcolor',value='black') | |
157 | op.addParameter(name='snr_threshold',value=0.4) |
|
158 | op.addParameter(name='snr_threshold',value=0.4) | |
158 |
|
159 | |||
|
160 | if MASK: op.addParameter(name='mask', value=MASK, format='float') | |||
|
161 | ||||
159 | desc = { |
|
162 | desc = { | |
160 | 'Data': { |
|
163 | 'Data': { | |
161 | 'data_param': PARAM[param]['wrname'], |
|
164 | 'data_param': {PARAM[param]['wrname']: ['H', 'V']}, | |
162 | 'utctime': 'time' |
|
165 | 'utctime': 'time' | |
163 | }, |
|
166 | }, | |
164 | 'Metadata': { |
|
167 | 'Metadata': { | |
165 | 'heightList': 'range', |
|
168 | 'heightList': 'range', | |
166 | 'data_azi': 'azimuth', |
|
169 | 'data_azi': 'azimuth', | |
167 | 'data_ele': 'elevation', |
|
170 | 'data_ele': 'elevation', | |
|
171 | 'mode_op': 'scan_type', | |||
|
172 | 'h0': 'range_correction', | |||
168 | } |
|
173 | } | |
169 | } |
|
174 | } | |
170 |
|
175 | |||
171 | if args.save: |
|
176 | if args.save: | |
172 |
|
|
177 | writer = proc.addOperation(name='HDFWriter') | |
173 |
|
|
178 | writer.addParameter(name='path', value=path_save, format='str') | |
174 |
|
|
179 | writer.addParameter(name='Reset', value=True) | |
175 |
|
|
180 | writer.addParameter(name='setType', value='weather') | |
176 |
|
|
181 | writer.addParameter(name='description', value=json.dumps(desc)) | |
177 |
|
|
182 | writer.addParameter(name='blocksPerFile', value='1',format='int') | |
178 |
|
|
183 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') | |
179 |
|
|
184 | writer.addParameter(name='dataList', value='data_param,utctime') | |
|
185 | writer.addParameter(name='weather_var', value=param) | |||
|
186 | writer.addParameter(name='mask', value=MASK, format='float') | |||
|
187 | # meta | |||
|
188 | writer.addParameter(name='latitude', value='-12.040436') | |||
|
189 | writer.addParameter(name='longitude', value='-75.295893') | |||
|
190 | writer.addParameter(name='altitude', value='3379.2147') | |||
|
191 | writer.addParameter(name='heading', value='0') | |||
|
192 | writer.addParameter(name='radar_name', value='SOPHy') | |||
|
193 | writer.addParameter(name='institution', value='IGP') | |||
|
194 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') | |||
|
195 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') | |||
|
196 | writer.addParameter(name='range_unit', value='km') | |||
|
197 | ||||
180 | project.start() |
|
198 | project.start() | |
181 |
|
199 | |||
182 |
|
200 | |||
@@ -204,4 +222,4 if __name__ == '__main__': | |||||
204 |
|
222 | |||
205 | args = parser.parse_args() |
|
223 | args = parser.parse_args() | |
206 |
|
224 | |||
207 | main(args) |
|
225 | main(args) # Operator#ñ8 |
@@ -24,7 +24,7 PARAM = { | |||||
24 | 'S': {'var': 'power','vmin': -45, 'vmax': -15, 'cmap': 'jet', 'label': 'Power','unit': 'dBm'}, |
|
24 | 'S': {'var': 'power','vmin': -45, 'vmax': -15, 'cmap': 'jet', 'label': 'Power','unit': 'dBm'}, | |
25 | 'V': {'var': 'velocity', 'vmin': -10, 'vmax': 10 , 'cmap': 'sophy_v', 'label': 'Velocity','unit': 'm/s'}, |
|
25 | 'V': {'var': 'velocity', 'vmin': -10, 'vmax': 10 , 'cmap': 'sophy_v', 'label': 'Velocity','unit': 'm/s'}, | |
26 | 'Z': {'var': 'reflectivity','vmin': -30, 'vmax': 80 , 'cmap': 'sophy_r','label': 'Reflectivity','unit': 'dBZ'}, |
|
26 | 'Z': {'var': 'reflectivity','vmin': -30, 'vmax': 80 , 'cmap': 'sophy_r','label': 'Reflectivity','unit': 'dBZ'}, | |
27 |
'W': {'var': 'spectral_width', 'vmin': 0 , 'vmax': 12 , 'cmap': 'sophy_w','label': 'Spectral Width','unit': ' |
|
27 | 'W': {'var': 'spectral_width', 'vmin': 0 , 'vmax': 12 , 'cmap': 'sophy_w','label': 'Spectral Width','unit': 'm/s'} | |
28 | } |
|
28 | } | |
29 | class Readsophy(): |
|
29 | class Readsophy(): | |
30 | def __init__(self): |
|
30 | def __init__(self): |
General Comments 0
You need to be logged in to leave comments.
Login now