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

snapshot...

parent fbbbfeac
No related branches found
No related tags found
No related merge requests found
......@@ -1483,19 +1483,11 @@ def run_icing_predict_image_1x1(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):
# import deeplearning.icing_fcn as icing_fcn
# 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,
# 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,
# use_flight_altitude=use_flight_altitude)
# load parameter stats and model from disk
stdSclr_day = joblib.load('/home/rink/stdSclr_4_day.pkl')
day_model = joblib.load('/home/rink/icing_gbm_day.pkl')
stdSclr_nght = joblib.load('/home/rink/stdSclr_4_nght.pkl')
nght_model = joblib.load('/home/rink/icing_gbm_nght.pkl')
......@@ -1513,8 +1505,8 @@ def run_icing_predict_image_1x1(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou
if flight_level is not None:
alt_lo, alt_hi = flt_level_ranges[flight_level]
# day_train_params, _, _ = get_training_parameters(day_night='DAY', l1b_andor_l2=l1b_andor_l2)
# nght_train_params, _, _ = get_training_parameters(day_night='NIGHT', l1b_andor_l2=l1b_andor_l2)
day_train_params = ['cld_temp_acha', 'supercooled_cloud_fraction', 'cld_reff_dcomp', 'cld_opd_dcomp']
nght_train_params = ['cld_temp_acha', 'supercooled_cloud_fraction', 'cld_reff_acha', 'cld_opd_acha']
#
# if day_night == 'AUTO':
# train_params = list(set(day_train_params + nght_train_params))
......@@ -1522,8 +1514,6 @@ def run_icing_predict_image_1x1(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou
# train_params = day_train_params
# elif day_night == 'NIGHT':
# train_params = nght_train_params
day_train_params = ['cld_temp_acha', 'supercooled_cloud_fraction', 'cld_reff_dcomp', 'cld_opd_dcomp']
nght_train_params = ['cld_temp_acha', 'supercooled_cloud_fraction', 'cld_reff_acha', 'cld_opd_acha']
if satellite == 'H08':
clvrx_ds = CLAVRx_H08(clvrx_dir)
......@@ -1571,9 +1561,9 @@ def run_icing_predict_image_1x1(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou
num_nght_tiles = np.sum(nght_idxs)
print('num nght tiles: ', num_nght_tiles)
cldy_idxs = cldmsk >= 2
num_cldy_tiles = np.sum(cldy_idxs)
print('num cloudy tiles: ', num_cldy_tiles)
clr_idxs = cldmsk < 2
num_clr_tiles = np.sum(clr_idxs)
print('num clear tiles: ', num_clr_tiles)
fd_preds = np.zeros(num_lines * num_elems, dtype=np.int8)
fd_probs = np.zeros(num_lines * num_elems, dtype=np.float32)
......@@ -1581,18 +1571,17 @@ def run_icing_predict_image_1x1(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ou
fd_probs[:] = -1.0
if (day_night == 'AUTO' or day_night == 'DAY') and num_day_tiles > 0:
varX_std = stdSclr_day.transform(varX_day)
varX_std = np.where(np.isnan(varX_std), 0, varX_std)
probs = day_model.predict_proba(varX_std)[:, 1]
fd_probs[day_idxs] = probs[day_idxs]
if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0:
varX_std = stdSclr_nght.transform(varX_ngth)
varX_std = np.where(np.isnan(varX_std), 0, varX_std)
probs = nght_model.predict_proba(varX_std)[:, 1]
fd_probs[nght_idxs] = probs[nght_idxs]
fd_probs[np.invert(day_idxs)] = probs[np.invert(day_idxs)]
fd_probs[clr_idxs] = 0.0
max_prob = fd_probs.reshape((num_lines, num_elems))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment