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

snapshot...

parent b41cf749
No related branches found
No related tags found
No related merge requests found
......@@ -1962,7 +1962,7 @@ def run_make_images(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ckpt_dir_s_pat
extent=[-105, -70, 15, 50],
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,
day_night='DAY', l1b_andor_l2='l2'):
use_flight_altitude=False, day_night='DAY', l1b_andor_l2='l2'):
if pirep_file is not None:
ice_dict, no_ice_dict, neg_ice_dict = setup(pirep_file)
......@@ -2007,14 +2007,16 @@ def run_make_images(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ckpt_dir_s_pat
ice_lons, ice_lats, preds_2d = run_evaluate_static(data_dct, ll, cc, ckpt_dir_s_path=ckpt_dir_s_path,
flight_level=flight_level, prob_thresh=prob_thresh,
satellite=satellite, domain=domain)
satellite=satellite, domain=domain,
use_flight_altitude=use_flight_altitude)
make_icing_image(h5f, None, ice_lons, ice_lats, clvrx_str_time, satellite, domain,
ice_lons_vld=keep_lons, ice_lats_vld=keep_lats, extent=extent)
# preds_2d_dct, probs_2d_dct = run_evaluate_static_new(data_dct, num_lines, num_elems, day_night=day_night,
# ckpt_dir_s_path=ckpt_dir_s_path, prob_thresh=prob_thresh,
# flight_levels=[0])
# flight_levels=[0],
# use_flight_altitude=use_flight_altitude)
#
# make_icing_image(None, probs_2d_dct[0], None, None, clvrx_str_time, satellite, domain,
# ice_lons_vld=keep_lons, ice_lats_vld=keep_lats, extent=extent)
......@@ -2023,7 +2025,9 @@ def run_make_images(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ckpt_dir_s_pat
print('Done: ', clvrx_str_time)
def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=homedir, model_path=None, prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='DAY', l1b_andor_l2='BOTH'):
def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=homedir, model_path=None,
prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='DAY',
l1b_andor_l2='BOTH', use_flight_altitude=False):
if day_night == 'DAY':
if model_path is None:
......@@ -2056,22 +2060,17 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
preds_2d_dct, probs_2d_dct = run_evaluate_static_new(data_dct, num_lines, num_elems, day_night=day_night,
ckpt_dir_s_path=model_path, prob_thresh=prob_thresh,
use_flight_altitude=use_flight_altitude,
flight_levels=[0])
flt_lvls = list(preds_2d_dct.keys())
for flvl in flt_lvls:
preds = preds_2d_dct[flvl]
keep = np.logical_and(lats_2d > -63.0, lats_2d < 63.0)
keep = np.where(keep, satzen < 70, False)
if day_night == 'DAY':
keep = np.where(keep, solzen < 80, False)
np.where(keep, preds, -1)
for flvl in flt_lvls:
probs = probs_2d_dct[flvl]
preds = preds_2d_dct[flvl]
keep = np.logical_or(lats_2d > -63.0, lats_2d < 63.0)
keep = np.where(keep, satzen < 70, False)
if day_night == 'DAY':
keep = np.where(keep, solzen < 80, False)
np.where(keep, preds, -1)
np.where(keep, probs, -1.0)
write_icing_file(clvrx_str_time, output_dir, preds_2d_dct, probs_2d_dct, x_rad, y_rad, lons_2d, lats_2d, cc, ll)
......
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