diff --git a/modules/icing/util.py b/modules/icing/util.py index 82e9fba3fdf653ab61c7d9ff1ad0967f5e1b658c..9c8af1e5d38fd9adb9aa58b4178ff353f9f292be 100644 --- a/modules/icing/util.py +++ b/modules/icing/util.py @@ -93,6 +93,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h h5f = h5py.File(fname, 'r') dto = clvrx_ds.get_datetime(fname) ts = dto.timestamp() + lunar_illuminated = moon_phase(ts) clvrx_str_time = dto.strftime('%Y-%m-%d_%H:%M') if satellite == 'GOES16' or satellite == 'H08': @@ -108,7 +109,7 @@ 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], satellite=satellite, domain=domain, res_fac=res_fac) elif satellite == 'VIIRS': - if use_dnb and moon_phase(ts): + if use_dnb and lunar_illuminated: train_params = train_params_dnb data_dct, ll, cc, lats_2d, lons_2d = make_for_full_domain_predict_viirs_clavrx(h5f, name_list=train_params, day_night=day_night, res_fac=res_fac, use_dnb=use_dnb) @@ -180,7 +181,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0: model_path = night_model_path - if use_dnb: + if use_dnb and lunar_illuminated: model_path = day_model_path day = 'DAY' nght_train_params = train_params_dnb