From 7001f37b153b9501e37caead28ad0410c63c2cab Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Thu, 4 Feb 2021 17:02:59 -0600
Subject: [PATCH] snapshot...

---
 modules/amv/intercompare.py | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/amv/intercompare.py b/modules/amv/intercompare.py
index 892d000f..32380b3e 100644
--- a/modules/amv/intercompare.py
+++ b/modules/amv/intercompare.py
@@ -62,6 +62,9 @@ def pireps(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
 
     # HEADER: VALID,URGENT,AIRCRAFT,REPORT,LAT,LON
 
+    ice_dict = {}
+    no_ice_dict = {}
+
     with open(filename) as file:
         for idx, line in enumerate(file):
             toks = line.split(',')
@@ -111,6 +114,14 @@ def pireps(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
 
                 if len(re.findall(NO_ICE, ice_str)) != 0:
                     no_ice_reports.append(ice_str)
+                    rpts = no_ice_dict.get(timestmp)
+                    tup = (lat, lon, fl, ice_str)
+                    if rpts is None:
+                        rpts = []
+                        rpts.append(tup)
+                        no_ice_dict[timestmp] = rpts
+                    else:
+                        rpts.append(tup)
                 else:
                     ice_reports.append(ice_str)
                     so = re.search(ICE_LVL, ice_str)
@@ -125,13 +136,21 @@ def pireps(filename, lon_range=[-180, 180], lat_range=[-55, 55]):
 
                         fl = max(lvl_a, lvl_b)
 
+                    rpts = ice_dict.get(timestmp)
+                    tup = (lat, lon, fl, ice_str)
+                    if rpts is None:
+                        rpts = []
+                        rpts.append(tup)
+                        ice_dict[timestmp] = rpts
+                    else:
+                        rpts.append(tup)
+
                 lats.append(lat)
                 lons.append(lon)
                 alts.append(fl)
                 times.append(timestmp)
 
-    lats = np.array(lats)
-    lons = np.array(lons)
+    return ice_dict, no_ice_dict
 
 
 def get_amv_nd(filename):
-- 
GitLab