@@ -1,33 +1,51 | |||||
1 | # Importra librerías |
|
1 | # Importra librerías | |
2 | import os |
|
2 | 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)) | |
19 | img_array = [] |
|
35 | img_array = [] | |
20 |
|
36 | |||
21 | #Leer todos los archivos formato imagen desde path |
|
37 | #Leer todos los archivos formato imagen desde path | |
22 | for x in range(0, len(archivos)): |
|
38 | for x in range(0, len(archivos)): | |
23 | nomArchivo = archivos[x] |
|
39 | nomArchivo = archivos[x] | |
24 | dirArchivo = path + str(nomArchivo) |
|
40 | dirArchivo = path + str(nomArchivo) | |
25 |
|
41 | |||
26 | #Asignar a variable leer_imagen, el nombre de cada imagen |
|
42 | #Asignar a variable leer_imagen, el nombre de cada imagen | |
27 | leer_imagen = imageio.imread(dirArchivo) |
|
43 | leer_imagen = imageio.imread(dirArchivo) | |
28 |
|
44 | |||
29 | # añadir imágenes al arreglo img_array |
|
45 | # añadir imágenes al arreglo img_array | |
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) |
@@ -1,375 +1,375 | |||||
1 | # SOPHY PROC script |
|
1 | # SOPHY PROC script | |
2 | import os, sys, json, argparse |
|
2 | import os, sys, json, argparse | |
3 | import datetime |
|
3 | import datetime | |
4 | import time |
|
4 | import time | |
5 |
|
5 | |||
6 | PATH = '/DATA_RM/DATA' |
|
6 | PATH = '/DATA_RM/DATA' | |
7 | PATH = '/media/jespinoza/Elements' |
|
7 | PATH = '/media/jespinoza/Elements' | |
8 | PATH = '/media/jespinoza/data/SOPHY' |
|
8 | PATH = '/media/jespinoza/data/SOPHY' | |
9 | PATH = '/home/soporte/Documents/EVENTO' |
|
9 | PATH = '/home/soporte/Documents/EVENTO' | |
10 |
|
10 | |||
11 | PARAM = { |
|
11 | PARAM = { | |
12 | 'S': {'zmin': -45, 'zmax': -25, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
12 | 'S': {'zmin': -45, 'zmax': -25, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, | |
13 | 'SNR': {'zmin': -40, 'zmax': -20, 'colormap': 'jet', 'label': 'SNR', 'wrname': 'snr','cb_label': 'dB', 'ch':0}, |
|
13 | 'SNR': {'zmin': -40, 'zmax': -20, 'colormap': 'jet', 'label': 'SNR', 'wrname': 'snr','cb_label': 'dB', 'ch':0}, | |
14 | 'V': {'zmin': -12, 'zmax': 12, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
14 | 'V': {'zmin': -12, 'zmax': 12, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, | |
15 | 'R': {'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, |
|
15 | 'R': {'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, | |
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): | |
23 |
|
23 | |||
24 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) |
|
24 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) | |
25 |
|
25 | |||
26 | def main(args): |
|
26 | def main(args): | |
27 |
|
27 | |||
28 | experiment = args.experiment |
|
28 | experiment = args.experiment | |
29 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) |
|
29 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) | |
30 | conf = json.loads(fp.read()) |
|
30 | conf = json.loads(fp.read()) | |
31 |
|
31 | |||
32 | ipp_km = conf['usrp_tx']['ipp'] |
|
32 | ipp_km = conf['usrp_tx']['ipp'] | |
33 | ipp = ipp_km * 2 /300000 |
|
33 | ipp = ipp_km * 2 /300000 | |
34 | sample_rate = conf['usrp_rx']['sample_rate'] |
|
34 | sample_rate = conf['usrp_rx']['sample_rate'] | |
35 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 |
|
35 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 | |
36 | speed_axis = conf['pedestal']['speed'] |
|
36 | speed_axis = conf['pedestal']['speed'] | |
37 | steps = conf['pedestal']['table'] |
|
37 | steps = conf['pedestal']['table'] | |
38 | time_offset = args.time_offset |
|
38 | time_offset = args.time_offset | |
39 | parameters = args.parameters |
|
39 | parameters = args.parameters | |
40 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') |
|
40 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') | |
41 | end_date = start_date |
|
41 | end_date = start_date | |
42 | if args.start_time: |
|
42 | if args.start_time: | |
43 | start_time = args.start_time |
|
43 | start_time = args.start_time | |
44 | else: |
|
44 | else: | |
45 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') |
|
45 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') | |
46 | end_time = '23:59:59' |
|
46 | end_time = '23:59:59' | |
47 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION |
|
47 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION | |
48 | path = os.path.join(PATH, experiment, 'rawdata') |
|
48 | path = os.path.join(PATH, experiment, 'rawdata') | |
49 | path_ped = os.path.join(PATH, experiment, 'position') |
|
49 | path_ped = os.path.join(PATH, experiment, 'position') | |
50 | path_plots = os.path.join(PATH, experiment, 'plotsC0N'+str(args.range)) |
|
50 | path_plots = os.path.join(PATH, experiment, 'plotsC0N'+str(args.range)) | |
51 | path_save = os.path.join(PATH, experiment, 'paramC0N'+str(args.range)) |
|
51 | path_save = os.path.join(PATH, experiment, 'paramC0N'+str(args.range)) | |
52 | RMIX = 1.62 |
|
52 | RMIX = 1.62 | |
53 | H0 = -1.68 |
|
53 | H0 = -1.68 | |
54 | MASK = 0.3 |
|
54 | MASK = 0.3 | |
55 |
|
55 | |||
56 | from schainpy.controller import Project |
|
56 | from schainpy.controller import Project | |
57 |
|
57 | |||
58 | project = Project() |
|
58 | project = Project() | |
59 | project.setup(id='1', name='Sophy', description='sophy proc') |
|
59 | project.setup(id='1', name='Sophy', description='sophy proc') | |
60 |
|
60 | |||
61 | reader = project.addReadUnit(datatype='DigitalRFReader', |
|
61 | reader = project.addReadUnit(datatype='DigitalRFReader', | |
62 | path=path, |
|
62 | path=path, | |
63 | startDate=start_date, |
|
63 | startDate=start_date, | |
64 | endDate=end_date, |
|
64 | endDate=end_date, | |
65 | startTime=start_time, |
|
65 | startTime=start_time, | |
66 | endTime=end_time, |
|
66 | endTime=end_time, | |
67 | delay=30, |
|
67 | delay=30, | |
68 | online=args.online, |
|
68 | online=args.online, | |
69 | walk=1, |
|
69 | walk=1, | |
70 | ippKm = ipp_km, |
|
70 | ippKm = ipp_km, | |
71 | getByBlock = 1, |
|
71 | getByBlock = 1, | |
72 | nProfileBlocks = N, |
|
72 | nProfileBlocks = N, | |
73 | ) |
|
73 | ) | |
74 |
|
74 | |||
75 | if not conf['usrp_tx']['enable_2']: # One Pulse |
|
75 | if not conf['usrp_tx']['enable_2']: # One Pulse | |
76 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
76 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) | |
77 |
|
77 | |||
78 | if conf['usrp_tx']['code_type_1'] != 'None': |
|
78 | if conf['usrp_tx']['code_type_1'] != 'None': | |
79 | codes = [ c.strip() for c in conf['usrp_tx']['code_1'].split(',')] |
|
79 | codes = [ c.strip() for c in conf['usrp_tx']['code_1'].split(',')] | |
80 | code = [] |
|
80 | code = [] | |
81 | for c in codes: |
|
81 | for c in codes: | |
82 | code.append([int(x) for x in c]) |
|
82 | code.append([int(x) for x in c]) | |
83 | op = voltage.addOperation(name='Decoder', optype='other') |
|
83 | op = voltage.addOperation(name='Decoder', optype='other') | |
84 | op.addParameter(name='code', value=code) |
|
84 | op.addParameter(name='code', value=code) | |
85 | op.addParameter(name='nCode', value=len(code), format='int') |
|
85 | op.addParameter(name='nCode', value=len(code), format='int') | |
86 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
86 | op.addParameter(name='nBaud', value=len(code[0]), format='int') | |
87 |
|
87 | |||
88 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
88 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario | |
89 | op.addParameter(name='n', value=len(code), format='int') |
|
89 | op.addParameter(name='n', value=len(code), format='int') | |
90 | ncode = len(code) |
|
90 | ncode = len(code) | |
91 | else: |
|
91 | else: | |
92 | ncode = 1 |
|
92 | ncode = 1 | |
93 | code = ['0'] |
|
93 | code = ['0'] | |
94 |
|
94 | |||
95 | op = voltage.addOperation(name='setH0') |
|
95 | op = voltage.addOperation(name='setH0') | |
96 | op.addParameter(name='h0', value=H0) |
|
96 | op.addParameter(name='h0', value=H0) | |
97 |
|
97 | |||
98 | if args.range > 0: |
|
98 | if args.range > 0: | |
99 | op = voltage.addOperation(name='selectHeights') |
|
99 | op = voltage.addOperation(name='selectHeights') | |
100 | op.addParameter(name='minIndex', value='0', format='int') |
|
100 | op.addParameter(name='minIndex', value='0', format='int') | |
101 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
101 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') | |
102 |
|
102 | |||
103 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') |
|
103 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') | |
104 | op.addParameter(name='n', value=int(N)/ncode, format='int') |
|
104 | op.addParameter(name='n', value=int(N)/ncode, format='int') | |
105 | #op.addParameter(name='removeDC', value=1, format='int') |
|
105 | #op.addParameter(name='removeDC', value=1, format='int') | |
106 |
|
106 | |||
107 |
|
107 | |||
108 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) |
|
108 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) | |
109 |
|
109 | |||
110 | opObj10 = proc.addOperation(name="WeatherRadar") |
|
110 | opObj10 = proc.addOperation(name="WeatherRadar") | |
111 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
111 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) | |
112 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
112 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) | |
113 |
|
113 | |||
114 | op = proc.addOperation(name='PedestalInformation') |
|
114 | op = proc.addOperation(name='PedestalInformation') | |
115 | op.addParameter(name='path', value=path_ped, format='str') |
|
115 | op.addParameter(name='path', value=path_ped, format='str') | |
116 | op.addParameter(name='interval', value='0.04') |
|
116 | op.addParameter(name='interval', value='0.04') | |
117 | op.addParameter(name='time_offset', value=time_offset) |
|
117 | op.addParameter(name='time_offset', value=time_offset) | |
118 | op.addParameter(name='mode', value='PPI') |
|
118 | op.addParameter(name='mode', value='PPI') | |
119 |
|
119 | |||
120 | for param in parameters: |
|
120 | for param in parameters: | |
121 | op = proc.addOperation(name='Block360') |
|
121 | op = proc.addOperation(name='Block360') | |
122 | op.addParameter(name='runNextOp', value=True) |
|
122 | op.addParameter(name='runNextOp', value=True) | |
123 |
|
123 | |||
124 | op= proc.addOperation(name='WeatherParamsPlot') |
|
124 | op= proc.addOperation(name='WeatherParamsPlot') | |
125 | if args.save: op.addParameter(name='save', value=path_plots, format='str') |
|
125 | if args.save: op.addParameter(name='save', value=path_plots, format='str') | |
126 | op.addParameter(name='save_period', value=-1) |
|
126 | op.addParameter(name='save_period', value=-1) | |
127 | op.addParameter(name='show', value=args.show) |
|
127 | op.addParameter(name='show', value=args.show) | |
128 | op.addParameter(name='channels', value='1,') |
|
128 | op.addParameter(name='channels', value='1,') | |
129 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) |
|
129 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) | |
130 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) |
|
130 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) | |
131 | op.addParameter(name='attr_data', value=param, format='str') |
|
131 | op.addParameter(name='attr_data', value=param, format='str') | |
132 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
132 | op.addParameter(name='labels', value=[PARAM[param]['label']]) | |
133 | op.addParameter(name='save_code', value=param) |
|
133 | op.addParameter(name='save_code', value=param) | |
134 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
134 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) | |
135 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
135 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) | |
136 | op.addParameter(name='bgcolor', value='black') |
|
136 | op.addParameter(name='bgcolor', value='black') | |
137 | if MASK: op.addParameter(name='mask', value=MASK, format='float') |
|
137 | if MASK: op.addParameter(name='mask', value=MASK, format='float') | |
138 | if args.server: |
|
138 | if args.server: | |
139 | op.addParameter(name='server', value='0.0.0.0:4444') |
|
139 | op.addParameter(name='server', value='0.0.0.0:4444') | |
140 | op.addParameter(name='exp_code', value='400') |
|
140 | op.addParameter(name='exp_code', value='400') | |
141 |
|
141 | |||
142 | desc = { |
|
142 | desc = { | |
143 | 'Data': { |
|
143 | 'Data': { | |
144 | param: PARAM[param]['wrname'], |
|
144 | param: PARAM[param]['wrname'], | |
145 | 'utctime': 'time' |
|
145 | 'utctime': 'time' | |
146 | }, |
|
146 | }, | |
147 | 'Metadata': { |
|
147 | 'Metadata': { | |
148 | 'heightList': 'range', |
|
148 | 'heightList': 'range', | |
149 | 'data_azi': 'azimuth', |
|
149 | 'data_azi': 'azimuth', | |
150 | 'data_ele': 'elevation', |
|
150 | 'data_ele': 'elevation', | |
151 | 'mode_op': 'scan_type', |
|
151 | 'mode_op': 'scan_type', | |
152 | 'h0': 'range_correction', |
|
152 | 'h0': 'range_correction', | |
153 | } |
|
153 | } | |
154 | } |
|
154 | } | |
155 |
|
155 | |||
156 | if args.save: |
|
156 | if args.save: | |
157 | opObj10 = proc.addOperation(name='HDFWriter') |
|
157 | opObj10 = proc.addOperation(name='HDFWriter') | |
158 | writer.addParameter(name='path', value=path_save, format='str') |
|
158 | writer.addParameter(name='path', value=path_save, format='str') | |
159 | writer.addParameter(name='Reset', value=True) |
|
159 | writer.addParameter(name='Reset', value=True) | |
160 | writer.addParameter(name='setType', value='weather') |
|
160 | writer.addParameter(name='setType', value='weather') | |
161 | writer.addParameter(name='description', value=json.dumps(desc)) |
|
161 | writer.addParameter(name='description', value=json.dumps(desc)) | |
162 | writer.addParameter(name='blocksPerFile', value='1',format='int') |
|
162 | writer.addParameter(name='blocksPerFile', value='1',format='int') | |
163 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') |
|
163 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') | |
164 | writer.addParameter(name='dataList', value='{},utctime'.format(param)) |
|
164 | writer.addParameter(name='dataList', value='{},utctime'.format(param)) | |
165 | writer.addParameter(name='mask', value=MASK, format='float') |
|
165 | writer.addParameter(name='mask', value=MASK, format='float') | |
166 | # meta |
|
166 | # meta | |
167 | writer.addParameter(name='latitude', value='-12.040436') |
|
167 | writer.addParameter(name='latitude', value='-12.040436') | |
168 | writer.addParameter(name='longitude', value='-75.295893') |
|
168 | writer.addParameter(name='longitude', value='-75.295893') | |
169 | writer.addParameter(name='altitude', value='3379.2147') |
|
169 | writer.addParameter(name='altitude', value='3379.2147') | |
170 | writer.addParameter(name='heading', value='0') |
|
170 | writer.addParameter(name='heading', value='0') | |
171 | writer.addParameter(name='radar_name', value='SOPHy') |
|
171 | writer.addParameter(name='radar_name', value='SOPHy') | |
172 | writer.addParameter(name='institution', value='IGP') |
|
172 | writer.addParameter(name='institution', value='IGP') | |
173 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') |
|
173 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') | |
174 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') |
|
174 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') | |
175 | writer.addParameter(name='range_unit', value='km') |
|
175 | writer.addParameter(name='range_unit', value='km') | |
176 |
|
176 | |||
177 | else: #Two pulses |
|
177 | else: #Two pulses | |
178 |
|
178 | |||
179 | voltage1 = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
179 | voltage1 = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) | |
180 |
|
180 | |||
181 | op = voltage1.addOperation(name='ProfileSelector') |
|
181 | op = voltage1.addOperation(name='ProfileSelector') | |
182 | op.addParameter(name='profileRangeList', value='0,{}'.format(conf['usrp_tx']['repetitions_1']-1)) |
|
182 | op.addParameter(name='profileRangeList', value='0,{}'.format(conf['usrp_tx']['repetitions_1']-1)) | |
183 |
|
183 | |||
184 | if conf['usrp_tx']['code_type_1'] != 'None': |
|
184 | if conf['usrp_tx']['code_type_1'] != 'None': | |
185 | codes = [ c.strip() for c in conf['usrp_tx']['code_1'].split(',')] |
|
185 | codes = [ c.strip() for c in conf['usrp_tx']['code_1'].split(',')] | |
186 | code = [] |
|
186 | code = [] | |
187 | for c in codes: |
|
187 | for c in codes: | |
188 | code.append([int(x) for x in c]) |
|
188 | code.append([int(x) for x in c]) | |
189 | op = voltage1.addOperation(name='Decoder', optype='other') |
|
189 | op = voltage1.addOperation(name='Decoder', optype='other') | |
190 | op.addParameter(name='code', value=code) |
|
190 | op.addParameter(name='code', value=code) | |
191 | op.addParameter(name='nCode', value=len(code), format='int') |
|
191 | op.addParameter(name='nCode', value=len(code), format='int') | |
192 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
192 | op.addParameter(name='nBaud', value=len(code[0]), format='int') | |
193 | else: |
|
193 | else: | |
194 | code = ['0'] |
|
194 | code = ['0'] | |
195 |
|
195 | |||
196 | op = voltage1.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
196 | op = voltage1.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario | |
197 | op.addParameter(name='n', value=2, format='int') |
|
197 | op.addParameter(name='n', value=2, format='int') | |
198 |
|
198 | |||
199 | if args.range > 0: |
|
199 | if args.range > 0: | |
200 | op = voltage1.addOperation(name='selectHeights') |
|
200 | op = voltage1.addOperation(name='selectHeights') | |
201 | op.addParameter(name='minIndex', value='0', format='int') |
|
201 | op.addParameter(name='minIndex', value='0', format='int') | |
202 | op.addParameter(name='maxIndex', value=max_index(RMIX, sample_rate, ipp), format='int') |
|
202 | op.addParameter(name='maxIndex', value=max_index(RMIX, sample_rate, ipp), format='int') | |
203 |
|
203 | |||
204 | op = voltage1.addOperation(name='setH0') |
|
204 | op = voltage1.addOperation(name='setH0') | |
205 | op.addParameter(name='h0', value=H0, format='float') |
|
205 | op.addParameter(name='h0', value=H0, format='float') | |
206 |
|
206 | |||
207 | op = voltage1.addOperation(name='PulsePair_vRF', optype='other') |
|
207 | op = voltage1.addOperation(name='PulsePair_vRF', optype='other') | |
208 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_1'])/2, format='int') |
|
208 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_1'])/2, format='int') | |
209 | #op.addParameter(name='removeDC', value=1, format='int') |
|
209 | #op.addParameter(name='removeDC', value=1, format='int') | |
210 |
|
210 | |||
211 |
|
211 | |||
212 | proc1 = project.addProcUnit(datatype='ParametersProc', inputId=voltage1.getId()) |
|
212 | proc1 = project.addProcUnit(datatype='ParametersProc', inputId=voltage1.getId()) | |
213 | proc1.addParameter(name='runNextUnit', value=True) |
|
213 | proc1.addParameter(name='runNextUnit', value=True) | |
214 |
|
214 | |||
215 | opObj10 = proc1.addOperation(name="WeatherRadar") |
|
215 | opObj10 = proc1.addOperation(name="WeatherRadar") | |
216 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
216 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) | |
217 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
217 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) | |
218 |
|
218 | |||
219 | op = proc1.addOperation(name='PedestalInformation') |
|
219 | op = proc1.addOperation(name='PedestalInformation') | |
220 | op.addParameter(name='path', value=path_ped, format='str') |
|
220 | op.addParameter(name='path', value=path_ped, format='str') | |
221 | op.addParameter(name='interval', value='0.04') |
|
221 | op.addParameter(name='interval', value='0.04') | |
222 | op.addParameter(name='time_offset', value=time_offset) |
|
222 | op.addParameter(name='time_offset', value=time_offset) | |
223 | op.addParameter(name='mode', value='PPI') |
|
223 | op.addParameter(name='mode', value='PPI') | |
224 |
|
224 | |||
225 | op = proc1.addOperation(name='Block360') |
|
225 | op = proc1.addOperation(name='Block360') | |
226 | op.addParameter(name='attr_data', value='data_param') |
|
226 | op.addParameter(name='attr_data', value='data_param') | |
227 | op.addParameter(name='runNextOp', value=True) |
|
227 | op.addParameter(name='runNextOp', value=True) | |
228 |
|
228 | |||
229 |
|
229 | |||
230 | voltage2 = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
230 | voltage2 = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) | |
231 |
|
231 | |||
232 | op = voltage2.addOperation(name='ProfileSelector') |
|
232 | op = voltage2.addOperation(name='ProfileSelector') | |
233 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) |
|
233 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) | |
234 |
|
234 | |||
235 | if conf['usrp_tx']['code_type_2']: |
|
235 | if conf['usrp_tx']['code_type_2']: | |
236 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] |
|
236 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] | |
237 | code = [] |
|
237 | code = [] | |
238 | for c in codes: |
|
238 | for c in codes: | |
239 | code.append([int(x) for x in c]) |
|
239 | code.append([int(x) for x in c]) | |
240 | op = voltage2.addOperation(name='Decoder', optype='other') |
|
240 | op = voltage2.addOperation(name='Decoder', optype='other') | |
241 | op.addParameter(name='code', value=code) |
|
241 | op.addParameter(name='code', value=code) | |
242 | op.addParameter(name='nCode', value=len(code), format='int') |
|
242 | op.addParameter(name='nCode', value=len(code), format='int') | |
243 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
243 | op.addParameter(name='nBaud', value=len(code[0]), format='int') | |
244 |
|
244 | |||
245 | op = voltage2.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
245 | op = voltage2.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario | |
246 | op.addParameter(name='n', value=len(code), format='int') |
|
246 | op.addParameter(name='n', value=len(code), format='int') | |
247 | ncode = len(code) |
|
247 | ncode = len(code) | |
248 | else: |
|
248 | else: | |
249 | ncode = 1 |
|
249 | ncode = 1 | |
250 |
|
250 | |||
251 | if args.range > 0: |
|
251 | if args.range > 0: | |
252 | op = voltage2.addOperation(name='selectHeights') |
|
252 | op = voltage2.addOperation(name='selectHeights') | |
253 | op.addParameter(name='minIndex', value=max_index(RMIX, sample_rate, ipp), format='int') |
|
253 | op.addParameter(name='minIndex', value=max_index(RMIX, sample_rate, ipp), format='int') | |
254 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
254 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') | |
255 |
|
255 | |||
256 | op = voltage2.addOperation(name='setH0') |
|
256 | op = voltage2.addOperation(name='setH0') | |
257 | op.addParameter(name='h0', value=H0, format='float') |
|
257 | op.addParameter(name='h0', value=H0, format='float') | |
258 |
|
258 | |||
259 | op = voltage2.addOperation(name='PulsePair_vRF', optype='other') |
|
259 | op = voltage2.addOperation(name='PulsePair_vRF', optype='other') | |
260 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_2'])/ncode, format='int') |
|
260 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_2'])/ncode, format='int') | |
261 | #op.addParameter(name='removeDC', value=1, format='int') |
|
261 | #op.addParameter(name='removeDC', value=1, format='int') | |
262 |
|
262 | |||
263 |
|
263 | |||
264 | proc2 = project.addProcUnit(datatype='ParametersProc', inputId=voltage2.getId()) |
|
264 | proc2 = project.addProcUnit(datatype='ParametersProc', inputId=voltage2.getId()) | |
265 | proc2.addParameter(name='runNextUnit', value=True) |
|
265 | proc2.addParameter(name='runNextUnit', value=True) | |
266 |
|
266 | |||
267 | opObj10 = proc2.addOperation(name="WeatherRadar") |
|
267 | opObj10 = proc2.addOperation(name="WeatherRadar") | |
268 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
268 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) | |
269 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
269 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) | |
270 |
|
270 | |||
271 | op = proc2.addOperation(name='PedestalInformation') |
|
271 | op = proc2.addOperation(name='PedestalInformation') | |
272 | op.addParameter(name='path', value=path_ped, format='str') |
|
272 | op.addParameter(name='path', value=path_ped, format='str') | |
273 | op.addParameter(name='interval', value='0.04') |
|
273 | op.addParameter(name='interval', value='0.04') | |
274 | op.addParameter(name='time_offset', value=time_offset) |
|
274 | op.addParameter(name='time_offset', value=time_offset) | |
275 | op.addParameter(name='mode', value='PPI') |
|
275 | op.addParameter(name='mode', value='PPI') | |
276 |
|
276 | |||
277 | op = proc2.addOperation(name='Block360') |
|
277 | op = proc2.addOperation(name='Block360') | |
278 | op.addParameter(name='attr_data', value='data_param') |
|
278 | op.addParameter(name='attr_data', value='data_param') | |
279 | op.addParameter(name='runNextOp', value=True) |
|
279 | op.addParameter(name='runNextOp', value=True) | |
280 |
|
280 | |||
281 | merge = project.addProcUnit(datatype='MergeProc', inputId=[proc1.getId(), proc2.getId()]) |
|
281 | merge = project.addProcUnit(datatype='MergeProc', inputId=[proc1.getId(), proc2.getId()]) | |
282 | merge.addParameter(name='attr_data', value='data_param') |
|
282 | merge.addParameter(name='attr_data', value='data_param') | |
283 | merge.addParameter(name='mode', value='7') #RM |
|
283 | merge.addParameter(name='mode', value='7') #RM | |
284 |
|
284 | |||
285 |
|
285 | |||
286 | for param in parameters: |
|
286 | for param in parameters: | |
287 |
|
287 | |||
288 | if args.plot: |
|
288 | if args.plot: | |
289 | op= merge.addOperation(name='WeatherParamsPlot') |
|
289 | op= merge.addOperation(name='WeatherParamsPlot') | |
290 | if args.save: |
|
290 | if args.save: | |
291 | op.addParameter(name='save', value=path_plots, format='str') |
|
291 | op.addParameter(name='save', value=path_plots, format='str') | |
292 | op.addParameter(name='save_period', value=-1) |
|
292 | op.addParameter(name='save_period', value=-1) | |
293 | op.addParameter(name='show', value=args.show) |
|
293 | op.addParameter(name='show', value=args.show) | |
294 | op.addParameter(name='channels', value='0,') |
|
294 | op.addParameter(name='channels', value='0,') | |
295 | op.addParameter(name='zmin', value=PARAM[param]['zmin'], format='int') |
|
295 | op.addParameter(name='zmin', value=PARAM[param]['zmin'], format='int') | |
296 | op.addParameter(name='zmax', value=PARAM[param]['zmax'], format='int') |
|
296 | op.addParameter(name='zmax', value=PARAM[param]['zmax'], format='int') | |
297 | op.addParameter(name='attr_data', value=param, format='str') |
|
297 | op.addParameter(name='attr_data', value=param, format='str') | |
298 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
298 | op.addParameter(name='labels', value=[PARAM[param]['label']]) | |
299 | op.addParameter(name='save_code', value=param) |
|
299 | op.addParameter(name='save_code', value=param) | |
300 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
300 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) | |
301 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
301 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) | |
302 | op.addParameter(name='bgcolor', value='black') |
|
302 | op.addParameter(name='bgcolor', value='black') | |
303 | if MASK: op.addParameter(name='mask', value=MASK, format='float') |
|
303 | if MASK: op.addParameter(name='mask', value=MASK, format='float') | |
304 | if args.server: |
|
304 | if args.server: | |
305 | op.addParameter(name='server', value='0.0.0.0:4444') |
|
305 | op.addParameter(name='server', value='0.0.0.0:4444') | |
306 | op.addParameter(name='exp_code', value='400') |
|
306 | op.addParameter(name='exp_code', value='400') | |
307 |
|
307 | |||
308 | desc = { |
|
308 | desc = { | |
309 | 'Data': { |
|
309 | 'Data': { | |
310 | 'data_param': {PARAM[param]['wrname']: ['H', 'V']}, |
|
310 | 'data_param': {PARAM[param]['wrname']: ['H', 'V']}, | |
311 | 'utctime': 'time' |
|
311 | 'utctime': 'time' | |
312 | }, |
|
312 | }, | |
313 | 'Metadata': { |
|
313 | 'Metadata': { | |
314 | 'heightList': 'range', |
|
314 | 'heightList': 'range', | |
315 | 'data_azi': 'azimuth', |
|
315 | 'data_azi': 'azimuth', | |
316 | 'data_ele': 'elevation', |
|
316 | 'data_ele': 'elevation', | |
317 | 'mode_op': 'scan_type', |
|
317 | 'mode_op': 'scan_type', | |
318 | 'h0': 'range_correction', |
|
318 | 'h0': 'range_correction', | |
319 | } |
|
319 | } | |
320 | } |
|
320 | } | |
321 |
|
321 | |||
322 | if args.save: |
|
322 | if args.save: | |
323 | writer = merge.addOperation(name='HDFWriter') |
|
323 | writer = merge.addOperation(name='HDFWriter') | |
324 | writer.addParameter(name='path', value=path_save, format='str') |
|
324 | writer.addParameter(name='path', value=path_save, format='str') | |
325 | writer.addParameter(name='Reset', value=True) |
|
325 | writer.addParameter(name='Reset', value=True) | |
326 | writer.addParameter(name='setType', value='weather') |
|
326 | writer.addParameter(name='setType', value='weather') | |
327 | writer.addParameter(name='description', value=json.dumps(desc)) |
|
327 | writer.addParameter(name='description', value=json.dumps(desc)) | |
328 | writer.addParameter(name='blocksPerFile', value='1',format='int') |
|
328 | writer.addParameter(name='blocksPerFile', value='1',format='int') | |
329 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') |
|
329 | writer.addParameter(name='metadataList', value='heightList,data_azi,data_ele,mode_op,latitude,longitude,altitude,heading,radar_name,institution,contact,h0,range_unit') | |
330 | writer.addParameter(name='dataList', value='data_param,utctime') |
|
330 | writer.addParameter(name='dataList', value='data_param,utctime') | |
331 | writer.addParameter(name='weather_var', value=param) |
|
331 | writer.addParameter(name='weather_var', value=param) | |
332 | writer.addParameter(name='mask', value=MASK, format='float') |
|
332 | writer.addParameter(name='mask', value=MASK, format='float') | |
333 | # meta |
|
333 | # meta | |
334 | writer.addParameter(name='latitude', value='-12.040436') |
|
334 | writer.addParameter(name='latitude', value='-12.040436') | |
335 | writer.addParameter(name='longitude', value='-75.295893') |
|
335 | writer.addParameter(name='longitude', value='-75.295893') | |
336 | writer.addParameter(name='altitude', value='3379.2147') |
|
336 | writer.addParameter(name='altitude', value='3379.2147') | |
337 | writer.addParameter(name='heading', value='0') |
|
337 | writer.addParameter(name='heading', value='0') | |
338 | writer.addParameter(name='radar_name', value='SOPHy') |
|
338 | writer.addParameter(name='radar_name', value='SOPHy') | |
339 | writer.addParameter(name='institution', value='IGP') |
|
339 | writer.addParameter(name='institution', value='IGP') | |
340 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') |
|
340 | writer.addParameter(name='contact', value='dscipion@igp.gob.pe') | |
341 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') |
|
341 | writer.addParameter(name='created_by', value='Signal Chain (https://pypi.org/project/schainpy/)') | |
342 | writer.addParameter(name='range_unit', value='km') |
|
342 | writer.addParameter(name='range_unit', value='km') | |
343 |
|
343 | |||
344 | project.start() |
|
344 | project.start() | |
345 |
|
345 | |||
346 | if __name__ == '__main__': |
|
346 | if __name__ == '__main__': | |
347 |
|
347 | |||
348 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
348 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') | |
349 | parser.add_argument('experiment', |
|
349 | parser.add_argument('experiment', | |
350 | help='Experiment name') |
|
350 | help='Experiment name') | |
351 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
351 | parser.add_argument('--parameters', nargs='*', default=['S'], | |
352 | help='Variables to process: P, Z, V') |
|
352 | help='Variables to process: P, Z, V') | |
353 | parser.add_argument('--time_offset', default=0, |
|
353 | parser.add_argument('--time_offset', default=0, | |
354 | help='Fix time offset') |
|
354 | help='Fix time offset') | |
355 | parser.add_argument('--range', default=0, type=float, |
|
355 | parser.add_argument('--range', default=0, type=float, | |
356 | help='Max range to plot') |
|
356 | help='Max range to plot') | |
357 | parser.add_argument('--save', action='store_true', |
|
357 | parser.add_argument('--save', action='store_true', | |
358 | help='Create output files') |
|
358 | help='Create output files') | |
359 | parser.add_argument('--plot', action='store_true', |
|
359 | parser.add_argument('--plot', action='store_true', | |
360 | help='Create plot files') |
|
360 | help='Create plot files') | |
361 | parser.add_argument('--show', action='store_true', |
|
361 | parser.add_argument('--show', action='store_true', | |
362 | help='Show matplotlib plot.') |
|
362 | help='Show matplotlib plot.') | |
363 | parser.add_argument('--online', action='store_true', |
|
363 | parser.add_argument('--online', action='store_true', | |
364 | help='Set online mode.') |
|
364 | help='Set online mode.') | |
365 | parser.add_argument('--server', action='store_true', |
|
365 | parser.add_argument('--server', action='store_true', | |
366 | help='Send to realtime') |
|
366 | help='Send to realtime') | |
367 | parser.add_argument('--start_time', default='', |
|
367 | parser.add_argument('--start_time', default='', | |
368 | help='Set start time.') |
|
368 | help='Set start time.') | |
369 |
|
369 | |||
370 |
|
370 | |||
371 | args = parser.parse_args() |
|
371 | args = parser.parse_args() | |
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 |
@@ -1,198 +1,225 | |||||
1 | # SOPHY PROC script |
|
1 | # SOPHY PROC script | |
2 | import os, sys, json, argparse |
|
2 | import os, sys, json, argparse | |
3 | import datetime |
|
3 | import datetime | |
4 | import time |
|
4 | import time | |
5 |
|
5 | |||
6 | PATH = '/DATA_RM/DATA' |
|
6 | PATH = '/DATA_RM/DATA' | |
7 | # PATH = '/Users/jespinoza/workspace/data/' |
|
7 | # PATH = '/Users/jespinoza/workspace/data/' | |
8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' |
|
8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' | |
9 | PATH = '/home/soporte/Downloads/data_WR_RHI' |
|
9 | PATH = '/home/soporte/Downloads/data_WR_RHI' | |
10 | PATH = '/home/soporte/Documents/EVENTO/' |
|
10 | PATH = '/home/soporte/Documents/EVENTO/' | |
11 |
|
11 | |||
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): | |
25 |
|
26 | |||
26 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) |
|
27 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) | |
27 |
|
28 | |||
28 | def main(args): |
|
29 | def main(args): | |
29 |
|
30 | |||
30 | experiment = args.experiment |
|
31 | experiment = args.experiment | |
31 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) |
|
32 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) | |
32 | conf = json.loads(fp.read()) |
|
33 | conf = json.loads(fp.read()) | |
33 |
|
34 | |||
34 | ipp_km = conf['usrp_tx']['ipp'] |
|
35 | ipp_km = conf['usrp_tx']['ipp'] | |
35 | ipp = ipp_km * 2 /300000 |
|
36 | ipp = ipp_km * 2 /300000 | |
36 | sample_rate = conf['usrp_rx']['sample_rate'] |
|
37 | sample_rate = conf['usrp_rx']['sample_rate'] | |
37 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 |
|
38 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 | |
38 | speed_axis = conf['pedestal']['speed'] |
|
39 | speed_axis = conf['pedestal']['speed'] | |
39 | steps = conf['pedestal']['table'] |
|
40 | steps = conf['pedestal']['table'] | |
40 | time_offset = args.time_offset |
|
41 | time_offset = args.time_offset | |
41 | parameters = args.parameters |
|
42 | parameters = args.parameters | |
42 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') |
|
43 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') | |
43 | end_date = start_date |
|
44 | end_date = start_date | |
44 | if args.start_time: |
|
45 | if args.start_time: | |
45 | start_time = args.start_time |
|
46 | start_time = args.start_time | |
46 | else: |
|
47 | else: | |
47 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') |
|
48 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') | |
48 | #start_time = '16:15:00' |
|
49 | #start_time = '16:15:00' | |
49 | end_time = '23:59:59' |
|
50 | end_time = '23:59:59' | |
50 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION |
|
51 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION | |
51 | path = os.path.join(PATH, experiment, 'rawdata') |
|
52 | path = os.path.join(PATH, experiment, 'rawdata') | |
52 | path_ped = os.path.join(PATH, experiment, 'position') |
|
53 | path_ped = os.path.join(PATH, experiment, 'position') | |
53 | path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R'+str(args.range)+'km_removeDC') |
|
54 | path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R'+str(args.range)+'km_removeDC') | |
54 | path_save = os.path.join(PATH, experiment, 'paramC0_PL_R'+str(args.range)+'km_removeDC') |
|
55 | path_save = os.path.join(PATH, experiment, 'paramC0_PL_R'+str(args.range)+'km_removeDC') | |
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 | |||
61 | project = Project() |
|
64 | project = Project() | |
62 | project.setup(id='1', name='Sophy', description='sophy proc') |
|
65 | project.setup(id='1', name='Sophy', description='sophy proc') | |
63 |
|
66 | |||
64 | reader = project.addReadUnit(datatype='DigitalRFReader', |
|
67 | reader = project.addReadUnit(datatype='DigitalRFReader', | |
65 | path=path, |
|
68 | path=path, | |
66 | startDate=start_date, |
|
69 | startDate=start_date, | |
67 | endDate=end_date, |
|
70 | endDate=end_date, | |
68 | startTime=start_time, |
|
71 | startTime=start_time, | |
69 | endTime=end_time, |
|
72 | endTime=end_time, | |
70 | delay=30, |
|
73 | delay=30, | |
71 | online=args.online, |
|
74 | online=args.online, | |
72 | walk=1, |
|
75 | walk=1, | |
73 | ippKm = ipp_km, |
|
76 | ippKm = ipp_km, | |
74 | getByBlock = 1, |
|
77 | getByBlock = 1, | |
75 | nProfileBlocks = N, |
|
78 | nProfileBlocks = N, | |
76 | ) |
|
79 | ) | |
77 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
80 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) | |
78 |
|
81 | |||
79 | op = voltage.addOperation(name='ProfileSelector') |
|
82 | op = voltage.addOperation(name='ProfileSelector') | |
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 = [] | |
88 | for c in codes: |
|
89 | for c in codes: | |
89 | code.append([int(x) for x in c]) |
|
90 | code.append([int(x) for x in c]) | |
90 | op = voltage.addOperation(name='Decoder', optype='other') |
|
91 | op = voltage.addOperation(name='Decoder', optype='other') | |
91 | op.addParameter(name='code', value=code) |
|
92 | op.addParameter(name='code', value=code) | |
92 | op.addParameter(name='nCode', value=len(code), format='int') |
|
93 | op.addParameter(name='nCode', value=len(code), format='int') | |
93 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
94 | op.addParameter(name='nBaud', value=len(code[0]), format='int') | |
94 |
|
95 | |||
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 | |||
121 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} |
|
128 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} | |
122 |
|
129 | |||
123 | op = proc.addOperation(name='PedestalInformation') |
|
130 | op = proc.addOperation(name='PedestalInformation') | |
124 | op.addParameter(name='path', value=path_ped, format='str') |
|
131 | op.addParameter(name='path', value=path_ped, format='str') | |
125 | op.addParameter(name='interval', value='0.04') |
|
132 | op.addParameter(name='interval', value='0.04') | |
126 | op.addParameter(name='time_offset', value=time_offset) |
|
133 | op.addParameter(name='time_offset', value=time_offset) | |
127 | #op.addParameter(name='az_offset', value=-26.2) |
|
134 | #op.addParameter(name='az_offset', value=-26.2) | |
128 | op.addParameter(name='mode', value='PPI') |
|
135 | op.addParameter(name='mode', value='PPI') | |
129 |
|
136 | |||
130 | for param in parameters: |
|
137 | for param in parameters: | |
131 | op = proc.addOperation(name='Block360') |
|
138 | op = proc.addOperation(name='Block360') | |
132 | op.addParameter(name='attr_data', value='data_param') |
|
139 | op.addParameter(name='attr_data', value='data_param') | |
133 | op.addParameter(name='runNextOp', value=True) |
|
140 | op.addParameter(name='runNextOp', value=True) | |
134 |
|
141 | |||
135 | op= proc.addOperation(name='WeatherParamsPlot') |
|
142 | op= proc.addOperation(name='WeatherParamsPlot') | |
136 | if args.save: op.addParameter(name='save', value=path_plots, format='str') |
|
143 | if args.save: op.addParameter(name='save', value=path_plots, format='str') | |
137 | op.addParameter(name='save_period', value=-1) |
|
144 | op.addParameter(name='save_period', value=-1) | |
138 | op.addParameter(name='show', value=args.show) |
|
145 | op.addParameter(name='show', value=args.show) | |
139 | op.addParameter(name='channels', value='0,') |
|
146 | op.addParameter(name='channels', value='0,') | |
140 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) |
|
147 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) | |
141 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) |
|
148 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) | |
142 | op.addParameter(name='attr_data', value=param, format='str') |
|
149 | op.addParameter(name='attr_data', value=param, format='str') | |
143 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
150 | op.addParameter(name='labels', value=[PARAM[param]['label']]) | |
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 | |||
174 |
|
199 | |||
175 | if __name__ == '__main__': |
|
200 | if __name__ == '__main__': | |
176 |
|
201 | |||
177 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
202 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') | |
178 | parser.add_argument('experiment', |
|
203 | parser.add_argument('experiment', | |
179 | help='Experiment name') |
|
204 | help='Experiment name') | |
180 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
205 | parser.add_argument('--parameters', nargs='*', default=['S'], | |
181 | help='Variables to process: P, Z, V') |
|
206 | help='Variables to process: P, Z, V') | |
182 | parser.add_argument('--time_offset', default=0, |
|
207 | parser.add_argument('--time_offset', default=0, | |
183 | help='Fix time offset') |
|
208 | help='Fix time offset') | |
184 | parser.add_argument('--range', default=0, type=float, |
|
209 | parser.add_argument('--range', default=0, type=float, | |
185 | help='Max range to plot') |
|
210 | help='Max range to plot') | |
186 | parser.add_argument('--save', action='store_true', |
|
211 | parser.add_argument('--save', action='store_true', | |
187 | help='Create output files') |
|
212 | help='Create output files') | |
188 | parser.add_argument('--show', action='store_true', |
|
213 | parser.add_argument('--show', action='store_true', | |
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 | |||
195 |
|
222 | |||
196 | args = parser.parse_args() |
|
223 | args = parser.parse_args() | |
197 |
|
224 | |||
198 | main(args) |
|
225 | main(args) |
@@ -1,207 +1,225 | |||||
1 | # SOPHY PROC script |
|
1 | # SOPHY PROC script | |
2 | import os, sys, json, argparse |
|
2 | import os, sys, json, argparse | |
3 | import datetime |
|
3 | import datetime | |
4 | import time |
|
4 | import time | |
5 |
|
5 | |||
6 | PATH = '/DATA_RM/DATA' |
|
6 | PATH = '/DATA_RM/DATA' | |
7 | # PATH = '/Users/jespinoza/workspace/data/' |
|
7 | # PATH = '/Users/jespinoza/workspace/data/' | |
8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' |
|
8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' | |
9 | PATH = '/home/soporte/Downloads/data_WR_RHI' |
|
9 | PATH = '/home/soporte/Downloads/data_WR_RHI' | |
10 | PATH = '/home/soporte/Documents/EVENTO/' |
|
10 | PATH = '/home/soporte/Documents/EVENTO/' | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | PARAM = { |
|
13 | PARAM = { | |
14 | 'S': {'name': 'dataPP_POWER', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
14 | 'S': {'name': 'dataPP_POWER', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, | |
15 | 'S2': {'name': 'data_pow', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
15 | 'S2': {'name': 'data_pow', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', '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': {'name': 'dataPP_DOP', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, | |
17 | 'V': {'name': 'velRadial_V', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
17 | 'V': {'name': 'velRadial_V', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, | |
18 | 'R': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, |
|
18 | 'R': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, | |
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): | |
26 |
|
26 | |||
27 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) |
|
27 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) | |
28 |
|
28 | |||
29 | def main(args): |
|
29 | def main(args): | |
30 |
|
30 | |||
31 | experiment = args.experiment |
|
31 | experiment = args.experiment | |
32 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) |
|
32 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) | |
33 | conf = json.loads(fp.read()) |
|
33 | conf = json.loads(fp.read()) | |
34 |
|
34 | |||
35 | ipp_km = conf['usrp_tx']['ipp'] |
|
35 | ipp_km = conf['usrp_tx']['ipp'] | |
36 | ipp = ipp_km * 2 /300000 |
|
36 | ipp = ipp_km * 2 /300000 | |
37 | sample_rate = conf['usrp_rx']['sample_rate'] |
|
37 | sample_rate = conf['usrp_rx']['sample_rate'] | |
38 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 |
|
38 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 | |
39 | speed_axis = conf['pedestal']['speed'] |
|
39 | speed_axis = conf['pedestal']['speed'] | |
40 | steps = conf['pedestal']['table'] |
|
40 | steps = conf['pedestal']['table'] | |
41 | time_offset = args.time_offset |
|
41 | time_offset = args.time_offset | |
42 | parameters = args.parameters |
|
42 | parameters = args.parameters | |
43 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') |
|
43 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') | |
44 | end_date = start_date |
|
44 | end_date = start_date | |
45 | if args.start_time: |
|
45 | if args.start_time: | |
46 | start_time = args.start_time |
|
46 | start_time = args.start_time | |
47 | else: |
|
47 | else: | |
48 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') |
|
48 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') | |
49 | #start_time = '16:15:00' |
|
49 | #start_time = '16:15:00' | |
50 | end_time = '23:59:59' |
|
50 | end_time = '23:59:59' | |
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 | |||
62 | project = Project() |
|
63 | project = Project() | |
63 | project.setup(id='1', name='Sophy', description='sophy proc') |
|
64 | project.setup(id='1', name='Sophy', description='sophy proc') | |
64 |
|
65 | |||
65 | reader = project.addReadUnit(datatype='DigitalRFReader', |
|
66 | reader = project.addReadUnit(datatype='DigitalRFReader', | |
66 | path=path, |
|
67 | path=path, | |
67 | startDate=start_date, |
|
68 | startDate=start_date, | |
68 | endDate=end_date, |
|
69 | endDate=end_date, | |
69 | startTime=start_time, |
|
70 | startTime=start_time, | |
70 | endTime=end_time, |
|
71 | endTime=end_time, | |
71 | delay=30, |
|
72 | delay=30, | |
72 | online=args.online, |
|
73 | online=args.online, | |
73 | walk=1, |
|
74 | walk=1, | |
74 | ippKm = ipp_km, |
|
75 | ippKm = ipp_km, | |
75 | getByBlock = 1, |
|
76 | getByBlock = 1, | |
76 | nProfileBlocks = N, |
|
77 | nProfileBlocks = N, | |
77 | ) |
|
78 | ) | |
78 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
79 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) | |
79 |
|
80 | |||
80 | op = voltage.addOperation(name='setAttribute') |
|
81 | op = voltage.addOperation(name='setAttribute') | |
81 | op.addParameter(name='frequency', value='9345.e6', format='float') |
|
82 | op.addParameter(name='frequency', value='9345.e6', format='float') | |
82 |
|
83 | |||
83 | op = voltage.addOperation(name='ProfileSelector') |
|
84 | op = voltage.addOperation(name='ProfileSelector') | |
84 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) |
|
85 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) | |
85 |
|
86 | |||
86 | if conf['usrp_tx']['code_type_2']: |
|
87 | if conf['usrp_tx']['code_type_2']: | |
87 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] |
|
88 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] | |
88 | code = [] |
|
89 | code = [] | |
89 | for c in codes: |
|
90 | for c in codes: | |
90 | code.append([int(x) for x in c]) |
|
91 | code.append([int(x) for x in c]) | |
91 | op = voltage.addOperation(name='Decoder', optype='other') |
|
92 | op = voltage.addOperation(name='Decoder', optype='other') | |
92 | op.addParameter(name='code', value=code) |
|
93 | op.addParameter(name='code', value=code) | |
93 | op.addParameter(name='nCode', value=len(code), format='int') |
|
94 | op.addParameter(name='nCode', value=len(code), format='int') | |
94 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
95 | op.addParameter(name='nBaud', value=len(code[0]), format='int') | |
95 |
|
96 | |||
96 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
97 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario | |
97 | op.addParameter(name='n', value=len(code), format='int') |
|
98 | op.addParameter(name='n', value=len(code), format='int') | |
98 | ncode = len(code) |
|
99 | ncode = len(code) | |
99 | else: |
|
100 | else: | |
100 | ncode = 1 |
|
101 | ncode = 1 | |
101 |
|
102 | |||
102 | op = voltage.addOperation(name='setH0') |
|
103 | op = voltage.addOperation(name='setH0') | |
103 | op.addParameter(name='h0', value='-1.68') |
|
104 | op.addParameter(name='h0', value='-1.68') | |
104 |
|
105 | |||
105 | if args.range > 0: |
|
106 | if args.range > 0: | |
106 | op = voltage.addOperation(name='selectHeights') |
|
107 | op = voltage.addOperation(name='selectHeights') | |
107 | op.addParameter(name='minIndex', value='0', format='int') |
|
108 | op.addParameter(name='minIndex', value='0', format='int') | |
108 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
109 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') | |
109 |
|
110 | |||
110 | #---------------------------------------NEW PROCESSING ----------------------------------------------------- |
|
111 | #---------------------------------------NEW PROCESSING ----------------------------------------------------- | |
111 | procB = project.addProcUnit(datatype='SpectraProc', inputId=voltage.getId()) |
|
112 | procB = project.addProcUnit(datatype='SpectraProc', inputId=voltage.getId()) | |
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 | |||
120 | opObj10 = proc.addOperation(name='SpectralMoments') |
|
121 | opObj10 = proc.addOperation(name='SpectralMoments') | |
121 | opObj10.addParameter(name='wradar',value=True) |
|
122 | opObj10.addParameter(name='wradar',value=True) | |
122 |
|
123 | |||
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 | |||
130 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} |
|
131 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} | |
131 |
|
132 | |||
132 | op = proc.addOperation(name='PedestalInformation') |
|
133 | op = proc.addOperation(name='PedestalInformation') | |
133 | op.addParameter(name='path', value=path_ped, format='str') |
|
134 | op.addParameter(name='path', value=path_ped, format='str') | |
134 | op.addParameter(name='interval', value='0.04') |
|
135 | op.addParameter(name='interval', value='0.04') | |
135 | op.addParameter(name='time_offset', value=time_offset) |
|
136 | op.addParameter(name='time_offset', value=time_offset) | |
136 | #op.addParameter(name='az_offset', value=-26.2) |
|
137 | #op.addParameter(name='az_offset', value=-26.2) | |
137 | op.addParameter(name='mode', value='PPI') |
|
138 | op.addParameter(name='mode', value='PPI') | |
138 |
|
139 | |||
139 | for param in parameters: |
|
140 | for param in parameters: | |
140 | op = proc.addOperation(name='Block360') |
|
141 | op = proc.addOperation(name='Block360') | |
141 | op.addParameter(name='attr_data', value='data_param') |
|
142 | op.addParameter(name='attr_data', value='data_param') | |
142 | op.addParameter(name='runNextOp', value=True) |
|
143 | op.addParameter(name='runNextOp', value=True) | |
143 |
|
144 | |||
144 | op= proc.addOperation(name='WeatherParamsPlot') |
|
145 | op= proc.addOperation(name='WeatherParamsPlot') | |
145 | if args.save: op.addParameter(name='save', value=path_plots, format='str') |
|
146 | if args.save: op.addParameter(name='save', value=path_plots, format='str') | |
146 | op.addParameter(name='save_period', value=-1) |
|
147 | op.addParameter(name='save_period', value=-1) | |
147 | op.addParameter(name='show', value=args.show) |
|
148 | op.addParameter(name='show', value=args.show) | |
148 | op.addParameter(name='channels', value='0,') |
|
149 | op.addParameter(name='channels', value='0,') | |
149 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) |
|
150 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) | |
150 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) |
|
151 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) | |
151 | op.addParameter(name='attr_data', value=param, format='str') |
|
152 | op.addParameter(name='attr_data', value=param, format='str') | |
152 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
153 | op.addParameter(name='labels', value=[PARAM[param]['label']]) | |
153 | op.addParameter(name='save_code', value=param) |
|
154 | op.addParameter(name='save_code', value=param) | |
154 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
155 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) | |
155 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
156 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) | |
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 | |||
183 |
|
201 | |||
184 | if __name__ == '__main__': |
|
202 | if __name__ == '__main__': | |
185 |
|
203 | |||
186 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
204 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') | |
187 | parser.add_argument('experiment', |
|
205 | parser.add_argument('experiment', | |
188 | help='Experiment name') |
|
206 | help='Experiment name') | |
189 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
207 | parser.add_argument('--parameters', nargs='*', default=['S'], | |
190 | help='Variables to process: P, Z, V') |
|
208 | help='Variables to process: P, Z, V') | |
191 | parser.add_argument('--time_offset', default=0, |
|
209 | parser.add_argument('--time_offset', default=0, | |
192 | help='Fix time offset') |
|
210 | help='Fix time offset') | |
193 | parser.add_argument('--range', default=0, type=float, |
|
211 | parser.add_argument('--range', default=0, type=float, | |
194 | help='Max range to plot') |
|
212 | help='Max range to plot') | |
195 | parser.add_argument('--save', action='store_true', |
|
213 | parser.add_argument('--save', action='store_true', | |
196 | help='Create output files') |
|
214 | help='Create output files') | |
197 | parser.add_argument('--show', action='store_true', |
|
215 | parser.add_argument('--show', action='store_true', | |
198 | help='Show matplotlib plot.') |
|
216 | help='Show matplotlib plot.') | |
199 | parser.add_argument('--online', action='store_true', |
|
217 | parser.add_argument('--online', action='store_true', | |
200 | help='Set online mode.') |
|
218 | help='Set online mode.') | |
201 | parser.add_argument('--start_time', default='', |
|
219 | parser.add_argument('--start_time', default='', | |
202 | help='Set start time.') |
|
220 | help='Set start time.') | |
203 |
|
221 | |||
204 |
|
222 | |||
205 | args = parser.parse_args() |
|
223 | args = parser.parse_args() | |
206 |
|
224 | |||
207 | main(args) |
|
225 | main(args) # Operator#ñ8 |
@@ -1,229 +1,229 | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # Ing. AVP |
|
2 | # Ing. AVP | |
3 | # 22/06/2022 |
|
3 | # 22/06/2022 | |
4 | # ARCHIVO DE LECTURA y PLOT |
|
4 | # ARCHIVO DE LECTURA y PLOT | |
5 | import matplotlib.pyplot as pl |
|
5 | import matplotlib.pyplot as pl | |
6 | import matplotlib |
|
6 | import matplotlib | |
7 | import wradlib |
|
7 | import wradlib | |
8 | import numpy |
|
8 | import numpy | |
9 | import warnings |
|
9 | import warnings | |
10 | import argparse |
|
10 | import argparse | |
11 | from wradlib.io import read_generic_hdf5 |
|
11 | from wradlib.io import read_generic_hdf5 | |
12 | from wradlib.util import get_wradlib_data_file |
|
12 | from wradlib.util import get_wradlib_data_file | |
13 | from plotting_codes import sophy_cb_tables |
|
13 | from plotting_codes import sophy_cb_tables | |
14 | import os,time |
|
14 | import os,time | |
15 |
|
15 | |||
16 | for name, cb_table in sophy_cb_tables: |
|
16 | for name, cb_table in sophy_cb_tables: | |
17 | ncmap = matplotlib.colors.ListedColormap(cb_table, name=name) |
|
17 | ncmap = matplotlib.colors.ListedColormap(cb_table, name=name) | |
18 | matplotlib.pyplot.register_cmap(cmap=ncmap) |
|
18 | matplotlib.pyplot.register_cmap(cmap=ncmap) | |
19 | #LINUX bash: export WRADLIB_DATA=/path/to/wradlib-data |
|
19 | #LINUX bash: export WRADLIB_DATA=/path/to/wradlib-data | |
20 | #example |
|
20 | #example | |
21 | #export WRADLIB_DATA="/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/" |
|
21 | #export WRADLIB_DATA="/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/" | |
22 | warnings.filterwarnings('ignore') |
|
22 | warnings.filterwarnings('ignore') | |
23 | PARAM = { |
|
23 | 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): | |
31 | self.list_file = None |
|
31 | self.list_file = None | |
32 | self.grado = None |
|
32 | self.grado = None | |
33 | self.variable = None |
|
33 | self.variable = None | |
34 | self.save = None |
|
34 | self.save = None | |
35 | self.range = None |
|
35 | self.range = None | |
36 |
|
36 | |||
37 | def read_files(self,path_file,grado=None, variable=None): |
|
37 | def read_files(self,path_file,grado=None, variable=None): | |
38 | filter= "_E"+str(grado)+".0_"+variable |
|
38 | filter= "_E"+str(grado)+".0_"+variable | |
39 | validFilelist = [] |
|
39 | validFilelist = [] | |
40 | fileList= os.listdir(path_file) |
|
40 | fileList= os.listdir(path_file) | |
41 | for thisFile in fileList: |
|
41 | for thisFile in fileList: | |
42 | if (os.path.splitext(thisFile)[0][-7:] != filter): |
|
42 | if (os.path.splitext(thisFile)[0][-7:] != filter): | |
43 | #print("s_:",os.path.splitext(thisFile)[0][-7:]) |
|
43 | #print("s_:",os.path.splitext(thisFile)[0][-7:]) | |
44 | continue |
|
44 | continue | |
45 | validFilelist.append(thisFile) |
|
45 | validFilelist.append(thisFile) | |
46 | validFilelist.sort() |
|
46 | validFilelist.sort() | |
47 | return validFilelist |
|
47 | return validFilelist | |
48 |
|
48 | |||
49 | def setup(self, path_file,grado,range,variable,save): |
|
49 | def setup(self, path_file,grado,range,variable,save): | |
50 | self.path_file = path_file |
|
50 | self.path_file = path_file | |
51 | self.range = range |
|
51 | self.range = range | |
52 | self.grado = grado |
|
52 | self.grado = grado | |
53 | self.variable = variable |
|
53 | self.variable = variable | |
54 | self.save = save |
|
54 | self.save = save | |
55 | self.list_file = self.read_files(path_file=self.path_file,grado=self.grado, variable=self.variable) |
|
55 | self.list_file = self.read_files(path_file=self.path_file,grado=self.grado, variable=self.variable) | |
56 |
|
56 | |||
57 | def selectHeights(self,heightList,minHei,maxHei): |
|
57 | def selectHeights(self,heightList,minHei,maxHei): | |
58 |
|
58 | |||
59 | if minHei and maxHei: |
|
59 | if minHei and maxHei: | |
60 | if (minHei < heightList[0]): |
|
60 | if (minHei < heightList[0]): | |
61 | minHei = heightList[0] |
|
61 | minHei = heightList[0] | |
62 | if (maxHei > heightList[-1]): |
|
62 | if (maxHei > heightList[-1]): | |
63 | maxHei = heightList[-1] |
|
63 | maxHei = heightList[-1] | |
64 | minIndex = 0 |
|
64 | minIndex = 0 | |
65 | maxIndex = 0 |
|
65 | maxIndex = 0 | |
66 | heights = heightList |
|
66 | heights = heightList | |
67 |
|
67 | |||
68 | inda = numpy.where(heights >= minHei) |
|
68 | inda = numpy.where(heights >= minHei) | |
69 | indb = numpy.where(heights <= maxHei) |
|
69 | indb = numpy.where(heights <= maxHei) | |
70 |
|
70 | |||
71 | try: |
|
71 | try: | |
72 | minIndex = inda[0][0] |
|
72 | minIndex = inda[0][0] | |
73 | except: |
|
73 | except: | |
74 | minIndex = 0 |
|
74 | minIndex = 0 | |
75 |
|
75 | |||
76 | try: |
|
76 | try: | |
77 | maxIndex = indb[0][-1] |
|
77 | maxIndex = indb[0][-1] | |
78 | except: |
|
78 | except: | |
79 | maxIndex = len(heights) |
|
79 | maxIndex = len(heights) | |
80 |
|
80 | |||
81 | new_heightList= self.selectHeightsByIndex(heightList=heightList,minIndex=minIndex, maxIndex=maxIndex) |
|
81 | new_heightList= self.selectHeightsByIndex(heightList=heightList,minIndex=minIndex, maxIndex=maxIndex) | |
82 |
|
82 | |||
83 | return new_heightList, minIndex,maxIndex |
|
83 | return new_heightList, minIndex,maxIndex | |
84 |
|
84 | |||
85 | def selectHeightsByIndex(self,heightList,minIndex, maxIndex): |
|
85 | def selectHeightsByIndex(self,heightList,minIndex, maxIndex): | |
86 |
|
86 | |||
87 | if (minIndex < 0) or (minIndex > maxIndex): |
|
87 | if (minIndex < 0) or (minIndex > maxIndex): | |
88 | raise ValueError("Height index range (%d,%d) is not valid" % (minIndex, maxIndex)) |
|
88 | raise ValueError("Height index range (%d,%d) is not valid" % (minIndex, maxIndex)) | |
89 |
|
89 | |||
90 | if (maxIndex >= len(heightList)): |
|
90 | if (maxIndex >= len(heightList)): | |
91 | maxIndex = len(heightList) |
|
91 | maxIndex = len(heightList) | |
92 |
|
92 | |||
93 | new_h = heightList[minIndex:maxIndex] |
|
93 | new_h = heightList[minIndex:maxIndex] | |
94 | return new_h |
|
94 | return new_h | |
95 |
|
95 | |||
96 | def readAttributes(self,obj,variable): |
|
96 | def readAttributes(self,obj,variable): | |
97 | var = PARAM[variable]['var'] |
|
97 | var = PARAM[variable]['var'] | |
98 | unit = PARAM[variable]['unit'] |
|
98 | unit = PARAM[variable]['unit'] | |
99 | cmap = PARAM[variable]['cmap'] |
|
99 | cmap = PARAM[variable]['cmap'] | |
100 | vmin = PARAM[variable]['vmin'] |
|
100 | vmin = PARAM[variable]['vmin'] | |
101 | vmax = PARAM[variable]['vmax'] |
|
101 | vmax = PARAM[variable]['vmax'] | |
102 | label = PARAM[variable]['label'] |
|
102 | label = PARAM[variable]['label'] | |
103 | var_ = 'Data/'+var+'/H' |
|
103 | var_ = 'Data/'+var+'/H' | |
104 | data_arr = numpy.array(obj[var_]['data']) # data |
|
104 | data_arr = numpy.array(obj[var_]['data']) # data | |
105 | utc_time = numpy.array(obj['Data/time']['data']) |
|
105 | utc_time = numpy.array(obj['Data/time']['data']) | |
106 | data_azi = numpy.array(obj['Metadata/azimuth']['data']) # th |
|
106 | data_azi = numpy.array(obj['Metadata/azimuth']['data']) # th | |
107 | data_ele = numpy.array(obj["Metadata/elevation"]['data']) |
|
107 | data_ele = numpy.array(obj["Metadata/elevation"]['data']) | |
108 | heightList = numpy.array(obj["Metadata/range"]['data']) # r |
|
108 | heightList = numpy.array(obj["Metadata/range"]['data']) # r | |
109 |
|
109 | |||
110 | return data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label |
|
110 | return data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label | |
111 |
|
111 | |||
112 | def run(self): |
|
112 | def run(self): | |
113 | count= 0 |
|
113 | count= 0 | |
114 | len_files = len(self.list_file) |
|
114 | len_files = len(self.list_file) | |
115 |
|
115 | |||
116 | for thisFile in self.list_file: |
|
116 | for thisFile in self.list_file: | |
117 | count = count +1 |
|
117 | count = count +1 | |
118 | fullpathfile = self.path_file + thisFile |
|
118 | fullpathfile = self.path_file + thisFile | |
119 | filename = get_wradlib_data_file(fullpathfile) |
|
119 | filename = get_wradlib_data_file(fullpathfile) | |
120 | test_hdf5 = read_generic_hdf5(filename) |
|
120 | test_hdf5 = read_generic_hdf5(filename) | |
121 |
|
121 | |||
122 | # LECTURA |
|
122 | # LECTURA | |
123 | data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label = self.readAttributes(obj= test_hdf5,variable=self.variable) |
|
123 | data_arr, utc_time, data_azi,data_ele, heightList,unit,cmap,vmin,vmax,label = self.readAttributes(obj= test_hdf5,variable=self.variable) | |
124 |
|
124 | |||
125 | if self.range==0: |
|
125 | if self.range==0: | |
126 | self.range == heightList[-1] |
|
126 | self.range == heightList[-1] | |
127 | new_heightList,minIndex,maxIndex = self.selectHeights(heightList,0.06,self.range) |
|
127 | new_heightList,minIndex,maxIndex = self.selectHeights(heightList,0.06,self.range) | |
128 |
|
128 | |||
129 | # TIEMPO |
|
129 | # TIEMPO | |
130 | my_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(utc_time[0])) |
|
130 | my_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(utc_time[0])) | |
131 | time_save = time.strftime('%Y%m%d_%H%M%S',time.localtime(utc_time[0])) |
|
131 | time_save = time.strftime('%Y%m%d_%H%M%S',time.localtime(utc_time[0])) | |
132 |
|
132 | |||
133 | # PLOT DATA WITH ANNOTATION |
|
133 | # PLOT DATA WITH ANNOTATION | |
134 | if count ==1: |
|
134 | if count ==1: | |
135 | fig = pl.figure(figsize=(10,8)) |
|
135 | fig = pl.figure(figsize=(10,8)) | |
136 | cgax, pm = wradlib.vis.plot_ppi(data_arr[:,minIndex:maxIndex],r=new_heightList,az=data_azi,rf=1,fig=fig, ax=111,proj='cg',cmap=cmap,vmin=vmin, vmax=vmax) |
|
136 | cgax, pm = wradlib.vis.plot_ppi(data_arr[:,minIndex:maxIndex],r=new_heightList,az=data_azi,rf=1,fig=fig, ax=111,proj='cg',cmap=cmap,vmin=vmin, vmax=vmax) | |
137 | caax = cgax.parasites[0] |
|
137 | caax = cgax.parasites[0] | |
138 | title = 'Simple PPI'+"-"+ my_time+" E."+self.grado |
|
138 | title = 'Simple PPI'+"-"+ my_time+" E."+self.grado | |
139 | t = pl.title(title, fontsize=12,y=1.05) |
|
139 | t = pl.title(title, fontsize=12,y=1.05) | |
140 | cbar = pl.gcf().colorbar(pm, pad=0.075) |
|
140 | cbar = pl.gcf().colorbar(pm, pad=0.075) | |
141 | pl.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') |
|
141 | pl.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') | |
142 | cbar.set_label(label+'[' + unit + ']') |
|
142 | cbar.set_label(label+'[' + unit + ']') | |
143 | gh = cgax.get_grid_helper() |
|
143 | gh = cgax.get_grid_helper() | |
144 | else: |
|
144 | else: | |
145 | cgax, pm = wradlib.vis.plot_ppi(data_arr[:,minIndex:maxIndex],r=new_heightList,az=data_azi,rf=1,fig=fig, ax=111,proj='cg',cmap=cmap,vmin=vmin, vmax=vmax) |
|
145 | cgax, pm = wradlib.vis.plot_ppi(data_arr[:,minIndex:maxIndex],r=new_heightList,az=data_azi,rf=1,fig=fig, ax=111,proj='cg',cmap=cmap,vmin=vmin, vmax=vmax) | |
146 | caax = cgax.parasites[0] |
|
146 | caax = cgax.parasites[0] | |
147 | title = 'Simple PPI'+"-"+my_time+" E."+self.grado |
|
147 | title = 'Simple PPI'+"-"+my_time+" E."+self.grado | |
148 | t = pl.title(title, fontsize=12,y=1.05) |
|
148 | t = pl.title(title, fontsize=12,y=1.05) | |
149 | cbar = pl.gcf().colorbar(pm, pad=0.075) |
|
149 | cbar = pl.gcf().colorbar(pm, pad=0.075) | |
150 | pl.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') |
|
150 | pl.text(1.0, 1.05, 'azimuth', transform=caax.transAxes, va='bottom',ha='right') | |
151 | cbar.set_label(label+'[' + unit + ']') |
|
151 | cbar.set_label(label+'[' + unit + ']') | |
152 | gh = cgax.get_grid_helper() |
|
152 | gh = cgax.get_grid_helper() | |
153 | if self.save == 1: |
|
153 | if self.save == 1: | |
154 | if count ==1: |
|
154 | if count ==1: | |
155 | filename = "SOPHY"+"_"+time_save+"_"+"E."+self.grado+"_"+self.variable+".png" |
|
155 | filename = "SOPHY"+"_"+time_save+"_"+"E."+self.grado+"_"+self.variable+".png" | |
156 | dir =self.variable+"_"+"E."+self.grado+"CH0/" |
|
156 | dir =self.variable+"_"+"E."+self.grado+"CH0/" | |
157 | filesavepath = os.path.join(self.path_file,dir) |
|
157 | filesavepath = os.path.join(self.path_file,dir) | |
158 | try: |
|
158 | try: | |
159 | os.mkdir(filesavepath) |
|
159 | os.mkdir(filesavepath) | |
160 | except: |
|
160 | except: | |
161 | pass |
|
161 | pass | |
162 | else: |
|
162 | else: | |
163 | filename = "SOPHY"+"_"+time_save+"_"+"E."+self.grado+"_"+self.variable+".png" |
|
163 | filename = "SOPHY"+"_"+time_save+"_"+"E."+self.grado+"_"+self.variable+".png" | |
164 | pl.savefig(filesavepath+filename) |
|
164 | pl.savefig(filesavepath+filename) | |
165 |
|
165 | |||
166 | pl.pause(1) |
|
166 | pl.pause(1) | |
167 | pl.clf() |
|
167 | pl.clf() | |
168 | if count==len_files: |
|
168 | if count==len_files: | |
169 | pl.close() |
|
169 | pl.close() | |
170 | pl.show() |
|
170 | pl.show() | |
171 |
|
171 | |||
172 | PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/" |
|
172 | PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T18-00-00/" | |
173 | #PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T19-00-00/" |
|
173 | #PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0N36.0/2022-06-09T19-00-00/" | |
174 |
|
174 | |||
175 | #PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-05-31T12-00-17/paramC0N36.0/2022-05-31T16-00-00/" |
|
175 | #PATH = "/home/soporte/Documents/EVENTO/HYO_PM@2022-05-31T12-00-17/paramC0N36.0/2022-05-31T16-00-00/" | |
176 |
|
176 | |||
177 | def main(args): |
|
177 | def main(args): | |
178 | grado = args.grado |
|
178 | grado = args.grado | |
179 | parameters = args.parameters |
|
179 | parameters = args.parameters | |
180 | save = args.save |
|
180 | save = args.save | |
181 | range = args.range |
|
181 | range = args.range | |
182 | obj = Readsophy() |
|
182 | obj = Readsophy() | |
183 | for param in parameters: |
|
183 | for param in parameters: | |
184 | obj.setup(path_file = PATH,grado = grado,range=range, variable=param,save=int(save)) |
|
184 | obj.setup(path_file = PATH,grado = grado,range=range, variable=param,save=int(save)) | |
185 | obj.run() |
|
185 | obj.run() | |
186 |
|
186 | |||
187 | if __name__ == '__main__': |
|
187 | if __name__ == '__main__': | |
188 |
|
188 | |||
189 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
189 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') | |
190 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
190 | parser.add_argument('--parameters', nargs='*', default=['S'], | |
191 | help='Variables to process: P, Z, V ,W') |
|
191 | help='Variables to process: P, Z, V ,W') | |
192 | parser.add_argument('--grado', default=2, |
|
192 | parser.add_argument('--grado', default=2, | |
193 | help='Angle in Elev to plot') |
|
193 | help='Angle in Elev to plot') | |
194 | parser.add_argument('--save', default=0, |
|
194 | parser.add_argument('--save', default=0, | |
195 | help='Save plot') |
|
195 | help='Save plot') | |
196 | parser.add_argument('--range', default=0, type=float, |
|
196 | parser.add_argument('--range', default=0, type=float, | |
197 | help='Max range to plot') |
|
197 | help='Max range to plot') | |
198 | args = parser.parse_args() |
|
198 | args = parser.parse_args() | |
199 |
|
199 | |||
200 | main(args) |
|
200 | main(args) | |
201 |
|
201 | |||
202 | #python sophy_proc_rev006.py --parameters Z --grado 8 --save 1 --range 28 |
|
202 | #python sophy_proc_rev006.py --parameters Z --grado 8 --save 1 --range 28 | |
203 | ''' |
|
203 | ''' | |
204 | def read_and_overview(filename): |
|
204 | def read_and_overview(filename): | |
205 | """Read HDF5 using read_generic_hdf5 and print upper level dictionary keys |
|
205 | """Read HDF5 using read_generic_hdf5 and print upper level dictionary keys | |
206 | """ |
|
206 | """ | |
207 | test = read_generic_hdf5(filename) |
|
207 | test = read_generic_hdf5(filename) | |
208 | print("\nPrint keys for file %s" % os.path.basename(filename)) |
|
208 | print("\nPrint keys for file %s" % os.path.basename(filename)) | |
209 | for key in test.keys(): |
|
209 | for key in test.keys(): | |
210 | print("\t%s" % key) |
|
210 | print("\t%s" % key) | |
211 | return test |
|
211 | return test | |
212 |
|
212 | |||
213 | file__ = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0_FD_PL_R15.0km/2022-06-09T18-00-00/SOPHY_20220609_180229_E2.0_Z.hdf5" |
|
213 | file__ = "/home/soporte/Documents/EVENTO/HYO_PM@2022-06-09T15-05-12/paramC0_FD_PL_R15.0km/2022-06-09T18-00-00/SOPHY_20220609_180229_E2.0_Z.hdf5" | |
214 |
|
214 | |||
215 |
|
215 | |||
216 | filename = get_wradlib_data_file(file__) |
|
216 | filename = get_wradlib_data_file(file__) | |
217 |
|
217 | |||
218 | print("filename:\n",filename ) |
|
218 | print("filename:\n",filename ) | |
219 |
|
219 | |||
220 | test= read_and_overview(filename) |
|
220 | test= read_and_overview(filename) | |
221 | # ANADIR INFORMACION |
|
221 | # ANADIR INFORMACION | |
222 | # informacion de los pulsos de TX |
|
222 | # informacion de los pulsos de TX | |
223 | # informacion de los ruidos |
|
223 | # informacion de los ruidos | |
224 | # informacion de los SNR ¿? |
|
224 | # informacion de los SNR ¿? | |
225 | # Aumentar la amplitud de la USRP |
|
225 | # Aumentar la amplitud de la USRP | |
226 | LAST_UPDATE |
|
226 | LAST_UPDATE | |
227 | ---- Noise |
|
227 | ---- Noise | |
228 | ---- Mapas |
|
228 | ---- Mapas | |
229 | ''' |
|
229 | ''' |
General Comments 0
You need to be logged in to leave comments.
Login now