From 53f96aa474b49577feb09b67a5ff49e6c167fe1b Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Thu, 29 Sep 2022 10:37:24 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/srcnn_l1b_l2.py | 35 ++++++++++++++--------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py
index 0217c377..b7d51531 100644
--- a/modules/deeplearning/srcnn_l1b_l2.py
+++ b/modules/deeplearning/srcnn_l1b_l2.py
@@ -652,23 +652,7 @@ class SRCNN:
         return self.do_evaluate(data, ckpt_dir)
 
 
-# def run_evaluate_static(in_file, out_file, ckpt_dir):
-#     nda = np.load(in_file)
-#
-#     nda = nda[:, data_idx, 3:131:2, 3:131:2]
-#     nda = resample(y_64, x_64, nda, s, t)
-#     nda = np.expand_dims(nda, axis=3)
-#
-#     nn = SRCNN()
-#     out_sr = nn.run_evaluate(nda, data_param, ckpt_dir)
-#     out_sr = denormalize(out_sr, param, mean_std_dct)
-#     if out_file is not None:
-#         np.save(out_file, out_sr)
-#     else:
-#         return out_sr
-
-
-def run_evaluate_static_new(in_file, out_file, ckpt_dir):
+def run_evaluate_static(in_file, out_file, ckpt_dir):
     h5f = h5py.File(in_file, 'r')
     grd_a = get_grid_values_all(h5f, data_params[0])
     grd_b = get_grid_values_all(h5f, 'cloud_fraction')
@@ -695,6 +679,23 @@ def run_evaluate_static_new(in_file, out_file, ckpt_dir):
         return out_sr
 
 
+def analyze():
+    h5f = h5py.File('/Users/tomrink/clavrx_snpp_viirs.A2019071.0000.001.2019071061610.uwssec_B00038187.level2.h5', 'r')
+    grd = get_grid_values_all(h5f, 'cloud_fraction')
+    grd = grd[::2, ::2]
+    print(grd.shape)
+    leny, lenx = grd.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 = resample_2d_linear_one(x, y, grd, x_up, y_up)
+    print(grd_a.shape)
+
+    h5f.close()
+
+
 if __name__ == "__main__":
     nn = SRCNN()
     nn.run('matchup_filename')
-- 
GitLab