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

updates for icing intensity

parent 3e8bfbf7
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
ice_dict = {}
neg_ice_dict = {}
no_ice_dict = {}
with open(filename) as file:
for idx, line in enumerate(file):
......@@ -75,7 +76,7 @@ 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, ice_str)
tup = (lat, lon, fl, 0, ice_str)
if rpts is None:
rpts = []
rpts.append(tup)
......@@ -133,4 +134,13 @@ def pirep_icing(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
else:
rpts.append(tup)
return ice_dict, neg_ice_dict
rpts = no_ice_dict.get(timestmp)
tup = (lat, lon, fl, 0, 'no observed icing')
if rpts is None:
rpts = []
rpts.append(tup)
no_ice_dict[timestmp] = rpts
else:
rpts.append(tup)
return ice_dict, no_ice_dict, neg_ice_dict
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