diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 8dc658a47eac5828d50d1182fb364ab741d586ee..33bcdfb41ef59c35bb62c44bae1808c4e3fc6111 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -7,7 +7,7 @@ from util.util import get_time_tuple_utc, GenericException, add_time_range_to_fi check_oblique, make_times, find_bin_index, get_timestamp, homedir, write_icing_file, make_for_full_domain_predict from util.plot import make_icing_image from util.geos_nav import get_navigation -from util.setup import model_path +from util.setup import model_path_day, model_path_night from aeolus.datasource import CLAVRx, CLAVRx_VIIRS, GOESL1B, CLAVRx_H08 import h5py import re @@ -1904,10 +1904,18 @@ def run_make_images(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', ckpt_dir_s_pat h5f.close() -def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=homedir, ckpt_dir_s_path=model_path, prob_thresh=0.5, satellite='GOES16', domain='CONUS', day_night='DAY'): +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'): - train_params = ['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'] + if day_night == 'DAY': + train_params = ['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'] + if model_path is None: + model_path = model_path_day + else: + train_params = ['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'] + if model_path is None: + model_path = model_path_night if satellite == 'H08': clvrx_ds = CLAVRx_H08(clvrx_dir) @@ -1939,7 +1947,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h lons_2d = lon_s.reshape((num_lines, num_elems)) lats_2d = lat_s.reshape((num_lines, num_elems)) - preds_2d_dct, probs_2d_dct = run_evaluate_static_new(data_dct, num_lines, num_elems, ckpt_dir_s_path=ckpt_dir_s_path, prob_thresh=prob_thresh) + preds_2d_dct, probs_2d_dct = run_evaluate_static_new(data_dct, num_lines, num_elems, ckpt_dir_s_path=model_path, prob_thresh=prob_thresh) write_icing_file(clvrx_str_time, output_dir, preds_2d_dct, probs_2d_dct, x_rad, y_rad, lons_2d, lats_2d) print('Done: ', clvrx_str_time)