From 7722bac7f4d1813517f460830fca73f6d92e6997 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Fri, 23 Jul 2021 13:54:41 -0500
Subject: [PATCH] tile_extract now masks out icing/no_icing pixels > 273K

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

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index dd88bbee..f28b3cd6 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -982,7 +982,7 @@ def fov_extract(outfile='/home/rink/fovs_l1b_out.h5', train_params=l1b_ds_list,
 
 
 def tile_extract(trnfile='/home/rink/tiles_l1b_train.h5', tstfile='/home/rink/tiles_l1b_test.h5',
-                 train_params=l1b_ds_list, ds_types=l1b_ds_types, augment=False, split=0.2):
+                 train_params=l1b_ds_list, ds_types=l1b_ds_types, cld_temp_name='temp_11_0um_nom', augment=False, split=0.2):
     icing_int_s = []
     ice_time_s = []
     no_ice_time_s = []
@@ -1010,8 +1010,10 @@ def tile_extract(trnfile='/home/rink/tiles_l1b_train.h5', tstfile='/home/rink/ti
         icing_int = f['icing_intensity'][:]
 
         for i in range(num_obs):
+            cld_tmp = f[cld_temp_name][:, 12:28, 12:28]
             for ds_name in train_params:
                 dat = f[ds_name][i, 12:28, 12:28]
+                np.where(cld_tmp < 273.0, dat, np.nan)
                 icing_data_dct[ds_name].append(dat)
 
             icing_int_s.append(icing_int[i])
@@ -1043,8 +1045,10 @@ def tile_extract(trnfile='/home/rink/tiles_l1b_train.h5', tstfile='/home/rink/ti
         lats = f['latitude']
 
         for i in range(num_obs):
+            cld_tmp = f[cld_temp_name][:, 12:28, 12:28]
             for ds_name in train_params:
                 dat = f[ds_name][i, 12:28, 12:28]
+                np.where(cld_tmp < 273.0, dat, np.nan)
                 no_icing_data_dct[ds_name].append(dat)
             num_no_ice += 1
             no_ice_time_s.append(times[i])
-- 
GitLab