From edef01e1bc8b2a997edbfa92fe03e6c5ec5c05b1 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Sun, 28 Apr 2024 13:12:06 -0500
Subject: [PATCH] snapshot...

---
 modules/icing/pirep_goes.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index d2028a9b..d11b017f 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -1465,10 +1465,10 @@ def apply_qc_icing_pireps_exp2(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cl
 
 def apply_qc_icing_pireps_v3(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_top_temp, day_night='ANY', cloudy_frac=0.5):
 
-    closeness_top = 50.0  # meters
-    max_cld_depth = 500.0
+    closeness_top = 100.0  # meters
+    max_cld_depth = 800.0
     max_altitude = 4500.0
-    max_cld_altitude = 4000.0
+    max_cld_altitude = 4500.0
 
     num_obs = len(icing_alt)
     cld_mask = cld_mask.reshape((num_obs, -1))
@@ -1503,19 +1503,22 @@ def apply_qc_icing_pireps_v3(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_
         if num_keep / nx_x_ny < cloudy_frac:  # At least this fraction cloudy
             continue
 
+        if icing_alt[i,] > max_altitude:
+            continue
+
         # ctt_mean = np.nanmean(cld_top_temp[i,])
         # if ctt_mean > 274.0:
         #     continue
 
-        # if icing_alt[i,] > max_altitude:
-        #     continue
-
         # cth_mean = np.nanmean(cld_top_hgt[i,])
         # if not (closeness_top+cth_mean > icing_alt[i,] > cth_mean - max_cld_depth):
         #     continue
 
+        keep = np.where(keep, cld_top_hgt[i,] < max_cld_altitude, False)
+
         keep = np.where(keep, np.logical_and((cld_top_hgt[i,] + closeness_top) > icing_alt[i,],
                                   (cld_top_hgt[i,] - max_cld_depth) < icing_alt[i,]), False)
+
         # keep = np.where(keep, np.logical_and(cld_top_temp[i,] > 228.0, cld_top_temp[i,] < 274.0), False)
 
         mask.append(keep)
-- 
GitLab