From 66428b45a94a00bb017145ba1490ea82e42d27d5 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Fri, 23 Dec 2022 16:24:52 -0600 Subject: [PATCH] snapshot... --- modules/deeplearning/srcnn_l1b_l2.py | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py index 8fc7613e..e2dd4f4f 100644 --- a/modules/deeplearning/srcnn_l1b_l2.py +++ b/modules/deeplearning/srcnn_l1b_l2.py @@ -213,7 +213,7 @@ class SRCNN: self.test_label_nda = None # self.n_chans = len(data_params) + 2 - self.n_chans = 2 + self.n_chans = 1 self.X_img = tf.keras.Input(shape=(None, None, self.n_chans)) # self.X_img = tf.keras.Input(shape=(36, 36, self.n_chans)) @@ -246,18 +246,18 @@ class SRCNN: DO_ADD_NOISE = True data_norm = [] - for param in data_params: - idx = params.index(param) - tmp = input_data[:, idx, :, :] - tmp = np.where(np.isnan(tmp), 0, tmp) - tmp = smooth_2d(tmp, sigma=1.0) - tmp = tmp[:, slc_y_2, slc_x_2] - tmp = resample_2d_linear(x_2, y_2, tmp, t, s) - tmp = tmp[:, y_k, x_k] - tmp = normalize(tmp, param, mean_std_dct) - if DO_ADD_NOISE: - tmp = add_noise(tmp, noise_scale=NOISE_STDDEV) - data_norm.append(tmp) + # for param in data_params: + # idx = params.index(param) + # tmp = input_data[:, idx, :, :] + # tmp = np.where(np.isnan(tmp), 0, tmp) + # tmp = smooth_2d(tmp, sigma=1.0) + # tmp = tmp[:, slc_y_2, slc_x_2] + # tmp = resample_2d_linear(x_2, y_2, tmp, t, s) + # tmp = tmp[:, y_k, x_k] + # tmp = normalize(tmp, param, mean_std_dct) + # if DO_ADD_NOISE: + # tmp = add_noise(tmp, noise_scale=NOISE_STDDEV) + # data_norm.append(tmp) # # -------------------------- # param = 'refl_0_65um_nom' # idx = params.index(param) @@ -777,7 +777,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): 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_c], axis=2) + #data = np.stack([grd_a, grd_c], axis=2) + data = np.stack([grd_c], axis=2) data = np.expand_dims(data, axis=0) nn = SRCNN() -- GitLab