From 4e863faf0161116c21a10bf13968f2134a89e9bd Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Thu, 15 Jul 2021 13:46:51 -0500
Subject: [PATCH] minor...

---
 modules/icing/pirep_goes.py | 40 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index 31b5f166..1f5c71dc 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -3,7 +3,7 @@ import numpy as np
 import pickle
 import matplotlib.pyplot as plt
 import os
-from util.util import get_time_tuple_utc, GenericException, add_time_range_to_filename, is_night, is_day
+from util.util import get_time_tuple_utc, GenericException, add_time_range_to_filename, is_night, is_day, get_grid_values_all
 from aeolus.datasource import CLAVRx, GOESL1B
 from util.geos_nav import GEOSNavigation
 import h5py
@@ -303,6 +303,44 @@ def run(pirep_dct, outfile=None, outfile_l1b=None, dt_str_start=None, dt_str_end
         create_file(outfile_l1b, data_dct, l1b_ds_list, l1b_ds_types, lon_c, lat_c, time_s, fl_alt_s, ice_int_s, unq_ids)
 
 
+def make_for_full_domain_predict(clvrx_file, name_list=l1b_ds_list):
+    w_x = 16
+    w_y = 16
+    xlen = 2500
+    ylen = 1500
+
+    h5f = h5py.File(clvrx_file, 'r')
+
+    grd_dct = {name: [] for name in name_list}
+
+    cnt_a = 0
+    for didx, ds_name in enumerate(name_list):
+        gvals = get_grid_values_all(h5f, ds_name)
+        if gvals is not None:
+            grd_dct[ds_name].append(gvals)
+            cnt_a += 1
+
+    if cnt_a > 0 and cnt_a != len(ds_list):
+        raise GenericException('weirdness')
+
+    grd_dct_n = {name: [] for name in name_list}
+
+    n_x = int(xlen/w_x)
+    n_y = int(ylen/w_y)
+
+    i_0 = 0
+    j_0 = 0
+
+    for didx, ds_name in enumerate(ds_list):
+        for j in range(4, n_y-4, 1):
+            j_ul = j_0 + j * w_y
+            for i in range(4, n_x-4, 1):
+                i_ul = i_0 + i * w_x
+                grd_dct_n[ds_name].append(grd_dct[ds_name][j_ul:j_ul+w_y, i_ul:i_ul+w_x])
+
+    return grd_dct_n
+
+
 def analyze(ice_dct, no_ice_dct):
 
     last_file = None
-- 
GitLab