From 4b387cdc2dfbb357961f41759798213b9d58a204 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Mon, 29 Aug 2022 10:49:11 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/espcn.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/deeplearning/espcn.py b/modules/deeplearning/espcn.py
index 83189b9b..0a1d1065 100644
--- a/modules/deeplearning/espcn.py
+++ b/modules/deeplearning/espcn.py
@@ -670,10 +670,17 @@ def prepare(param_idx=1, filename='/Users/tomrink/data_valid_40.npy'):
     return nda_lr
 
 
-def run_evaluate_static(nda_lr, param='temp_11_0um_nom', ckpt_dir='/Users/tomrink/tf_model_sres/run-20220805173619/'):
+def run_evaluate_static(in_file, out_file, param='temp_11_0um_nom', ckpt_dir='/Users/tomrink/tf_model_sres/run-20220805173619/'):
+    nda = np.load(in_file)
+    nda = nda[:, data_idx, 2:133:2, 2:133:2]
+    nda = np.expand_dims(nda, axis=3)
+
     nn = ESPCN()
-    out_sr = nn.run_evaluate(nda_lr, param, ckpt_dir)
-    return out_sr
+    out_sr = nn.run_evaluate(nda, param, ckpt_dir)
+    if out_file is not None:
+        np.save(out_file, out_sr)
+    else:
+        return out_sr
 
 
 if __name__ == "__main__":
-- 
GitLab