From 767043d441037c70ed2adcf1bd093d3155de7015 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 30 Oct 2023 16:06:20 -0500 Subject: [PATCH] snapshot... --- modules/icing/util.py | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/modules/icing/util.py b/modules/icing/util.py index a5fd868a..fecba587 100644 --- a/modules/icing/util.py +++ b/modules/icing/util.py @@ -563,6 +563,15 @@ def run_icing_predict_image_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou pirep_file='/Users/tomrink/data/pirep/pireps_202109200000_202109232359.csv', obs_lons=None, obs_lats=None, obs_times=None, obs_alt=None, flight_level=None, obs_intensity=None): + 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: @@ -644,12 +653,15 @@ def run_icing_predict_image_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou probs_2d_dct[flvl] = fd_probs 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(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].flatten() probs = probs_day_dct[flvl].flatten() @@ -659,11 +671,15 @@ def run_icing_predict_image_fcn(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou 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(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].flatten() probs = probs_nght_dct[flvl].flatten() -- GitLab