From fe6afe4e5e86b73d0d1b365485340e3eb7f4f5f7 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Sun, 14 Mar 2021 15:02:05 -0500 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index c6635d9a..e159744b 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -277,6 +277,32 @@ def analyze(ice_dct, no_ice_dct): print(dt_str[2:]) -def apply_qc_icing_pireps(icing_dct): - new_dct = {} - pass \ No newline at end of file +def apply_qc_icing_pireps(icing_alt, cld_top_hgt, cld_phase, cld_opd, bt_11um, cld_mask): + opd_threshold = 6 + closeness = 100.0 # meters + num_obs = len(icing_alt) + cld_mask = cld_mask.reshape((num_obs, -1)) + cld_top_hgt = cld_top_hgt.reshape((num_obs, -1)) + cld_phase = cld_phase.reshape((num_obs, -1)) + cld_opd = cld_opd.reshape((num_obs, -1)) + bt_11um = bt_11um.reshape((num_obs, -1)) + + keep_0 = np.logical_or(cld_mask == 2, cld_mask == 3) # cloudy + keep_1 = np.invert(np.isnan(cld_top_hgt)) + keep_2 = np.invert(np.isnan(bt_11um)) + keep_3 = np.invert(np.isnan()) + keep = keep_0 & keep_1 & keep_2 & keep_3 + + keep = np.where(keep, cld_top_hgt[:, ] > icing_alt[:], False) + keep = np.invert( + np.where(keep, + np.logical_and(cld_phase[:, ] == 3, + np.logical_and(cld_top_hgt[:, ]+closeness > icing_alt[:], cld_top_hgt[:, ]-closeness < icing_alt[:])), + False)) + + keep = np.where(keep, (cld_opd[:, ] > opd_threshold) & (cld_phase[:, ] == 3) & (cld_top_hgt[:, ] > icing_alt[:]), False) + keep = np.where(keep, np.invert((cld_phase[:, ] == 3) & (cld_opd[:,] < 0.1) & (cld_top_hgt[:, ] > icing_alt[:]), False)) + keep = np.where(keep, np.invert(bt_11um[:,] > 270.0), False) + keep = np.where(keep, np.invert(bt_11um[:,] < 228.0), False) + + return keep \ No newline at end of file -- GitLab