diff --git a/modules/icing/pireps.py b/modules/icing/pireps.py index 47cfd1373d269d8c79f8b51cee21110e89bcfd3b..fa2ce9bdb9312a4663ea43c1cd040d46cb9ee8c4 100644 --- a/modules/icing/pireps.py +++ b/modules/icing/pireps.py @@ -27,6 +27,10 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): neg_ice_dict = {} no_ice_dict = {} + cnt_ice = 0 + cnt_no_ice = 0 + cnt_neg_ice = 0 + with open(filename) as file: for idx, line in enumerate(file): toks = line.split(',') @@ -77,7 +81,8 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): if len(re.findall(NO_ICE, ice_str)) != 0: rpts = neg_ice_dict.get(timestmp) - tup = (lat, lon, fl, -1, ice_str) + tup = (lat, lon, fl, -1, cnt_neg_ice, ice_str) + cnt_neg_ice += 1 if rpts is None: rpts = [] rpts.append(tup) @@ -127,7 +132,8 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): I = 6 rpts = ice_dict.get(timestmp) - tup = (lat, lon, fl, I, ice_str) + tup = (lat, lon, fl, I, cnt_ice, ice_str) + cnt_ice += 1 if rpts is None: rpts = [] rpts.append(tup) @@ -136,7 +142,8 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]): rpts.append(tup) rpts = no_ice_dict.get(timestmp) - tup = (lat, lon, fl, -1, 'no observed icing') + tup = (lat, lon, fl, -1, cnt_no_ice, 'no observed icing') + cnt_no_ice += 1 if rpts is None: rpts = [] rpts.append(tup)