diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index afde855bf3a73ca0c90beece93decb66aa751768..63d7d474dc2a82400a5b87ac9a57f6466e75e23c 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -59,7 +59,7 @@ label_param = 'cld_opd_dcomp' # label_param = 'cloud_probability' params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', label_param] -data_params = ['temp_11_0um_nom'] +data_params = ['temp_11_0um_nom', 'refl_0_65um_nom'] # data_params = [] label_idx = params.index(label_param) @@ -730,23 +730,25 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): grd_a = np.where(np.isnan(grd_a), 0, grd_a) hr_grd_a = grd_a.copy() hr_grd_a = hr_grd_a[y_128, x_128] - grd_a = grd_a[slc_y_2, slc_x_2] - grd_a = resample_2d_linear_one(x_2, y_2, grd_a, t, s) - grd_a = grd_a[y_k, x_k] + grd_a = grd_a[slc_y, slc_x] + # grd_a = grd_a[slc_y_2, slc_x_2] + # grd_a = resample_2d_linear_one(x_2, y_2, grd_a, t, s) + # grd_a = grd_a[y_k, x_k] grd_a = normalize(grd_a, 'temp_11_0um_nom', mean_std_dct) - # - # grd_b = get_grid_values_all(h5f, 'refl_0_65um_nom') - # grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x] - # grd_b = grd_b[y_130, x_130] - # refl = grd_b - # grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct) + # ------------------------------------------------------ + grd_b = get_grid_values_all(h5f, 'refl_0_65um_nom') + grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x] + grd_b = grd_b.copy() + grd_b = np.where(np.isnan(grd_b), 0, grd_b) + hr_grd_b = grd_b.copy() + hr_grd_b = hr_grd_b[y_128, x_128] + grd_b = grd_b[slc_y, slc_x] + grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct) grd_c = get_grid_values_all(h5f, label_param) grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x] - hr_grd_c = grd_c.copy() hr_grd_c = hr_grd_c[y_128, x_128] - grd_c = np.where(np.isnan(grd_c), 0, grd_c) grd_c = grd_c.copy() # grd_c = smooth_2d_single(grd_c, sigma=1.0) @@ -756,9 +758,9 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): if label_param != 'cloud_probability': grd_c = normalize(grd_c, label_param, mean_std_dct) - # data = np.stack([grd_a, grd_b, grd_c], axis=2) + data = np.stack([grd_a, grd_b, grd_c], axis=2) # data = np.stack([grd_a, grd_c], axis=2) - data = np.stack([grd_c], axis=2) + # data = np.stack([grd_c], axis=2) data = np.expand_dims(data, axis=0) h5f.close() @@ -766,9 +768,9 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): nn = SRCNN() out_sr = nn.run_evaluate(data, ckpt_dir) if out_file is not None: - np.save(out_file, (out_sr[0, :, :, 0], hr_grd_a, hr_grd_c)) + np.save(out_file, (out_sr[0, :, :, 0], hr_grd_a, hr_grd_b, hr_grd_c)) else: - return out_sr, hr_grd_a, hr_grd_c + return out_sr, hr_grd_a, hr_grd_b, hr_grd_c def analyze(file='/Users/tomrink/cld_opd_out.npy'):