From 811850f0812fc900a66875fae9d53b23bccea0c8 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Sat, 29 Oct 2022 13:12:17 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/srcnn_l1b_l2.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index 8a43aea3..aa2e49cd 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -67,11 +67,19 @@ x_64 = np.arange(64) y_64 = np.arange(64) x_134_2 = x_134[3:131:2] y_134_2 = y_134[3:131:2] -# x_134_2 = x_134[2:133:2] -# y_134_2 = y_134[2:133:2] t = np.arange(0, 64, 0.5) s = np.arange(0, 64, 0.5) +x_128_2 = x_134[3:131:2] +y_128_2 = y_134[3:131:2] +x_128 = x_134[3:131] +y_128 = y_134[3:131] + +#----------- New +# x_134_2 = x_134[1:134:2] +# t = np.arange(1, 66, 0.5) +#-------------------------- + def build_residual_conv2d_block(conv, num_filters, block_name, activation=tf.nn.relu, padding='SAME', kernel_initializer='he_uniform', scale=None, @@ -225,20 +233,19 @@ class SRCNN: data_norm = [] for param in data_params: idx = params.index(param) - tmp = input_data[:, idx, 3:131:2, 3:131:2] + tmp = input_data[:, idx, y_128_2, x_128_2] tmp = normalize(tmp, param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) tmp = resample_2d_linear(x_64, y_64, tmp, t, s) data_norm.append(tmp) - # -------- + # -------------------------- param = 'refl_0_65um_nom' idx = params.index(param) - tmp = input_data[:, idx, 3:131:2, 3:131:2] - # tmp = input_data[:, idx, 3:131, 3:131] + tmp = input_data[:, idx, y_128_2, x_128_2] tmp = normalize(tmp, param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) tmp = resample_2d_linear(x_64, y_64, tmp, t, s) data_norm.append(tmp) # -------- - tmp = input_data[:, label_idx, 3:131:2, 3:131:2] + tmp = input_data[:, label_idx, y_128_2, x_128_2] if label_param != 'cloud_fraction': tmp = normalize(tmp, label_param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) else: @@ -249,8 +256,8 @@ class SRCNN: data = np.stack(data_norm, axis=3) data = data.astype(np.float32) # ----------------------------------------------------- - # label = input_data[:, label_idx, 3:131:2, 3:131:2] - label = input_data[:, label_idx, 3:131, 3:131] + # ----------------------------------------------------- + label = input_data[:, label_idx, y_128, x_128] if label_param != 'cloud_fraction': label = normalize(label, label_param, mean_std_dct) else: -- GitLab