diff --git a/modules/util/viirs_l1b_l2.py b/modules/util/viirs_l1b_l2.py index c567aedea97aaa3014a29d328eaee760c2e96e3a..407320a63d56669605a7c7e4ad49652175133a93 100644 --- a/modules/util/viirs_l1b_l2.py +++ b/modules/util/viirs_l1b_l2.py @@ -87,14 +87,27 @@ def process_cld_prob(grd_k): return grd_k +# def process_cld_opd(grd_k): +# keep = np.invert(np.isnan(grd_k)) +# num_keep = np.sum(keep) +# grd_k = np.where(np.invert(keep), 0, grd_k) +# keep = np.where(keep, np.logical_and(0.1 < grd_k, grd_k < 158.0), False) +# frac_keep = np.sum(keep)/num_keep +# if frac_keep < 0.60: +# return None +# return grd_k + + def process_cld_opd(grd_k): keep = np.invert(np.isnan(grd_k)) num_keep = np.sum(keep) - grd_k = np.where(np.invert(keep), 0, grd_k) - keep = np.where(keep, np.logical_and(0.1 < grd_k, grd_k < 158.0), False) - frac_keep = np.sum(keep)/num_keep - if frac_keep < 0.60: + keep_vthin = np.where(keep, grd_k < 0.01, False) + keep_vthik = np.where(keep, grd_k < 150.0, False) + frac_vthin = np.sum(keep_vthin) / num_keep + frac_vthik = np.sum(keep_vthik) / num_keep + if not (frac_vthin >= 0.10 and frac_vthik >= 0.10): return None + grd_k = np.where(np.invert(keep), 0, grd_k) return grd_k