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

snapshot...

parent 9eebd114
No related branches found
No related tags found
No related merge requests found
...@@ -713,6 +713,50 @@ def run_restore_static(directory, ckpt_dir): ...@@ -713,6 +713,50 @@ def run_restore_static(directory, ckpt_dir):
nn.run_restore(directory, ckpt_dir) nn.run_restore(directory, ckpt_dir)
# def run_evaluate_static(in_file, out_file, ckpt_dir):
# N = 8
# sub_y, sub_x = (N+1) * 128, (N+1) * 128
# y_0, x_0, = 2500 - int(sub_y/2), 2500 - int(sub_x/2)
#
# slc_y_2, slc_x_2 = slice(1, 128*N + 6, 2), slice(1, 128*N + 6, 2)
# y_2, x_2 = np.arange((128*N)/2 + 3), np.arange((128*N)/2 + 3)
# t, s = np.arange(1, (128*N)/2 + 2, 0.5), np.arange(1, (128*N)/2 + 2, 0.5)
#
# h5f = h5py.File(in_file, 'r')
# grd_a = get_grid_values_all(h5f, 'temp_11_0um_nom')
# grd_a = grd_a[y_0:y_0+sub_y, x_0:x_0+sub_x]
# grd_a = grd_a[slc_y_2, slc_x_2]
# bt = grd_a
# grd_a = normalize(grd_a, 'temp_11_0um_nom', mean_std_dct)
# grd_a = resample_2d_linear_one(x_2, y_2, grd_a, t, s)
#
# grd_b = get_grid_values_all(h5f, 'refl_0_65um_nom')
# grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x]
# grd_b = grd_b[slc_y_2, slc_x_2]
# refl = grd_b
# grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct)
# grd_b = resample_2d_linear_one(x_2, y_2, grd_b, t, s)
#
# grd_c = get_grid_values_all(h5f, label_param)
# grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x]
# grd_c = grd_c[slc_y_2, slc_x_2]
# if label_param != 'cloud_probability':
# grd_c = normalize(grd_c, label_param, mean_std_dct)
# grd_c = resample_2d_linear_one(x_2, y_2, grd_c, t, s)
#
# data = np.stack([grd_a, grd_b, grd_c], axis=2)
# data = np.expand_dims(data, axis=0)
#
# nn = SRCNN()
# out_sr = nn.run_evaluate(data, ckpt_dir)
# if label_param != 'cloud_probability':
# out_sr = denormalize(out_sr, label_param, mean_std_dct)
# if out_file is not None:
# np.save(out_file, out_sr)
# else:
# return out_sr, bt, refl
def run_evaluate_static(in_file, out_file, ckpt_dir): def run_evaluate_static(in_file, out_file, ckpt_dir):
N = 8 N = 8
sub_y, sub_x = (N+1) * 128, (N+1) * 128 sub_y, sub_x = (N+1) * 128, (N+1) * 128
...@@ -725,17 +769,17 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): ...@@ -725,17 +769,17 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
h5f = h5py.File(in_file, 'r') h5f = h5py.File(in_file, 'r')
grd_a = get_grid_values_all(h5f, 'temp_11_0um_nom') grd_a = get_grid_values_all(h5f, 'temp_11_0um_nom')
grd_a = grd_a[y_0:y_0+sub_y, x_0:x_0+sub_x] grd_a = grd_a[y_0:y_0+sub_y, x_0:x_0+sub_x]
grd_a = grd_a[slc_y_2, slc_x_2] #grd_a = grd_a[slc_y_2, slc_x_2]
bt = grd_a bt = grd_a
grd_a = normalize(grd_a, 'temp_11_0um_nom', mean_std_dct) grd_a = normalize(grd_a, 'temp_11_0um_nom', mean_std_dct)
grd_a = resample_2d_linear_one(x_2, y_2, grd_a, t, s) #grd_a = resample_2d_linear_one(x_2, y_2, grd_a, t, s)
grd_b = get_grid_values_all(h5f, 'refl_0_65um_nom') grd_b = get_grid_values_all(h5f, 'refl_0_65um_nom')
grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x] grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x]
grd_b = grd_b[slc_y_2, slc_x_2] #grd_b = grd_b[slc_y_2, slc_x_2]
refl = grd_b refl = grd_b
grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct) grd_b = normalize(grd_b, 'refl_0_65um_nom', mean_std_dct)
grd_b = resample_2d_linear_one(x_2, y_2, grd_b, t, s) #grd_b = resample_2d_linear_one(x_2, y_2, grd_b, t, s)
grd_c = get_grid_values_all(h5f, label_param) grd_c = get_grid_values_all(h5f, label_param)
grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x] grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x]
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment