diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index acf468f711205cd5de4072d9426cdb4b568b4e17..7d01553fb64a70d4c0497dae1cf9f68cc41d6172 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -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