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

snapshot...

parent f853bcd5
Branches
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ import glob ...@@ -2,7 +2,7 @@ import glob
import tensorflow as tf import tensorflow as tf
from util.setup import logdir, modeldir, now, ancillary_path from util.setup import logdir, modeldir, now, ancillary_path
from util.util import EarlyStop, normalize, denormalize, get_grid_values_all, resample_2d_linear from util.util import EarlyStop, normalize, denormalize, scale, descale, get_grid_values_all, resample_2d_linear
import os, datetime import os, datetime
import numpy as np import numpy as np
import pickle import pickle
...@@ -291,7 +291,8 @@ class SRCNN: ...@@ -291,7 +291,8 @@ class SRCNN:
# ----------------------------------------------------- # -----------------------------------------------------
# ----------------------------------------------------- # -----------------------------------------------------
label = input_label[:, label_idx_i, :, :] label = input_label[:, label_idx_i, :, :]
label = normalize(label, label_param, mean_std_dct) # label = normalize(label, label_param, mean_std_dct)
label = scale(label, label_param, mean_std_dct)
label = label[:, self.y_128, self.x_128] label = label[:, self.y_128, self.x_128]
label = np.where(np.isnan(label), 0, label) label = np.where(np.isnan(label), 0, label)
...@@ -729,7 +730,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): ...@@ -729,7 +730,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
cld_opd = cld_opd[nn.slc_y_m, nn.slc_x_m] cld_opd = cld_opd[nn.slc_y_m, nn.slc_x_m]
cld_opd = np.expand_dims(cld_opd, axis=0) cld_opd = np.expand_dims(cld_opd, axis=0)
cld_opd = nn.upsample(cld_opd) cld_opd = nn.upsample(cld_opd)
cld_opd = normalize(cld_opd, label_param, mean_std_dct) # cld_opd = normalize(cld_opd, label_param, mean_std_dct)
cld_opd = scale(cld_opd, label_param, mean_std_dct)
print('OPD done') print('OPD done')
data = np.stack([bt, refl, cld_opd], axis=3) data = np.stack([bt, refl, cld_opd], axis=3)
...@@ -737,7 +739,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): ...@@ -737,7 +739,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
h5f.close() h5f.close()
cld_opd_sres = nn.run_evaluate(data, ckpt_dir) cld_opd_sres = nn.run_evaluate(data, ckpt_dir)
cld_opd_sres = denormalize(cld_opd_sres, label_param, mean_std_dct) # cld_opd_sres = denormalize(cld_opd_sres, label_param, mean_std_dct)
cld_opd_sres = descale(cld_opd_sres, label_param, mean_std_dct)
_, ylen, xlen, _ = cld_opd_sres.shape _, ylen, xlen, _ = cld_opd_sres.shape
print('OUT: ', ylen, xlen) print('OUT: ', ylen, xlen)
...@@ -751,7 +754,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir): ...@@ -751,7 +754,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
cld_opd_out[0:(ylen+2*border), 0:(xlen+2*border)] = cld_opd[0, :, :] cld_opd_out[0:(ylen+2*border), 0:(xlen+2*border)] = cld_opd[0, :, :]
refl_out = denormalize(refl_out, 'refl_0_65um_nom', mean_std_dct) refl_out = denormalize(refl_out, 'refl_0_65um_nom', mean_std_dct)
cld_opd_out = denormalize(cld_opd_out, label_param, mean_std_dct) # cld_opd_out = denormalize(cld_opd_out, label_param, mean_std_dct)
cld_opd_out = descale(cld_opd_out, label_param, mean_std_dct)
if out_file is not None: if out_file is not None:
np.save(out_file, (cld_opd_sres_out, refl_out, cld_opd_out, cld_opd_hres)) np.save(out_file, (cld_opd_sres_out, refl_out, cld_opd_out, cld_opd_hres))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment