From a21b6e5ada00bd9aab9f7868e4db8bff959627b2 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 18 Mar 2024 15:10:32 -0500 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 58 +++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index d77bfb63..0a393756 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -880,38 +880,52 @@ def analyze2(filename, filename_l1b): icing_alt = f['flight_altitude'][:] num_obs = iint.size print('num obs: ', num_obs) - iint = np.broadcast_to(iint.reshape(num_obs, 1), (num_obs, 256)) - icing_alt = np.broadcast_to(icing_alt.reshape(num_obs, 1), (num_obs, 256)) + iint = np.broadcast_to(iint.reshape(num_obs, 1), (num_obs, 256)).flatten() + icing_alt = np.broadcast_to(icing_alt.reshape(num_obs, 1), (num_obs, 256)).flatten() keep_mask = f['FOV_mask'][:, :, :].reshape([num_obs, -1]) keep_mask = keep_mask.astype(np.bool) + keep_mask = keep_mask.flatten() + + iint = iint[keep_mask] + icing_alt = icing_alt[keep_mask] no_ice = iint == -1 ice = iint >= 1 tr_ice = (iint == 1) | (iint == 2) tr_plus_ice = iint > 2 - print('num no ice: ', np.sum(no_ice) // 256) - print('num ice: ', np.sum(ice) // 256) - print('trace ice: ', np.sum(tr_ice) // 256) - print('trace plus ice: ', np.sum(tr_plus_ice) // 256) - - cld_top_hgt = f['cld_height_acha'][:, :, :].reshape([num_obs, -1]) - cld_top_tmp = f['cld_temp_acha'][:, :, :].reshape([num_obs, -1]) - sc_cld_frac = f['supercooled_cloud_fraction'][:, :, :].reshape([num_obs, -1]) - cld_mask = f['cloud_mask'][:, :, :].reshape([num_obs, -1]) - cld_opd = f['cld_opd_dcomp'][:, :, :].reshape([num_obs, -1]) - # cld_opd = f['cld_opd_acha'][:, :, :].reshape([num_obs, -1]) - cld_reff = f['cld_reff_dcomp'][:, :, :].reshape([num_obs, -1]) - # cld_lwc = f['lwc_dcomp'][:, :, :].reshape([num_obs, -1]) - # cld_iwc = f['iwc_dcomp'][:, :, :].reshape([num_obs, -1]) - # cld_reff = f['cld_reff_acha'][:, :, :].reshape([num_obs, -1]) - cld_emiss = f['cld_emiss_acha'][:, :, :].reshape([num_obs, -1]) - # cld_phase = f['cloud_phase'][:, :, :].reshape([num_obs, -1]) - # solzen = f['solar_zenith_angle'][:, :, :].reshape([num_obs, -1]) - # bt_10_4 = f_l1b['temp_10_4um_nom'][:, :, :].reshape([num_obs, -1]) + + print('num no ice: ', np.sum(no_ice)) + print('num ice: ', np.sum(ice)) + print('trace ice: ', np.sum(tr_ice)) + print('trace plus ice: ', np.sum(tr_plus_ice)) + + cld_top_hgt = f['cld_height_acha'][:, :, :].flatten() + cld_top_tmp = f['cld_temp_acha'][:, :, :].flatten() + sc_cld_frac = f['supercooled_cloud_fraction'][:, :, :].flatten() + cld_mask = f['cloud_mask'][:, :, :].flatten() + cld_opd = f['cld_opd_dcomp'][:, :, :].flatten() + # cld_opd = f['cld_opd_acha'][:, :, :].flatten() + cld_reff = f['cld_reff_dcomp'][:, :, :].flatten() + cld_lwc = f['lwc_dcomp'][:, :, :].flatten() + cld_iwc = f['iwc_dcomp'][:, :, :].flatten() + # cld_reff = f['cld_reff_acha'][:, :, :].flatten() + cld_emiss = f['cld_emiss_acha'][:, :, :].flatten() + # cld_phase = f['cloud_phase'][:, :, :].flatten() + # solzen = f['solar_zenith_angle'][:, :, :].flatten() + # bt_10_4 = f_l1b['temp_10_4um_nom'][:, :, :].flatten() + + cld_top_hgt = cld_top_hgt[keep_mask] + cld_top_tmp = cld_top_tmp[keep_mask] + sc_cld_frac = sc_cld_frac[keep_mask] + cld_opd = cld_opd[keep_mask] + cld_reff = cld_reff[keep_mask] + cld_lwc = cld_lwc[keep_mask] + cld_iwc = cld_iwc[keep_mask] + cld_mask = cld_mask[keep_mask] cld_mask = np.where(cld_mask > 1, 1, 0) - cld_frac = np.sum(cld_mask, axis=1) / 256 + # cld_frac = np.sum(cld_mask, axis=1) / 256 # need to do this earlier f.close() -- GitLab