diff --git a/modules/icing/util.py b/modules/icing/util.py index 26acf8cc280f2636a68332c942111a7bd42f1b25..4a8c12f515df487c4e36df80c7f8ae044b4c845d 100644 --- a/modules/icing/util.py +++ b/modules/icing/util.py @@ -248,6 +248,16 @@ def run_icing_predict_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_d day_model_path=model_path_day, night_model_path=model_path_night, prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='AUTO', l1b_andor_l2='both', use_flight_altitude=False, res_fac=1, use_nan=False): + + 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, + satellite=satellite, 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, + satellite=satellite, use_flight_altitude=use_flight_altitude) + if use_flight_altitude is True: flight_levels = [0, 1, 2, 3, 4] else: @@ -304,11 +314,10 @@ def run_icing_predict_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_d if (day_night == 'AUTO' or day_night == 'DAY') and num_day_tiles > 0: - preds_day_dct, probs_day_dct = icing_fcn.run_evaluate_static(data_dct, 1, 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 = icing_fcn.run_evaluate_static_2(day_model, data_dct, 1, + prob_thresh=prob_thresh, + use_flight_altitude=use_flight_altitude, + flight_levels=flight_levels) for flvl in flight_levels: preds = preds_day_dct[flvl] probs = probs_day_dct[flvl] @@ -318,11 +327,10 @@ def run_icing_predict_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_d fd_probs[day_idxs] = probs[day_idxs] if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0: - preds_nght_dct, probs_nght_dct = icing_fcn.run_evaluate_static(data_dct, 1, night_model_path, - day_night='NIGHT', 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 = icing_fcn.run_evaluate_static_2(night_model, data_dct, 1, + prob_thresh=prob_thresh, + use_flight_altitude=use_flight_altitude, + flight_levels=flight_levels) for flvl in flight_levels: preds = preds_nght_dct[flvl] probs = probs_nght_dct[flvl]