diff --git a/modules/icing/util.py b/modules/icing/util.py index 67112e80048f6bf408426055d87d23c1c1eefab1..495c547ee35aa3e071ff3438621e3204e1718063 100644 --- a/modules/icing/util.py +++ b/modules/icing/util.py @@ -714,6 +714,13 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h import deeplearning.icing_fcn as icing_fcn model_module = icing_fcn + if day_model_path is not None: + day_model = model_module.load_model(day_model_path, day_night='DAY', l1b_andor_l2=l1b_andor_l2, + use_flight_altitude=use_flight_altitude) + if night_model_path is not None: + night_model = model_module.load_model(night_model_path, day_night='NIGHT', l1b_andor_l2=l1b_andor_l2, + use_flight_altitude=use_flight_altitude) + if use_flight_altitude is True: flight_levels = [0, 1, 2, 3, 4] else: @@ -821,11 +828,15 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h 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(day_grd_dct, num_day_tiles, day_model_path, - day_night='DAY', l1b_or_l2=l1b_andor_l2, - prob_thresh=prob_thresh, - use_flight_altitude=use_flight_altitude, - flight_levels=flight_levels) + # preds_day_dct, probs_day_dct = model_module.run_evaluate_static(day_grd_dct, num_day_tiles, day_model_path, + # day_night='DAY', l1b_or_l2=l1b_andor_l2, + # prob_thresh=prob_thresh, + # use_flight_altitude=use_flight_altitude, + # flight_levels=flight_levels) + preds_day_dct, probs_day_dct = \ + model_module.run_evaluate_static_2(day_model, day_grd_dct, num_day_tiles, prob_thresh=prob_thresh, + use_flight_altitude=use_flight_altitude, + flight_levels=flight_levels) day_idxs = np.array(day_idxs) for flvl in flight_levels: day_preds = preds_day_dct[flvl] @@ -851,13 +862,18 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h 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(nght_grd_dct, num_nght_tiles, - model_path, - day_night=mode, - l1b_or_l2=l1b_andor_l2, - prob_thresh=prob_thresh, - use_flight_altitude=use_flight_altitude, - flight_levels=flight_levels) + # preds_nght_dct, probs_nght_dct = model_module.run_evaluate_static(nght_grd_dct, num_nght_tiles, + # model_path, + # day_night=mode, + # l1b_or_l2=l1b_andor_l2, + # prob_thresh=prob_thresh, + # use_flight_altitude=use_flight_altitude, + # flight_levels=flight_levels) + preds_nght_dct, probs_nght_dct = \ + model_module.run_evaluate_static_2(night_model, nght_grd_dct, num_nght_tiles, + prob_thresh=prob_thresh, + use_flight_altitude=use_flight_altitude, + flight_levels=flight_levels) nght_idxs = np.array(nght_idxs) for flvl in flight_levels: nght_preds = preds_nght_dct[flvl]