diff --git a/modules/util/abi_surfrad.py b/modules/util/abi_surfrad.py index 1e371886f2ed9608a191a0a00ee01088bf5c9423..b3ebbf4c12f8babacfb0c5404fb847c3c79c97e2 100644 --- a/modules/util/abi_surfrad.py +++ b/modules/util/abi_surfrad.py @@ -71,14 +71,13 @@ def process_cld_prob(grd_k): def process_cloud_frac(grd_k): keep = np.invert(np.isnan(grd_k)) - num_keep = np.sum(keep) grd_by_cat = get_cloud_frac_5cat(grd_k) - # if at least 20% mixed pass - keep_mix = np.where(keep, np.logical_and(grd_by_cat > 0, grd_by_cat < 4), False) - frac_mix = np.sum(keep_mix)/num_keep - if frac_mix < 0.20: + keep_mix = np.logical_and(grd_by_cat > 0, grd_by_cat < 4) + frac_mix = np.sum(keep_mix)/keep_mix.size + if frac_mix < 0.20: # at least 20% mixed to pass return None + grd_k = np.where(np.invert(keep), 0, grd_k) # Convert NaN to 0 return grd_k