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

snapshot...

parent c12301be
No related branches found
No related tags found
No related merge requests found
......@@ -248,14 +248,15 @@ class SRCNN:
data_norm = []
for param in data_params:
idx = params.index(param)
# tmp = input_data[:, idx, slc_y, slc_x]
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)
# tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
data_norm.append(tmp)
# # --------------------------
# param = 'refl_0_65um_nom'
......@@ -268,10 +269,12 @@ class SRCNN:
# # tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
# data_norm.append(tmp)
# --------
#tmp = input_data[:, label_idx, slc_y_2, slc_x_2]
tmp = input_data[:, label_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]
if label_param != 'cloud_probability':
tmp = normalize(tmp, label_param, mean_std_dct)
if DO_ADD_NOISE:
......@@ -281,16 +284,12 @@ class SRCNN:
tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
tmp = np.where(tmp < 0.0, 0.0, tmp)
tmp = np.where(tmp > 1.0, 1.0, tmp)
tmp = np.where(np.isnan(tmp), 0, tmp)
tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
tmp = tmp[:, y_k, x_k]
data_norm.append(tmp)
# ---------
data = np.stack(data_norm, axis=3)
data = data.astype(np.float32)
# -----------------------------------------------------
# -----------------------------------------------------
#label = input_data[:, label_idx, y_128, x_128]
label = input_data[:, label_idx, :, :]
# label = smooth_2d(label, sigma=1.0)
label = label[:, y_128, x_128]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment