From db5d24d2d3e0736de5e8d5ad0ca82778deb173b1 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 4 Aug 2021 14:30:31 -0500
Subject: [PATCH] add separate opt_thin_threshold for DAY and NIGHT

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

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index 84d0c872..3268dea4 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -768,8 +768,10 @@ def run_qc(filename, filename_l1b, day_night='ANY', pass_thresh_frac=0.20, icing
 
 def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask, bt_11um, solzen, satzen, day_night='ANY'):
     opd_thick_threshold = 2
+    opd_thin_threshold = 0.1
     if day_night == 'DAY':
         opd_thick_threshold = 20
+        opd_thin_threshold = 1
     closeness = 100.0  # meters
     num_obs = len(icing_alt)
     cld_mask = cld_mask.reshape((num_obs, -1))
@@ -810,7 +812,7 @@ def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mask,
 
         keep = np.where(keep, (cld_opd[i,] >= opd_thick_threshold) & (cld_phase[i,] == 4) & (cld_top_hgt[i,] > icing_alt[i]), False)
 
-        keep = np.where(keep, np.invert((cld_phase[i,] == 4) & (cld_opd[i,] < 0.1) & (cld_top_hgt[i,] > icing_alt[i])), False)
+        keep = np.where(keep, np.invert((cld_phase[i,] == 4) & (cld_opd[i,] < opd_thin_threshold) & (cld_top_hgt[i,] > icing_alt[i])), False)
 
         keep = np.where(keep, np.invert(bt_11um[i,] > 270.0), False)
 
@@ -870,9 +872,9 @@ def apply_qc_no_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, cld_mas
         #
         # keep = np.where(keep, np.invert((cld_phase[i,] == 4) & (cld_opd[i,] < 0.1) & (cld_top_hgt[i,] > icing_alt[i])), False)
         #
-        # keep = np.where(keep, np.invert(bt_11um[i,] > 270.0), False)
-        #
-        # keep = np.where(keep, np.invert(bt_11um[i,] < 228.0), False)
+        keep = np.where(keep, bt_11um[i,] > 270.0, False)
+
+        keep = np.where(keep, bt_11um[i,] < 228.0, False)
 
         mask.append(keep)
         idxs.append(i)
-- 
GitLab