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

snapshot...

parent eb456941
Branches
No related tags found
No related merge requests found
......@@ -752,30 +752,22 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
def run_evaluate_static_2(in_file, out_file, ckpt_dir):
nda = np.load(in_file)
grd_a = nda[:, 0, :, :]
grd_a = grd_a[:, 3:131:2, 3:131:2]
grd_b = nda[:, 2, 3:131, 3:131]
grd_c = nda[:, 3, :, :]
grd_c = grd_c[:, 3:131:2, 3:131:2]
num, leny, lenx = grd_a.shape
x = np.arange(lenx)
y = np.arange(leny)
x_up = np.arange(0, lenx, 0.5)
y_up = np.arange(0, leny, 0.5)
grd_a = nda[:, 0, :, :]
grd_a = grd_a[:, slc_y_2, slc_x_2]
grd_a = normalize(grd_a, 'temp_11_0um_nom', mean_std_dct)
grd_a = resample_2d_linear(x, y, grd_a, x_up, y_up)
grd_a = resample_2d_linear(x_2, y_2, grd_a, t, s)
grd_b = nda[:, 2, :, :]
grd_b = grd_b[:, slc_y_2, slc_x_2]
grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct)
grd_b = resample_2d_linear(x_2, y_2, grd_b, t, s)
if label_param == 'cloud_fraction':
grd_c = np.where(np.isnan(grd_c), 0, grd_c)
else:
grd_c = nda[:, 3, :, :]
grd_c = grd_c[:, slc_y_2, slc_x_2]
if label_param != 'cloud_fraction':
grd_c = normalize(grd_c, label_param, mean_std_dct)
grd_c = resample_2d_linear(x, y, grd_c, x_up, y_up)
grd_c = resample_2d_linear(x_2, y_2, grd_c, t, s)
data = np.stack([grd_a, grd_b, grd_c], axis=3)
print(data.shape)
......@@ -783,7 +775,7 @@ def run_evaluate_static_2(in_file, out_file, ckpt_dir):
nn = SRCNN()
out_sr = nn.run_evaluate(data, ckpt_dir)
if label_param != 'cloud_fraction':
# out_sr = denormalize(out_sr, label_param, mean_std_dct)
out_sr = denormalize(out_sr, label_param, mean_std_dct)
pass
if out_file is not None:
np.save(out_file, out_sr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment