From aed2347383e8ff3336237c1c00aeaca7448f9616 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Sun, 25 Jun 2023 11:56:11 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/cloud_opd_srcnn_abi.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/deeplearning/cloud_opd_srcnn_abi.py b/modules/deeplearning/cloud_opd_srcnn_abi.py
index 79798069..cf8955eb 100644
--- a/modules/deeplearning/cloud_opd_srcnn_abi.py
+++ b/modules/deeplearning/cloud_opd_srcnn_abi.py
@@ -8,6 +8,7 @@ import os, datetime
 import numpy as np
 import pickle
 import h5py
+import time
 
 LOG_DEVICE_PLACEMENT = False
 
@@ -716,13 +717,14 @@ class SRCNN:
         LEN_Y, LEN_X = refl.shape
         print(LEN_Y, LEN_X)
 
+        t0 = time.time()
         bt = get_grid_values_all(h5f, 'temp_11_0um_nom')
-
         cld_opd = get_grid_values_all(h5f, 'cld_opd_dcomp')
-
         refl_sub_lo = get_grid_values_all(h5f, 'refl_0_65um_nom_min_sub')
         refl_sub_hi = get_grid_values_all(h5f, 'refl_0_65um_nom_max_sub')
         refl_sub_std = get_grid_values_all(h5f, 'refl_0_65um_nom_stddev_sub')
+        t1 = time.time()
+        print('read data time: ', (t1 - t0))
 
         self.run_inference_(bt, refl_sub_lo, refl_sub_hi, refl_sub_std, cld_opd, LEN_Y, LEN_X)
 
@@ -743,6 +745,7 @@ class SRCNN:
         # refl_us = normalize(refl_us, 'refl_0_65um_nom', mean_std_dct)
         # print('REFL done')
 
+        t0 = time.time()
         bt = np.where(np.isnan(bt), 0, bt)
         bt = bt[slc_y, slc_x]
         bt = np.expand_dims(bt, axis=0)
@@ -770,6 +773,8 @@ class SRCNN:
         cld_opd_us = upsample_static(cld_opd, x_2, y_2, t, s, None, None)
         cld_opd_us = normalize(cld_opd_us, label_param, mean_std_dct)
         print('OPD done')
+        t1 = time.time()
+        print('upsample/normalize time: ', (t1 - t0))
 
         data = np.stack([bt_us, refl_sub_lo, refl_sub_hi, refl_sub_std, cld_opd_us], axis=3)
 
-- 
GitLab