Skip to content
Snippets Groups Projects
Commit 0836a91d authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 25e40cc0
No related branches found
No related tags found
No related merge requests found
......@@ -1116,58 +1116,6 @@ def run_restore_static(filename_l1b, filename_l2, ckpt_dir_s_path, day_night='DA
return labels, prob_avg, cm_avg
def run_evaluate_static_avg(data_dct, ll, cc, ckpt_dir_s_path, day_night='DAY', flight_level=4,
use_flight_altitude=False, prob_thresh=0.5,
satellite='GOES16', domain='FD'):
num_elems = len(cc)
num_lines = len(ll)
cc = np.array(cc)
ll = np.array(ll)
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
if not os.path.isdir(ckpt_dir):
continue
nn = IcingIntensityFCN(day_night=day_night, use_flight_altitude=use_flight_altitude)
nn.flight_level = flight_level
nn.setup_eval_pipeline(data_dct, num_lines * num_elems)
nn.build_model()
nn.build_training()
nn.build_evaluation()
nn.do_evaluate(ckpt_dir)
prob_s.append(nn.test_probs)
num = len(prob_s)
prob_avg = prob_s[0]
for k in range(num-1):
prob_avg += prob_s[k+1]
prob_avg /= num
probs = prob_avg
if NumClasses == 2:
preds = np.where(probs > prob_thresh, 1, 0)
else:
preds = np.argmax(probs, axis=1)
preds_2d = preds.reshape((num_lines, num_elems))
ll, cc = np.meshgrid(ll, cc, indexing='ij')
cc = cc.flatten()
ll = ll.flatten()
ice_mask = preds == 1
ice_cc = cc[ice_mask]
ice_ll = ll[ice_mask]
ice_lons, ice_lats = nav.lc_to_earth(ice_cc, ice_ll)
return ice_lons, ice_lats, preds_2d
def run_evaluate_static(data_dct, num_tiles, ckpt_dir_s_path, day_night='DAY', l1b_or_l2='both', satellite='GOES16',
prob_thresh=0.5, flight_levels=[0, 1, 2, 3, 4], use_flight_altitude=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment