From 8cad6ef463eab6314b29e78188693c149d92a819 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Tue, 8 Nov 2022 15:13:01 -0600
Subject: [PATCH] snapshot...

---
 modules/util/viirs_l1b_l2.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/util/viirs_l1b_l2.py b/modules/util/viirs_l1b_l2.py
index d393f3cf..86c5191a 100644
--- a/modules/util/viirs_l1b_l2.py
+++ b/modules/util/viirs_l1b_l2.py
@@ -91,8 +91,12 @@ def process_cld_prob_(grd_k):
     keep = np.invert(np.isnan(grd_k))
     if np.sum(keep) / grd_k.size < 0.95:
         return None
+    total = np.sum(keep)
+    keep = np.where(keep, np.logical_and(0.05 < grd_k, grd_k < 0.95), False)
+    if np.sum(keep)/total < 0.20:
+        return None
     grd_k = np.where(np.invert(keep), 0, grd_k)
-    grd_k = np.where(grd_k < 0.5, 0.0, 1.0)
+    # grd_k = np.where(grd_k < 0.5, 0.0, 1.0)
     return grd_k
 
 
-- 
GitLab