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

snapshot...

parent b70f0789
No related branches found
No related tags found
No related merge requests found
...@@ -784,24 +784,39 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -784,24 +784,39 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
satzen = ancil_data_dct['sensor_zenith_angle'] satzen = ancil_data_dct['sensor_zenith_angle']
solzen = ancil_data_dct['solar_zenith_angle'] solzen = ancil_data_dct['solar_zenith_angle']
cth = ancil_data_dct['cld_height_acha']
bt_10_4 = ancil_data_dct[bt_fld_name] bt_10_4 = ancil_data_dct[bt_fld_name]
day_idxs = [] day_idxs = []
nght_idxs = [] nght_idxs = []
all_idxs = [] all_idxs = []
avg_bt = [] avg_bt = []
day_cth_max = []
nght_cth_max = []
for j in range(num_lines): for j in range(num_lines):
for i in range(num_elems): for i in range(num_elems):
k = i + j*num_elems k = i + j*num_elems
avg_bt.append(get_median(bt_10_4[k])) avg_bt.append(get_median(bt_10_4[k]))
c = cth[k].flatten()
c_m = np.mean(np.sort(c[np.invert(np.isnan(c))])[-2:])
c_m = 0 if 2000 > c_m >= 0 else c_m
c_m = 1 if 4000 > c_m >= 2000 else c_m
c_m = 2 if 6000 > c_m >= 4000 else c_m
c_m = 3 if 8000 > c_m >= 6000 else c_m
c_m = 4 if 15000 > c_m >= 8000 else c_m
if not check_oblique(satzen[k]): if not check_oblique(satzen[k]):
continue continue
all_idxs.append(k) all_idxs.append(k)
if is_day(solzen[k]): if is_day(solzen[k]):
day_idxs.append(k) day_idxs.append(k)
day_cth_max.append(c_m)
else: else:
nght_idxs.append(k) nght_idxs.append(k)
nght_cth_max.append(c_m)
num_tiles = len(all_idxs) num_tiles = len(all_idxs)
num_day_tiles = len(day_idxs) num_day_tiles = len(day_idxs)
...@@ -827,6 +842,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -827,6 +842,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
day_grd_dct = {name: None for name in day_train_params} day_grd_dct = {name: None for name in day_train_params}
for ds_name in day_train_params: for ds_name in day_train_params:
day_grd_dct[ds_name] = np.stack(day_data_dct[ds_name]) day_grd_dct[ds_name] = np.stack(day_data_dct[ds_name])
day_grd_dct['cth_high_avg'] = day_cth_max
preds_day_dct, probs_day_dct = \ preds_day_dct, probs_day_dct = \
model_module.run_evaluate_static_2(day_model, day_grd_dct, num_day_tiles, prob_thresh=prob_thresh, model_module.run_evaluate_static_2(day_model, day_grd_dct, num_day_tiles, prob_thresh=prob_thresh,
...@@ -856,6 +872,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -856,6 +872,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
nght_grd_dct = {name: None for name in nght_train_params} nght_grd_dct = {name: None for name in nght_train_params}
for ds_name in nght_train_params: for ds_name in nght_train_params:
nght_grd_dct[ds_name] = np.stack(nght_data_dct[ds_name]) nght_grd_dct[ds_name] = np.stack(nght_data_dct[ds_name])
nght_grd_dct['cth_high_avg'] = nght_cth_max
preds_nght_dct, probs_nght_dct = \ preds_nght_dct, probs_nght_dct = \
model_module.run_evaluate_static_2(night_model, nght_grd_dct, num_nght_tiles, model_module.run_evaluate_static_2(night_model, nght_grd_dct, num_nght_tiles,
...@@ -1161,7 +1178,6 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output ...@@ -1161,7 +1178,6 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output
day_grd_dct = {name: None for name in day_train_params} day_grd_dct = {name: None for name in day_train_params}
for ds_name in day_train_params: for ds_name in day_train_params:
day_grd_dct[ds_name] = np.stack(day_data_dct[ds_name]) day_grd_dct[ds_name] = np.stack(day_data_dct[ds_name])
day_grd_dct['cth_high_avg'] = day_cth_max day_grd_dct['cth_high_avg'] = day_cth_max
preds_day_dct, probs_day_dct = \ preds_day_dct, probs_day_dct = \
...@@ -1187,7 +1203,6 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output ...@@ -1187,7 +1203,6 @@ def run_icing_predict_image(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output
nght_grd_dct = {name: None for name in nght_train_params} nght_grd_dct = {name: None for name in nght_train_params}
for ds_name in nght_train_params: for ds_name in nght_train_params:
nght_grd_dct[ds_name] = np.stack(nght_data_dct[ds_name]) nght_grd_dct[ds_name] = np.stack(nght_data_dct[ds_name])
nght_grd_dct['cth_high_avg'] = nght_cth_max nght_grd_dct['cth_high_avg'] = nght_cth_max
preds_nght_dct, probs_nght_dct = \ preds_nght_dct, probs_nght_dct = \
......
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