diff --git a/modules/deeplearning/icing_cnn.py b/modules/deeplearning/icing_cnn.py index 5ac23b33ad3d48b8587cc9839381837f5f8bd567..cb98e21c1899a19ebaba7013e9de0608a4a9581e 100644 --- a/modules/deeplearning/icing_cnn.py +++ b/modules/deeplearning/icing_cnn.py @@ -1014,6 +1014,8 @@ def run_evaluate_static(h5f, ckpt_dir_s_path, prob_thresh=0.5, satellite='GOES16 ckpt_dir_s = os.listdir(ckpt_dir_s_path) + nav = get_navigation(satellite, domain) + prob_s = [] for ckpt in ckpt_dir_s: ckpt_dir = ckpt_dir_s_path + ckpt @@ -1038,21 +1040,28 @@ def run_evaluate_static(h5f, ckpt_dir_s_path, prob_thresh=0.5, satellite='GOES16 preds = np.where(probs > prob_thresh, 1, 0) else: preds = np.argmax(probs, axis=1) + preds_2d = preds.reshape((len(ll), len(cc))) + x_rad = cc * nav.CFAC + nav.COFF + y_rad = ll * nav.LFAC + nav.LOFF ll, cc = np.meshgrid(ll, cc, indexing='ij') cc = cc.flatten() ll = ll.flatten() + lon_s, lat_s = nav.lc_to_earth(cc, ll) + lons_2d = lon_s.reshape((len(ll), len(cc))) + lats_2d = lat_s.reshape((len(ll), len(cc))) + ice_mask = preds == 1 ice_cc = cc[ice_mask] ice_ll = ll[ice_mask] - nav = get_navigation(satellite, domain) - ice_lons = [] - ice_lats = [] - for k in range(ice_cc.shape[0]): - lon, lat = nav.lc_to_earth(ice_cc[k], ice_ll[k]) - ice_lons.append(lon) - ice_lats.append(lat) + # ice_lons = [] + # ice_lats = [] + # for k in range(ice_cc.shape[0]): + # lon, lat = nav.lc_to_earth(ice_cc[k], ice_ll[k]) + # ice_lons.append(lon) + # ice_lats.append(lat) + ice_lons, ice_lats = nav.lc_to_earth(ice_cc, ice_ll) return ice_lons, ice_lats