From 665157a1c85184458eacdec85457cf206f95a2af Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Fri, 6 Aug 2021 15:37:03 -0500
Subject: [PATCH] fix stupid bug

---
 modules/icing/pirep_goes.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py
index dcede0b3..fe39d0e5 100644
--- a/modules/icing/pirep_goes.py
+++ b/modules/icing/pirep_goes.py
@@ -1088,7 +1088,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, cld_temp_name='temp_11_0um_nom', augment=False, split=0.2):
+                 train_params=l1b_ds_list, ds_types=l1b_ds_types, cld_mask_name='cloud_mask', augment=False, split=0.2):
     icing_int_s = []
     ice_time_s = []
     no_ice_time_s = []
@@ -1116,10 +1116,12 @@ 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][i, 12:28, 12:28]
+            cld_msk = f[cld_mask_name][i, 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)
+                # np.where(cld_tmp < 273.0, dat, np.nan)
+                #keep = np.logical_or(cld_msk[i,] == 2, cld_msk[i,] == 3)  # cloudy
+                #np.where(keep, dat, np.nan)
                 icing_data_dct[ds_name].append(dat)
 
             icing_int_s.append(icing_int[i])
@@ -1151,10 +1153,12 @@ 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][i, 12:28, 12:28]
+            cld_msk = f[cld_mask_name][i, 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)
+                # np.where(cld_tmp < 273.0, dat, np.nan)
+                #keep = np.logical_or(cld_msk[i,] == 2, cld_msk[i,] == 3)  # cloudy
+                #np.where(keep, dat, np.nan)
                 no_icing_data_dct[ds_name].append(dat)
             num_no_ice += 1
             no_ice_time_s.append(times[i])
-- 
GitLab