diff --git a/modules/util/viirs_l1b_l2.py b/modules/util/viirs_l1b_l2.py index 86c5191a19dd48a44946789dd8bcefe89f44e312..40c380df9a9a9fc6f141130838a49593aca2107b 100644 --- a/modules/util/viirs_l1b_l2.py +++ b/modules/util/viirs_l1b_l2.py @@ -89,11 +89,11 @@ def process_cld_prob(param_s, tile): def process_cld_prob_(grd_k): keep = np.invert(np.isnan(grd_k)) - if np.sum(keep) / grd_k.size < 0.95: + num_keep = np.sum(keep) + if num_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: + if np.sum(keep)/num_keep < 0.40: return None grd_k = np.where(np.invert(keep), 0, grd_k) # grd_k = np.where(grd_k < 0.5, 0.0, 1.0)