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

minor

parent 00b58f89
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ import numpy as np ...@@ -2,6 +2,7 @@ import numpy as np
import deeplearning.icing_fcn as icing_fcn import deeplearning.icing_fcn as icing_fcn
import deeplearning.icing_cnn as icing_cnn import deeplearning.icing_cnn as icing_cnn
from icing.pirep_goes import setup, time_filter_3 from icing.pirep_goes import setup, time_filter_3
from icing.moon_phase import moon_phase
from util.util import get_time_tuple_utc, is_day, check_oblique, get_average, homedir, write_icing_file_nc4,\ from util.util import get_time_tuple_utc, is_day, check_oblique, get_average, homedir, write_icing_file_nc4,\
write_icing_file_nc4_viirs,\ write_icing_file_nc4_viirs,\
make_for_full_domain_predict, make_for_full_domain_predict_viirs_clavrx, prepare_evaluate make_for_full_domain_predict, make_for_full_domain_predict_viirs_clavrx, prepare_evaluate
...@@ -28,7 +29,7 @@ import datetime ...@@ -28,7 +29,7 @@ import datetime
# endif # endif
def get_training_parameters(day_night='DAY', l1b_andor_l2='both', lunar=False): def get_training_parameters(day_night='DAY', l1b_andor_l2='both', use_dnb=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,7 +41,7 @@ def get_training_parameters(day_night='DAY', l1b_andor_l2='both', lunar=False): ...@@ -40,7 +41,7 @@ def get_training_parameters(day_night='DAY', l1b_andor_l2='both', lunar=False):
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: if use_dnb is True:
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']
...@@ -69,7 +70,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -69,7 +70,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
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, l1b_andor_l2='l2', use_flight_altitude=True, res_fac=1, use_nan=False, has_time=False,
model_type='FCN', lunar=False): model_type='FCN', use_dnb=False):
if model_type == 'CNN': if model_type == 'CNN':
model_module = icing_cnn model_module = icing_cnn
...@@ -81,15 +82,18 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -81,15 +82,18 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h
else: else:
flight_levels = [0] flight_levels = [0]
day_train_params = get_training_parameters(day_night='DAY', l1b_andor_l2=l1b_andor_l2, lunar=lunar) 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, lunar=lunar) nght_train_params = get_training_parameters(day_night='NIGHT', l1b_andor_l2=l1b_andor_l2, use_dnb=False)
nght_train_params_dnb = get_training_parameters(day_night='NIGHT', l1b_andor_l2=l1b_andor_l2, use_dnb=True)
if day_night == 'AUTO': if day_night == 'AUTO':
train_params = list(set(day_train_params + nght_train_params)) train_params = list(set(day_train_params + nght_train_params))
train_params_dnb = list(set(day_train_params + nght_train_params_dnb))
elif day_night == 'DAY': elif day_night == 'DAY':
train_params = day_train_params train_params = day_train_params
elif day_night == 'NIGHT': elif day_night == 'NIGHT':
train_params = nght_train_params train_params = nght_train_params
train_params_dnb = nght_train_params_dnb
if satellite == 'H08': if satellite == 'H08':
clvrx_ds = CLAVRx_H08(clvrx_dir) clvrx_ds = CLAVRx_H08(clvrx_dir)
...@@ -119,8 +123,10 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -119,8 +123,10 @@ 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':
if use_dnb and moon_phase(ts):
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, 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, lunar=lunar) day_night=day_night, res_fac=res_fac, use_dnb=use_dnb)
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=
...@@ -189,7 +195,7 @@ def run_icing_predict(clvrx_dir='/Users/tomrink/data/clavrx/RadC/', output_dir=h ...@@ -189,7 +195,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: if (day_night == 'AUTO' or day_night == 'NIGHT') and num_nght_tiles > 0:
model_path = night_model_path model_path = night_model_path
if lunar: if use_dnb:
model_path = day_model_path model_path = day_model_path
day = 'DAY' day = 'DAY'
......
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