diff --git a/modules/icing/util.py b/modules/icing/util.py index d39ac1a52dafb4dd31d3af36bbd29dc9c929d50a..14e51be6696d8c7dcc90e9e69e6c037251aa7377 100644 --- a/modules/icing/util.py +++ b/modules/icing/util.py @@ -434,21 +434,37 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output satzen = ancil_data_dct['sensor_zenith_angle'] solzen = ancil_data_dct['solar_zenith_angle'] + cth = ancil_data_dct['cld_height_acha'] day_idxs = [] nght_idxs = [] + day_cth_max = [] + nght_cth_max = [] for j in range(num_lines): for i in range(num_elems): k = i + j*num_elems + c = cth[k].flatten() + c_m = np.mean(np.sort(c[np.invert(np.isnan(c))])[-2:]) + + c_m = 0 if 2000 > c_m >= 0 else c_m + c_m = 1 if 4000 > c_m >= 2000 else c_m + c_m = 2 if 6000 > c_m >= 4000 else c_m + c_m = 3 if 8000 > c_m >= 6000 else c_m + c_m = 4 if 15000 > c_m >= 8000 else c_m + if not check_oblique(satzen[k]): continue if is_day(solzen[k]): day_idxs.append(k) + day_cth_max.append(c_m) else: nght_idxs.append(k) + nght_cth_max.append(c_m) num_tiles = num_lines * num_elems num_day_tiles = len(day_idxs) num_nght_tiles = len(nght_idxs) + day_cth_max = np.array(day_cth_max) + nght_cth_max = np.array(nght_cth_max) # initialize output arrays probs_2d_dct = {flvl: None for flvl in flight_levels} @@ -471,7 +487,7 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output for ds_name in day_train_params: day_grd_dct[ds_name] = np.stack(day_data_dct[ds_name]) - preds_day_dct, probs_day_dct = model_module.run_evaluate_static_2(day_model, day_grd_dct, num_day_tiles, + preds_day_dct, probs_day_dct = model_module.run_evaluate_static_2(day_model, day_grd_dct, num_day_tiles, day_cth_max, day_night='DAY', l1b_or_l2=l1b_andor_l2, prob_thresh=prob_thresh, use_flight_altitude=use_flight_altitude, @@ -496,7 +512,7 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output for ds_name in nght_train_params: nght_grd_dct[ds_name] = np.stack(nght_data_dct[ds_name]) - preds_nght_dct, probs_nght_dct = model_module.run_evaluate_static_2(night_model, nght_grd_dct, num_nght_tiles, + preds_nght_dct, probs_nght_dct = model_module.run_evaluate_static_2(night_model, nght_grd_dct, num_nght_tiles, nght_cth_max, day_night='NIGHT', l1b_or_l2=l1b_andor_l2, prob_thresh=prob_thresh, use_flight_altitude=use_flight_altitude,