@@ -1,190 +1,190 | |||
|
1 | 1 | # SOPHY PROC script |
|
2 | 2 | import os, sys, json, argparse |
|
3 | 3 | import datetime |
|
4 | 4 | import time |
|
5 | 5 | |
|
6 | 6 | PATH = '/DATA_RM/DATA' |
|
7 | 7 | # PATH = '/Users/jespinoza/workspace/data/' |
|
8 | 8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' |
|
9 | 9 | PATH = '/home/soporte/Downloads/data_WR_RHI' |
|
10 | 10 | PATH = '/home/soporte/Documents/EVENTO/' |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | PARAM = { |
|
14 | 14 | 'S': {'name': 'dataPP_POWER', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
15 | 15 | #'V': {'name': 'dataPP_DOP', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
16 | 16 | 'V': {'name': 'velRadial_V', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
17 | 17 | 'R': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, |
|
18 | 18 | 'P': {'name': 'PhiD_P', 'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'ΒΊ', 'ch':0}, |
|
19 | 19 | 'D': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'gist_ncar','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, |
|
20 | 20 | 'Z': {'name': 'Zdb', 'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, |
|
21 | 21 | 'W': {'name': 'Sigmav_W', 'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': 'hz', 'ch':1} |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | def max_index(r, sample_rate, ipp): |
|
25 | 25 | |
|
26 | 26 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) |
|
27 | 27 | |
|
28 | 28 | def main(args): |
|
29 | 29 | |
|
30 | 30 | experiment = args.experiment |
|
31 | 31 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) |
|
32 | 32 | conf = json.loads(fp.read()) |
|
33 | 33 | |
|
34 | 34 | ipp_km = conf['usrp_tx']['ipp'] |
|
35 | 35 | ipp = ipp_km * 2 /300000 |
|
36 | 36 | sample_rate = conf['usrp_rx']['sample_rate'] |
|
37 | 37 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 |
|
38 | 38 | speed_axis = conf['pedestal']['speed'] |
|
39 | 39 | steps = conf['pedestal']['table'] |
|
40 | 40 | time_offset = args.time_offset |
|
41 | 41 | parameters = args.parameters |
|
42 | 42 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') |
|
43 | 43 | end_date = start_date |
|
44 | 44 | if args.start_time: |
|
45 | 45 | start_time = args.start_time |
|
46 | 46 | else: |
|
47 | 47 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') |
|
48 | 48 | #start_time = '16:15:00' |
|
49 | 49 | end_time = '23:59:59' |
|
50 | 50 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION |
|
51 | 51 | path = os.path.join(PATH, experiment, 'rawdata') |
|
52 | 52 | path_ped = os.path.join(PATH, experiment, 'position') |
|
53 |
path_plots = os.path.join(PATH, experiment, 'plotsC0_PC_R |
|
|
54 | path_save = os.path.join(PATH, experiment, 'param') | |
|
53 | path_plots = os.path.join(PATH, experiment, 'plotsC0_PC_R'+str(args.range)+'km') | |
|
54 | path_save = os.path.join(PATH, experiment, 'paramC0_PC_R'+str(args.range)+'km') | |
|
55 | 55 | RMIX = 1.62 |
|
56 | 56 | |
|
57 | 57 | from schainpy.controller import Project |
|
58 | 58 | |
|
59 | 59 | project = Project() |
|
60 | 60 | project.setup(id='1', name='Sophy', description='sophy proc') |
|
61 | 61 | |
|
62 | 62 | reader = project.addReadUnit(datatype='DigitalRFReader', |
|
63 | 63 | path=path, |
|
64 | 64 | startDate=start_date, |
|
65 | 65 | endDate=end_date, |
|
66 | 66 | startTime=start_time, |
|
67 | 67 | endTime=end_time, |
|
68 | 68 | delay=30, |
|
69 | 69 | online=args.online, |
|
70 | 70 | walk=1, |
|
71 | 71 | ippKm = ipp_km, |
|
72 | 72 | getByBlock = 1, |
|
73 | 73 | nProfileBlocks = N, |
|
74 | 74 | ) |
|
75 | 75 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
76 | 76 | |
|
77 | 77 | op = voltage.addOperation(name='ProfileSelector') |
|
78 | 78 | op.addParameter(name='profileRangeList', value='0,{}'.format(conf['usrp_tx']['repetitions_1']-1)) |
|
79 | 79 | |
|
80 | 80 | if conf['usrp_tx']['code_type_1'] != 'None': |
|
81 | 81 | codes = [ c.strip() for c in conf['usrp_tx']['code_1'].split(',')] |
|
82 | 82 | code = [] |
|
83 | 83 | for c in codes: |
|
84 | 84 | code.append([int(x) for x in c]) |
|
85 | 85 | op = voltage1.addOperation(name='Decoder', optype='other') |
|
86 | 86 | op.addParameter(name='code', value=code) |
|
87 | 87 | op.addParameter(name='nCode', value=len(code), format='int') |
|
88 | 88 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
89 | 89 | else: |
|
90 | 90 | code=[[1]] |
|
91 | 91 | |
|
92 | 92 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
93 | 93 | op.addParameter(name='n', value=2, format='int') |
|
94 | 94 | |
|
95 | 95 | op = voltage.addOperation(name='setH0') |
|
96 | 96 | op.addParameter(name='h0', value='-1.68') |
|
97 | 97 | |
|
98 | 98 | if args.range > 0: |
|
99 | 99 | op = voltage.addOperation(name='selectHeights') |
|
100 | 100 | op.addParameter(name='minIndex', value='0', format='int') |
|
101 | 101 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
102 | 102 | |
|
103 | 103 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') |
|
104 | 104 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_1'])/2, format='int') |
|
105 | 105 | |
|
106 | 106 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) |
|
107 | 107 | |
|
108 | 108 | opObj10 = proc.addOperation(name="WeatherRadar") |
|
109 | 109 | opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') |
|
110 | 110 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
111 | 111 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
112 | 112 | |
|
113 | 113 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} |
|
114 | 114 | |
|
115 | 115 | op = proc.addOperation(name='PedestalInformation') |
|
116 | 116 | op.addParameter(name='path', value=path_ped, format='str') |
|
117 | 117 | op.addParameter(name='interval', value='0.04') |
|
118 | 118 | op.addParameter(name='time_offset', value=time_offset) |
|
119 | 119 | #op.addParameter(name='az_offset', value=-26.2) |
|
120 | 120 | op.addParameter(name='mode', value='PPI') |
|
121 | 121 | |
|
122 | 122 | for param in parameters: |
|
123 | 123 | op = proc.addOperation(name='Block360') |
|
124 | 124 | op.addParameter(name='attr_data', value=PARAM[param]['name']) |
|
125 | 125 | op.addParameter(name='runNextOp', value=True) |
|
126 | 126 | |
|
127 | 127 | op= proc.addOperation(name='WeatherParamsPlot') |
|
128 | 128 | if args.save: op.addParameter(name='save', value=path_plots, format='str') |
|
129 | 129 | op.addParameter(name='save_period', value=-1) |
|
130 | 130 | op.addParameter(name='show', value=args.show) |
|
131 | 131 | op.addParameter(name='channels', value='0,') |
|
132 | 132 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) |
|
133 | 133 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) |
|
134 | 134 | op.addParameter(name='attr_data', value=PARAM[param]['name'], format='str') |
|
135 | 135 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
136 | 136 | op.addParameter(name='save_code', value=param) |
|
137 | 137 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
138 | 138 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
139 | 139 | op.addParameter(name='bgcolor',value='black') |
|
140 | 140 | op.addParameter(name='snr_threshold',value=0.4) |
|
141 | 141 | |
|
142 | 142 | desc = { |
|
143 | 143 | 'Data': { |
|
144 | 144 | PARAM[param]['name']: PARAM[param]['wrname'], |
|
145 | 145 | 'utctime': 'time' |
|
146 | 146 | }, |
|
147 | 147 | 'Metadata': { |
|
148 | 148 | 'heightList': 'range', |
|
149 | 149 | 'data_azi': 'azimuth', |
|
150 | 150 | 'data_ele': 'elevation', |
|
151 | 151 | } |
|
152 | 152 | } |
|
153 | 153 | |
|
154 | 154 | if args.save: |
|
155 | 155 | opObj10 = proc.addOperation(name='HDFWriter') |
|
156 | 156 | opObj10.addParameter(name='path', value=path_save, format='str') |
|
157 | 157 | opObj10.addParameter(name='Reset', value=True) |
|
158 | 158 | opObj10.addParameter(name='setType', value='weather') |
|
159 | 159 | opObj10.addParameter(name=' description', value=json.dumps(desc)) |
|
160 | 160 | opObj10.addParameter(name='blocksPerFile', value='1',format='int') |
|
161 | 161 | opObj10.addParameter(name='metadataList', value='heightList,data_azi,data_ele') |
|
162 | 162 | opObj10.addParameter(name='dataList', value='{},utctime'.format(PARAM[param]['name'])) |
|
163 | 163 | project.start() |
|
164 | 164 | |
|
165 | 165 | |
|
166 | 166 | |
|
167 | 167 | if __name__ == '__main__': |
|
168 | 168 | |
|
169 | 169 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
170 | 170 | parser.add_argument('experiment', |
|
171 | 171 | help='Experiment name') |
|
172 | 172 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
173 | 173 | help='Variables to process: P, Z, V') |
|
174 | 174 | parser.add_argument('--time_offset', default=0, |
|
175 | 175 | help='Fix time offset') |
|
176 | 176 | parser.add_argument('--range', default=0, type=float, |
|
177 | 177 | help='Max range to plot') |
|
178 | 178 | parser.add_argument('--save', action='store_true', |
|
179 | 179 | help='Create output files') |
|
180 | 180 | parser.add_argument('--show', action='store_true', |
|
181 | 181 | help='Show matplotlib plot.') |
|
182 | 182 | parser.add_argument('--online', action='store_true', |
|
183 | 183 | help='Set online mode.') |
|
184 | 184 | parser.add_argument('--start_time', default='', |
|
185 | 185 | help='Set start time.') |
|
186 | 186 | |
|
187 | 187 | |
|
188 | 188 | args = parser.parse_args() |
|
189 | 189 | |
|
190 | 190 | main(args) |
@@ -1,194 +1,194 | |||
|
1 | 1 | # SOPHY PROC script |
|
2 | 2 | import os, sys, json, argparse |
|
3 | 3 | import datetime |
|
4 | 4 | import time |
|
5 | 5 | |
|
6 | 6 | PATH = '/DATA_RM/DATA' |
|
7 | 7 | # PATH = '/Users/jespinoza/workspace/data/' |
|
8 | 8 | #PATH = '/home/roberto/DATA/data_WR_RHI/RHI' |
|
9 | 9 | PATH = '/home/soporte/Downloads/data_WR_RHI' |
|
10 | 10 | PATH = '/home/soporte/Documents/EVENTO/' |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | PARAM = { |
|
14 | 14 | 'S': {'name': 'dataPP_POWER', 'zmin': -45, 'zmax': -15, 'colormap': 'jet', 'label': 'Power', 'wrname': 'power','cb_label': 'dBm', 'ch':0}, |
|
15 | 15 | #'V': {'name': 'dataPP_DOP', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
16 | 16 | 'V': {'name': 'velRadial_V', 'zmin': -10, 'zmax': 10, 'colormap': 'sophy_v', 'label': 'Velocity', 'wrname': 'velocity', 'cb_label': 'm/s', 'ch':0}, |
|
17 | 17 | 'R': {'name': 'RhoHV_R', 'zmin': 0, 'zmax': 1, 'colormap': 'jet', 'label': 'RhoHV', 'wrname':'rhoHV', 'cb_label': '*', 'ch':0}, |
|
18 | 18 | 'P': {'name': 'PhiD_P', 'zmin': -180,'zmax': 180,'colormap': 'RdBu_r', 'label': 'PhiDP', 'wrname':'phiDP' , 'cb_label': 'ΒΊ', 'ch':0}, |
|
19 | 19 | 'D': {'name': 'Zdb_D', 'zmin': -20, 'zmax': 80, 'colormap': 'gist_ncar','label': 'ZDR','wrname':'differential_reflectivity' , 'cb_label': 'dBz','ch':0}, |
|
20 | 20 | 'Z': {'name': 'Zdb', 'zmin': -30, 'zmax': 80, 'colormap': 'sophy_r','label': 'Reflectivity', 'wrname':'reflectivity', 'cb_label': 'dBz','ch':1}, |
|
21 | 21 | 'W': {'name': 'Sigmav_W', 'zmin': 0, 'zmax': 12, 'colormap': 'sophy_w','label': 'Spectral Width', 'wrname':'spectral_width', 'cb_label': 'hz', 'ch':1} |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | def max_index(r, sample_rate, ipp): |
|
25 | 25 | |
|
26 | 26 | return int(sample_rate*ipp*1e6 * r / 60) + int(sample_rate*ipp*1e6 * 1.2 / 60) |
|
27 | 27 | |
|
28 | 28 | def main(args): |
|
29 | 29 | |
|
30 | 30 | experiment = args.experiment |
|
31 | 31 | fp = open(os.path.join(PATH, experiment, 'experiment.conf')) |
|
32 | 32 | conf = json.loads(fp.read()) |
|
33 | 33 | |
|
34 | 34 | ipp_km = conf['usrp_tx']['ipp'] |
|
35 | 35 | ipp = ipp_km * 2 /300000 |
|
36 | 36 | sample_rate = conf['usrp_rx']['sample_rate'] |
|
37 | 37 | axis = ['0' if x=='elevation' else '1' for x in conf['pedestal']['axis']] # AZIMUTH 1 ELEVACION 0 |
|
38 | 38 | speed_axis = conf['pedestal']['speed'] |
|
39 | 39 | steps = conf['pedestal']['table'] |
|
40 | 40 | time_offset = args.time_offset |
|
41 | 41 | parameters = args.parameters |
|
42 | 42 | start_date = experiment.split('@')[1].split('T')[0].replace('-', '/') |
|
43 | 43 | end_date = start_date |
|
44 | 44 | if args.start_time: |
|
45 | 45 | start_time = args.start_time |
|
46 | 46 | else: |
|
47 | 47 | start_time = experiment.split('@')[1].split('T')[1].replace('-', ':') |
|
48 | 48 | #start_time = '16:15:00' |
|
49 | 49 | end_time = '23:59:59' |
|
50 | 50 | N = int(1/(speed_axis[0]*ipp)) # 1 GRADO DE RESOLUCION |
|
51 | 51 | path = os.path.join(PATH, experiment, 'rawdata') |
|
52 | 52 | path_ped = os.path.join(PATH, experiment, 'position') |
|
53 |
path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R |
|
|
54 | path_save = os.path.join(PATH, experiment, 'param') | |
|
53 | path_plots = os.path.join(PATH, experiment, 'plotsC0_PL_R'+str(args.range)+'km') | |
|
54 | path_save = os.path.join(PATH, experiment, 'paramC0_PL_R'+str(args.range)+'km') | |
|
55 | 55 | RMIX = 1.62 |
|
56 | 56 | |
|
57 | 57 | from schainpy.controller import Project |
|
58 | 58 | |
|
59 | 59 | project = Project() |
|
60 | 60 | project.setup(id='1', name='Sophy', description='sophy proc') |
|
61 | 61 | |
|
62 | 62 | reader = project.addReadUnit(datatype='DigitalRFReader', |
|
63 | 63 | path=path, |
|
64 | 64 | startDate=start_date, |
|
65 | 65 | endDate=end_date, |
|
66 | 66 | startTime=start_time, |
|
67 | 67 | endTime=end_time, |
|
68 | 68 | delay=30, |
|
69 | 69 | online=args.online, |
|
70 | 70 | walk=1, |
|
71 | 71 | ippKm = ipp_km, |
|
72 | 72 | getByBlock = 1, |
|
73 | 73 | nProfileBlocks = N, |
|
74 | 74 | ) |
|
75 | 75 | voltage = project.addProcUnit(datatype='VoltageProc', inputId=reader.getId()) |
|
76 | 76 | |
|
77 | 77 | op = voltage.addOperation(name='ProfileSelector') |
|
78 | 78 | op.addParameter(name='profileRangeList', value='{},{}'.format(conf['usrp_tx']['repetitions_1'], conf['usrp_tx']['repetitions_1']+conf['usrp_tx']['repetitions_2']-1)) |
|
79 | 79 | |
|
80 | 80 | |
|
81 | 81 | |
|
82 | 82 | |
|
83 | 83 | if conf['usrp_tx']['code_type_2']: |
|
84 | 84 | codes = [ c.strip() for c in conf['usrp_tx']['code_2'].split(',')] |
|
85 | 85 | code = [] |
|
86 | 86 | for c in codes: |
|
87 | 87 | code.append([int(x) for x in c]) |
|
88 | 88 | op = voltage.addOperation(name='Decoder', optype='other') |
|
89 | 89 | op.addParameter(name='code', value=code) |
|
90 | 90 | op.addParameter(name='nCode', value=len(code), format='int') |
|
91 | 91 | op.addParameter(name='nBaud', value=len(code[0]), format='int') |
|
92 | 92 | |
|
93 | 93 | op = voltage.addOperation(name='CohInt', optype='other') #Minimo integrar 2 perfiles por ser codigo complementario |
|
94 | 94 | op.addParameter(name='n', value=len(code), format='int') |
|
95 | 95 | ncode = len(code) |
|
96 | 96 | else: |
|
97 | 97 | ncode = 1 |
|
98 | 98 | |
|
99 | 99 | op = voltage.addOperation(name='setH0') |
|
100 | 100 | op.addParameter(name='h0', value='-1.68') |
|
101 | 101 | |
|
102 | 102 | if args.range > 0: |
|
103 | 103 | op = voltage.addOperation(name='selectHeights') |
|
104 | 104 | op.addParameter(name='minIndex', value='0', format='int') |
|
105 | 105 | op.addParameter(name='maxIndex', value=max_index(args.range, sample_rate, ipp), format='int') |
|
106 | 106 | |
|
107 | 107 | op = voltage.addOperation(name='PulsePair_vRF', optype='other') |
|
108 | 108 | op.addParameter(name='n', value=int(conf['usrp_tx']['repetitions_1'])/2, format='int') |
|
109 | 109 | |
|
110 | 110 | proc = project.addProcUnit(datatype='ParametersProc', inputId=voltage.getId()) |
|
111 | 111 | |
|
112 | 112 | opObj10 = proc.addOperation(name="WeatherRadar") |
|
113 | 113 | opObj10.addParameter(name='variableList',value='Reflectividad,VelocidadRadial,AnchoEspectral') |
|
114 | 114 | opObj10.addParameter(name='tauW',value=(1e-6/sample_rate)*len(code[0])) |
|
115 | 115 | opObj10.addParameter(name='Pt',value=((1e-6/sample_rate)*len(code[0])/ipp)*200) |
|
116 | 116 | |
|
117 | 117 | # {"latitude": -12.0404828587, "longitude": -75.2147483647, "altitude": 3379.2147483647} |
|
118 | 118 | |
|
119 | 119 | op = proc.addOperation(name='PedestalInformation') |
|
120 | 120 | op.addParameter(name='path', value=path_ped, format='str') |
|
121 | 121 | op.addParameter(name='interval', value='0.04') |
|
122 | 122 | op.addParameter(name='time_offset', value=time_offset) |
|
123 | 123 | #op.addParameter(name='az_offset', value=-26.2) |
|
124 | 124 | op.addParameter(name='mode', value='PPI') |
|
125 | 125 | |
|
126 | 126 | for param in parameters: |
|
127 | 127 | op = proc.addOperation(name='Block360') |
|
128 | 128 | op.addParameter(name='attr_data', value=PARAM[param]['name']) |
|
129 | 129 | op.addParameter(name='runNextOp', value=True) |
|
130 | 130 | |
|
131 | 131 | op= proc.addOperation(name='WeatherParamsPlot') |
|
132 | 132 | if args.save: op.addParameter(name='save', value=path_plots, format='str') |
|
133 | 133 | op.addParameter(name='save_period', value=-1) |
|
134 | 134 | op.addParameter(name='show', value=args.show) |
|
135 | 135 | op.addParameter(name='channels', value='0,') |
|
136 | 136 | op.addParameter(name='zmin', value=PARAM[param]['zmin']) |
|
137 | 137 | op.addParameter(name='zmax', value=PARAM[param]['zmax']) |
|
138 | 138 | op.addParameter(name='attr_data', value=PARAM[param]['name'], format='str') |
|
139 | 139 | op.addParameter(name='labels', value=[PARAM[param]['label']]) |
|
140 | 140 | op.addParameter(name='save_code', value=param) |
|
141 | 141 | op.addParameter(name='cb_label', value=PARAM[param]['cb_label']) |
|
142 | 142 | op.addParameter(name='colormap', value=PARAM[param]['colormap']) |
|
143 | 143 | op.addParameter(name='bgcolor',value='black') |
|
144 | 144 | op.addParameter(name='snr_threshold',value=0.4) |
|
145 | 145 | |
|
146 | 146 | desc = { |
|
147 | 147 | 'Data': { |
|
148 | 148 | PARAM[param]['name']: PARAM[param]['wrname'], |
|
149 | 149 | 'utctime': 'time' |
|
150 | 150 | }, |
|
151 | 151 | 'Metadata': { |
|
152 | 152 | 'heightList': 'range', |
|
153 | 153 | 'data_azi': 'azimuth', |
|
154 | 154 | 'data_ele': 'elevation', |
|
155 | 155 | } |
|
156 | 156 | } |
|
157 | 157 | |
|
158 | 158 | if args.save: |
|
159 | 159 | opObj10 = proc.addOperation(name='HDFWriter') |
|
160 | 160 | opObj10.addParameter(name='path', value=path_save, format='str') |
|
161 | 161 | opObj10.addParameter(name='Reset', value=True) |
|
162 | 162 | opObj10.addParameter(name='setType', value='weather') |
|
163 | 163 | opObj10.addParameter(name=' description', value=json.dumps(desc)) |
|
164 | 164 | opObj10.addParameter(name='blocksPerFile', value='1',format='int') |
|
165 | 165 | opObj10.addParameter(name='metadataList', value='heightList,data_azi,data_ele') |
|
166 | 166 | opObj10.addParameter(name='dataList', value='{},utctime'.format(PARAM[param]['name'])) |
|
167 | 167 | project.start() |
|
168 | 168 | |
|
169 | 169 | |
|
170 | 170 | |
|
171 | 171 | if __name__ == '__main__': |
|
172 | 172 | |
|
173 | 173 | parser = argparse.ArgumentParser(description='Script to process SOPHy data.') |
|
174 | 174 | parser.add_argument('experiment', |
|
175 | 175 | help='Experiment name') |
|
176 | 176 | parser.add_argument('--parameters', nargs='*', default=['S'], |
|
177 | 177 | help='Variables to process: P, Z, V') |
|
178 | 178 | parser.add_argument('--time_offset', default=0, |
|
179 | 179 | help='Fix time offset') |
|
180 | 180 | parser.add_argument('--range', default=0, type=float, |
|
181 | 181 | help='Max range to plot') |
|
182 | 182 | parser.add_argument('--save', action='store_true', |
|
183 | 183 | help='Create output files') |
|
184 | 184 | parser.add_argument('--show', action='store_true', |
|
185 | 185 | help='Show matplotlib plot.') |
|
186 | 186 | parser.add_argument('--online', action='store_true', |
|
187 | 187 | help='Set online mode.') |
|
188 | 188 | parser.add_argument('--start_time', default='', |
|
189 | 189 | help='Set start time.') |
|
190 | 190 | |
|
191 | 191 | |
|
192 | 192 | args = parser.parse_args() |
|
193 | 193 | |
|
194 | 194 | main(args) |
General Comments 0
You need to be logged in to leave comments.
Login now