diff --git a/modules/util/viirs_surfrad.py b/modules/util/viirs_surfrad.py index 6a83650f2c348074c4f8d06bca7ac54a55578c83..ad03cd7ab66beccd3cda9df914f6a91ab29f6b26 100644 --- a/modules/util/viirs_surfrad.py +++ b/modules/util/viirs_surfrad.py @@ -29,8 +29,8 @@ keep_out_opd = ['/ships19/cloud/scratch/cphillips/clavrx/run_viirs_superres/site keep_out = keep_out_opd -target_param = 'cloud_probability' -# target_param = 'cld_opd_dcomp' +# target_param = 'cloud_probability' +target_param = 'cld_opd_dcomp' group_name_i = 'super/' group_name_m = 'orig/' @@ -78,14 +78,26 @@ 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.50: +# 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.50: + 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