diff --git a/modules/icing/pireps.py b/modules/icing/pireps.py index 6b46115a137d2551143d8d547b475983cccb8358..8d68bfde2764e65381899ae39e124ff3027e45fc 100644 --- a/modules/icing/pireps.py +++ b/modules/icing/pireps.py @@ -17,15 +17,13 @@ ATYPE = '/TP' RMK = '/RM' -# Returns icing/non-icing +# Returns icing/neg-icing def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): - no_ice_reports = [] - ice_reports = [] # HEADER: VALID,URGENT,AIRCRAFT,REPORT,LAT,LON ice_dict = {} - no_ice_dict = {} + neg_ice_dict = {} with open(filename) as file: for idx, line in enumerate(file): @@ -76,17 +74,15 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): timestmp = dto.timestamp() if len(re.findall(NO_ICE, ice_str)) != 0: - no_ice_reports.append(ice_str) - rpts = no_ice_dict.get(timestmp) + rpts = neg_ice_dict.get(timestmp) tup = (lat, lon, fl, ice_str) if rpts is None: rpts = [] rpts.append(tup) - no_ice_dict[timestmp] = rpts + neg_ice_dict[timestmp] = rpts else: rpts.append(tup) else: - ice_reports.append(ice_str) so = re.search(ICE_LVL, ice_str) if so is not None: lvl_a, lvl_b = so.group().split('-') @@ -137,4 +133,4 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): else: rpts.append(tup) - return ice_dict, no_ice_dict + return ice_dict, neg_ice_dict