Skip to content
Snippets Groups Projects
Commit 866cf7db authored by tomrink's avatar tomrink
Browse files

try to eliminate adjacent duplicate pilot reports

parent 383f473b
No related branches found
No related tags found
No related merge requests found
......@@ -227,26 +227,33 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
else:
h5f = last_h5f
cc = ll = -1
reports = pirep_dct[time]
for tup in reports:
lat, lon, fl, I, uid, rpt_str = tup
lat_s[0] = lat
lon_s[0] = lon
cc, ll = nav.earth_to_lc_s(lon_s, lat_s)
if cc[0] < 0:
cc_a, ll_a = nav.earth_to_lc_s(lon_s, lat_s) # non-navigable, skip
if cc_a[0] < 0:
continue
if cc_a[0] == cc and ll_a[0] == ll: # time adjacent duplicate, skip
continue
else:
cc = cc_a[0]
ll = ll_a[0]
cnt_a = 0
for didx, ds_name in enumerate(ds_list):
gvals = get_grid_values(h5f, ds_name, ll[0], cc[0], 20)
gvals = get_grid_values(h5f, ds_name, ll_a[0], cc_a[0], 20)
if gvals is not None:
ds_grd_dct[ds_name].append(gvals)
cnt_a += 1
cnt_b = 0
for didx, ds_name in enumerate(l1b_ds_list):
gvals = get_grid_values(h5f, ds_name, ll[0], cc[0], 20)
gvals = get_grid_values(h5f, ds_name, ll_a[0], cc_a[0], 20)
if gvals is not None:
l1b_grd_dct[ds_name].append(gvals)
cnt_b += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment