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

nlcomp for VIIRS

parent f30cedb5
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ import datetime ...@@ -28,7 +28,7 @@ import datetime
# endif # endif
def get_training_parameters(day_night='DAY', l1b_andor_l2='both'): def get_training_parameters(day_night='DAY', l1b_andor_l2='both', lunar=False):
if day_night == 'DAY': if day_night == 'DAY':
train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction', train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction',
'cld_emiss_acha', 'conv_cloud_fraction', 'cld_reff_dcomp', 'cld_opd_dcomp', 'iwc_dcomp', 'lwc_dcomp'] 'cld_emiss_acha', 'conv_cloud_fraction', 'cld_reff_dcomp', 'cld_opd_dcomp', 'iwc_dcomp', 'lwc_dcomp']
...@@ -40,6 +40,10 @@ def get_training_parameters(day_night='DAY', l1b_andor_l2='both'): ...@@ -40,6 +40,10 @@ def get_training_parameters(day_night='DAY', l1b_andor_l2='both'):
train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction', train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction',
'cld_emiss_acha', 'conv_cloud_fraction', 'cld_reff_acha', 'cld_opd_acha'] 'cld_emiss_acha', 'conv_cloud_fraction', 'cld_reff_acha', 'cld_opd_acha']
if lunar is True:
train_params_l2 = ['cld_height_acha', 'cld_geo_thick', 'cld_temp_acha', 'cld_press_acha', 'supercooled_cloud_fraction',
'cld_emiss_acha', 'conv_cloud_fraction', 'cld_reff_dcomp', 'cld_opd_dcomp', 'iwc_dcomp', 'lwc_dcomp']
train_params_l1b = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13_3um_nom', 'temp_3_75um_nom', train_params_l1b = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13_3um_nom', 'temp_3_75um_nom',
'temp_6_2um_nom', 'temp_6_7um_nom', 'temp_7_3um_nom', 'temp_8_5um_nom', 'temp_9_7um_nom'] 'temp_6_2um_nom', 'temp_6_7um_nom', 'temp_7_3um_nom', 'temp_8_5um_nom', 'temp_9_7um_nom']
...@@ -64,7 +68,8 @@ flt_level_ranges[4] = [8000.0, 15000.0] ...@@ -64,7 +68,8 @@ flt_level_ranges[4] = [8000.0, 15000.0]
def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=homedir, def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=homedir,
day_model_path=model_path_day, night_model_path=model_path_night, day_model_path=model_path_day, night_model_path=model_path_night,
prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='AUTO', prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='AUTO',
l1b_andor_l2='l2', use_flight_altitude=True, res_fac=1, use_nan=False, has_time=False, model_type='FCN'): l1b_andor_l2='l2', use_flight_altitude=True, res_fac=1, use_nan=False, has_time=False,
model_type='FCN', lunar=False):
if model_type == 'CNN': if model_type == 'CNN':
model_module = icing_cnn model_module = icing_cnn
...@@ -114,7 +119,8 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -114,7 +119,8 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
['solar_zenith_angle', 'sensor_zenith_angle', 'cld_height_acha', 'cld_geo_thick', bt_fld_name], ['solar_zenith_angle', 'sensor_zenith_angle', 'cld_height_acha', 'cld_geo_thick', bt_fld_name],
satellite=satellite, domain=domain, res_fac=res_fac) satellite=satellite, domain=domain, res_fac=res_fac)
elif satellite == 'VIIRS': elif satellite == 'VIIRS':
data_dct, ll, cc, lats_2d, lons_2d = make_for_full_domain_predict_viirs_clavrx(h5f, name_list=train_params, res_fac=res_fac) data_dct, ll, cc, lats_2d, lons_2d = make_for_full_domain_predict_viirs_clavrx(h5f, name_list=train_params,
day_night=day_night, lres_fac=res_fac)
bt_fld_name = 'temp_11_0um_nom' bt_fld_name = 'temp_11_0um_nom'
ancil_data_dct, _, _, _, _ = make_for_full_domain_predict_viirs_clavrx(h5f, name_list= ancil_data_dct, _, _, _, _ = make_for_full_domain_predict_viirs_clavrx(h5f, name_list=
...@@ -182,6 +188,9 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -182,6 +188,9 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
fd_probs[day_idxs] = day_probs[:] fd_probs[day_idxs] = day_probs[:]
if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0: if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0:
model_path = night_model_path
if lunar:
model_path = day_model_path
nght_data_dct = {name: [] for name in nght_train_params} nght_data_dct = {name: [] for name in nght_train_params}
for name in nght_train_params: for name in nght_train_params:
...@@ -191,7 +200,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -191,7 +200,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
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])
preds_nght_dct, probs_nght_dct = model_module.run_evaluate_static(nght_grd_dct, num_nght_tiles, night_model_path, preds_nght_dct, probs_nght_dct = model_module.run_evaluate_static(nght_grd_dct, num_nght_tiles, model_path,
day_night='NIGHT', l1b_or_l2=l1b_andor_l2, day_night='NIGHT', l1b_or_l2=l1b_andor_l2,
prob_thresh=prob_thresh, prob_thresh=prob_thresh,
use_flight_altitude=use_flight_altitude, use_flight_altitude=use_flight_altitude,
......
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