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

snapshot...

parent 512ff01d
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,8 @@ x_134 = np.arange(134) ...@@ -65,6 +65,8 @@ x_134 = np.arange(134)
y_134 = np.arange(134) y_134 = np.arange(134)
x_64 = np.arange(64) x_64 = np.arange(64)
y_64 = np.arange(64) y_64 = np.arange(64)
x_67 = np.arange(67)
y_67 = np.arange(67)
# x_134_2 = slice(3, 131, 2) # x_134_2 = slice(3, 131, 2)
# y_134_2 = slice(3, 131, 2) # y_134_2 = slice(3, 131, 2)
...@@ -88,6 +90,8 @@ y_134_2 = slice(1, 134, 2) ...@@ -88,6 +90,8 @@ y_134_2 = slice(1, 134, 2)
# slc_y = y_128 # slc_y = y_128
# t = np.arange(0, 64, 0.5) # t = np.arange(0, 64, 0.5)
# s = np.arange(0, 64, 0.5) # s = np.arange(0, 64, 0.5)
# x_2 = x_64
# y_2 = y_64
slc_x_2 = x_134_2 slc_x_2 = x_134_2
slc_y_2 = y_134_2 slc_y_2 = y_134_2
...@@ -95,6 +99,8 @@ slc_x = x_128 ...@@ -95,6 +99,8 @@ slc_x = x_128
slc_y = y_128 slc_y = y_128
t = np.arange(1, 66, 0.5) t = np.arange(1, 66, 0.5)
s = np.arange(1, 66, 0.5) s = np.arange(1, 66, 0.5)
x_2 = x_67
y_2 = y_67
def build_residual_conv2d_block(conv, num_filters, block_name, activation=tf.nn.relu, padding='SAME', def build_residual_conv2d_block(conv, num_filters, block_name, activation=tf.nn.relu, padding='SAME',
...@@ -251,14 +257,14 @@ class SRCNN: ...@@ -251,14 +257,14 @@ class SRCNN:
idx = params.index(param) idx = params.index(param)
tmp = input_data[:, idx, slc_y_2, slc_x_2] tmp = input_data[:, idx, slc_y_2, slc_x_2]
tmp = normalize(tmp, param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) 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) tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
data_norm.append(tmp) data_norm.append(tmp)
# -------------------------- # --------------------------
param = 'refl_0_65um_nom' param = 'refl_0_65um_nom'
idx = params.index(param) idx = params.index(param)
tmp = input_data[:, idx, slc_y_2, slc_x_2] tmp = input_data[:, idx, slc_y_2, slc_x_2]
tmp = normalize(tmp, param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) 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) tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
data_norm.append(tmp) data_norm.append(tmp)
# -------- # --------
tmp = input_data[:, label_idx, slc_y_2, slc_x_2] tmp = input_data[:, label_idx, slc_y_2, slc_x_2]
...@@ -266,7 +272,7 @@ class SRCNN: ...@@ -266,7 +272,7 @@ class SRCNN:
tmp = normalize(tmp, label_param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale) tmp = normalize(tmp, label_param, mean_std_dct, add_noise=add_noise, noise_scale=noise_scale)
else: else:
tmp = np.where(np.isnan(tmp), 0, tmp) tmp = np.where(np.isnan(tmp), 0, tmp)
tmp = resample_2d_linear(x_64, y_64, tmp, t, s) tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
data_norm.append(tmp) data_norm.append(tmp)
# --------- # ---------
data = np.stack(data_norm, axis=3) data = np.stack(data_norm, axis=3)
......
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