From 7e6db99ba293b6fdc1b9eab782fa6f5926480b58 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Fri, 16 Dec 2022 11:39:46 -0600
Subject: [PATCH] snapshot...

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

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index 37c78d7c..42037d0a 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -1222,7 +1222,7 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing
 #     return mask, idxs, num_tested
 
 
-def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_temp, day_night='ANY', cloud_fraction=0.5):
+def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_top_temp, day_night='ANY', cloud_fraction=0.5):
 
     if day_night == 'DAY':
         opd_thick_threshold = 20
@@ -1278,11 +1278,13 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd
         # keep = np.where(keep, np.logical_and(bt_11um[i,] > 228.0, bt_11um[i,] < 270.0), False)
         # keep = np.where(keep, bt_11um[i,] < 275.0, False)
 
-        med_cld_hgt = np.median(cld_top_hgt[i, keep])
+        cld_hgt = cld_top_hgt[i, ].flatten()
+        med_cld_hgt = np.median(cld_hgt[keep])
         if icing_alt[i] > med_cld_hgt:
             continue
 
-        med_cld_tmp = np.median(cld_temp[i, keep])
+        cld_tmp = cld_top_temp[i, ].flatten()
+        med_cld_tmp = np.median(cld_tmp[keep])
         if med_cld_tmp > 274.5:
             continue
 
@@ -1296,7 +1298,7 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd
     return mask, idxs, num_tested
 
 
-def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, cld_temp, day_night='ANY', cloudy_frac=0.5):
+def apply_qc_no_icing_pireps(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):
 
     if day_night == 'DAY':
         opd_thick_threshold = 20
@@ -1352,11 +1354,13 @@ def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_geo_dz, cld_phase, cld_
         # keep = np.where(keep, np.logical_and(bt_11um[i,] > 228.0, bt_11um[i,] < 270.0), False)
         # keep = np.where(keep, bt_11um[i,] < 275.0, False)
 
-        med_cld_hgt = np.median(cld_top_hgt[i, keep])
+        cld_hgt = cld_top_hgt[i, ].flatten()
+        med_cld_hgt = np.median(cld_hgt[keep])
         if icing_alt[i] > med_cld_hgt:
             continue
 
-        med_cld_tmp = np.median(cld_temp[i, keep])
+        cld_tmp = cld_top_temp[i, ].flatten()
+        med_cld_tmp = np.median(cld_tmp[keep])
         if med_cld_tmp > 274.5:
             continue
 
-- 
GitLab