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

snapshot...

parent d538344d
Branches
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import os, datetime
import numpy as np
import pickle
import h5py
import gc
LOG_DEVICE_PLACEMENT = False
......@@ -768,6 +769,7 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
h5f = h5py.File(in_file, 'r')
bt = get_grid_values_all(h5f, 'orig/temp_11_0um')
y_len, x_len = bt.shape[0], bt.shape[1]
lons = get_grid_values_all(h5f, 'longitude')
lats = get_grid_values_all(h5f, 'latitude')
bt = np.where(np.isnan(bt), 0, bt)
......@@ -795,11 +797,17 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
nn = SRCNN()
probs = nn.run_evaluate(data, ckpt_dir)
cld_frac = probs.argmax(axis=3)
cld_frac = cld_frac.astype(np.int8)
cld_frac_out = np.zeros((y_len, x_len), dtype=np.int8)
cld_frac_out[1:y_len - 1, 1:x_len - 1] = cld_frac[0, :, :]
bt = denormalize(bt, 'temp_11_0um_nom', mean_std_dct)
refl_avg = denormalize(refl_avg, 'refl_0_65um_nom', mean_std_dct)
if out_file is not None:
np.save(out_file, (cld_frac[0, :, :], denormalize(bt, 'temp_11_0um_nom', mean_std_dct), denormalize(refl_avg, 'refl_0_65um_nom', mean_std_dct), cp))
np.save(out_file, (cld_frac_out, bt, refl_avg, cp))
else:
return cld_frac[0, :, :], denormalize(bt, 'temp_11_0um_nom', mean_std_dct), denormalize(refl_avg, 'refl_0_65um_nom', mean_std_dct), cp
return cld_frac_out, bt, refl_avg, cp
def analyze2(nda_m, nda_i):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment