diff --git a/modules/deeplearning/cloud_opd_srcnn_abi.py b/modules/deeplearning/cloud_opd_srcnn_abi.py index cadca1f93e7f606d2ff2713d8dd0543880730a55..eebf26a2880a73b4df016e3ee48b0e4b52a570cb 100644 --- a/modules/deeplearning/cloud_opd_srcnn_abi.py +++ b/modules/deeplearning/cloud_opd_srcnn_abi.py @@ -693,19 +693,21 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): refl = get_grid_values_all(h5f, 'refl_0_65um_nom') ylen, xlen = refl.shape - refl = refl[int(ylen/2):ylen, :] LEN_Y, LEN_X = refl.shape print(LEN_Y, LEN_X) bt = get_grid_values_all(h5f, 'temp_11_0um_nom') ylen, xlen = bt.shape - bt = bt[int(ylen/2):ylen, :] cld_opd = get_grid_values_all(h5f, 'cld_opd_dcomp_1') ylen, xlen = cld_opd.shape - cld_opd = cld_opd[int(ylen/2):ylen, :] + cld_opd = cld_opd[::2, ::2] cld_opd_hres = cld_opd.copy() + refl_sub_lo = get_grid_values_all(h5f, 'refl_submin_ch01') + refl_sub_hi = get_grid_values_all(h5f, 'refl_submax_ch01') + refl_sub_std = get_grid_values_all(h5f, 'refl_substddev_ch01') + nn = SRCNN() slc_x = slice(0, (LEN_X - 16) + 4) @@ -730,16 +732,19 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): bt_us = normalize(bt_us, 'temp_11_0um_nom', mean_std_dct) print('BT done') - # refl = get_grid_values_all(h5f, 'super/refl_0_65um') - # refl = np.where(np.isnan(refl), 0, refl) - # refl = np.expand_dims(refl, axis=0) - # refl_lo, refl_hi, refl_std, refl_avg = get_min_max_std(refl) - # refl_lo = normalize(refl_lo, 'refl_0_65um_nom', mean_std_dct) - # refl_hi = normalize(refl_hi, 'refl_0_65um_nom', mean_std_dct) - # refl_avg = normalize(refl_avg, 'refl_0_65um_nom', mean_std_dct) - # refl_lo = np.squeeze(refl_lo) - # refl_hi = np.squeeze(refl_hi) - # refl_avg = np.squeeze(refl_avg) + refl_sub_lo = np.expand_dims(refl_sub_lo, axis=0) + refl_sub_lo = upsample_nearest(refl_sub_lo) + refl_sub_lo = refl_sub_lo[:, slc_y, slc_x] + refl_sub_lo = normalize(refl_sub_lo, 'refl_0_65um_nom', mean_std_dct) + + refl_sub_hi = np.expand_dims(refl_sub_hi, axis=0) + refl_sub_hi = upsample_nearest(refl_sub_hi) + refl_sub_hi = refl_sub_hi[:, slc_y, slc_x] + refl_sub_hi = normalize(refl_sub_hi, 'refl_0_65um_nom', mean_std_dct) + + refl_sub_std = np.expand_dims(refl_sub_std, axis=0) + refl_sub_std = upsample_nearest(refl_sub_std) + refl_sub_std = refl_sub_std[:, slc_y, slc_x] cld_opd = np.where(np.isnan(cld_opd), 0, cld_opd) cld_opd = cld_opd[slc_y, slc_x] @@ -748,7 +753,7 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): cld_opd_us = normalize(cld_opd_us, label_param, mean_std_dct) print('OPD done') - data = np.stack([bt_us, refl_us, cld_opd_us], axis=3) + data = np.stack([bt_us, refl_us, refl_sub_lo, refl_sub_hi, refl_sub_std, cld_opd_us], axis=3) cld_opd_sres = nn.run_evaluate(data, ckpt_dir) cld_opd_sres = descale(cld_opd_sres, label_param, mean_std_dct)