From 91cd4715622a9c5d71f7e8a05bfff0524f2db3d8 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Mon, 13 Mar 2023 15:42:39 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/srcnn_l1b_l2.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/deeplearning/srcnn_l1b_l2.py b/modules/deeplearning/srcnn_l1b_l2.py
index 4084fdb6..5519fa21 100644
--- a/modules/deeplearning/srcnn_l1b_l2.py
+++ b/modules/deeplearning/srcnn_l1b_l2.py
@@ -727,8 +727,8 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
     h5f = h5py.File(in_file, 'r')
 
     grd_a = get_grid_values_all(h5f, 'super/temp_11_0um')
-    grd_a = grd_a[y_0:y_0+sub_y, x_0:x_0+sub_x]
     grd_a = np.where(np.isnan(grd_a), 0, grd_a)
+    grd_a = grd_a[y_0:y_0+sub_y, x_0:x_0+sub_x]
     hr_grd_a = grd_a.copy()
     grd_a = upsample_one(grd_a)
     grd_a = normalize(grd_a, 'super/temp_11_0um', mean_std_dct)
@@ -736,21 +736,20 @@ def run_evaluate_static(in_file, out_file, ckpt_dir):
 
     # ------------------------------------------------------
     grd_b = get_grid_values_all(h5f, 'super/refl_0_65um')
-    grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x]
     grd_b = np.where(np.isnan(grd_b), 0, grd_b)
+    grd_b = grd_b[y_0:y_0+sub_y, x_0:x_0+sub_x]
     hr_grd_b = grd_b.copy()
     hr_grd_b = hr_grd_b[y_128, x_128]
     # Full res:
-    grd_b = grd_b[slc_y, slc_x]
     grd_b = normalize(grd_b, 'super/refl_0_65um', mean_std_dct)
+    grd_b = grd_b[slc_y, slc_x]
 
     grd_c = get_grid_values_all(h5f, 'super/'+label_param)
+    grd_c = np.where(np.isnan(grd_c), 0, grd_c)
     grd_c = grd_c[y_0:y_0+sub_y, x_0:x_0+sub_x]
     hr_grd_c = grd_c.copy()
-    hr_grd_c = np.where(np.isnan(hr_grd_c), 0, grd_c)
     hr_grd_c = hr_grd_c[y_128, x_128]
 
-    grd_c = np.where(np.isnan(grd_c), 0, grd_c)
     grd_c = upsample_one(grd_c)
     if label_param != 'cloud_probability':
         grd_c = normalize(grd_c, 'super/'+label_param, mean_std_dct)
-- 
GitLab