From e9fb1f90c0a79fa5c17b7fb9f9ab76a07d81c663 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Fri, 15 Dec 2023 11:18:02 -0600 Subject: [PATCH] snapshot... --- modules/icing/pirep_goes.py | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/modules/icing/pirep_goes.py b/modules/icing/pirep_goes.py index 9094c875..80881ce1 100644 --- a/modules/icing/pirep_goes.py +++ b/modules/icing/pirep_goes.py @@ -755,14 +755,6 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): ice_keys_2 = np.array(ice_keys_2) ice_tidx_2 = np.array(ice_tidx_2, dtype='int64') print('2: ', ice_keys_2.shape[0]) - np.random.seed(42) - ridxs = np.random.permutation(np.arange(ice_keys_2.shape[0])) - ice_keys_2 = ice_keys_2[ridxs] - ice_tidx_2 = ice_tidx_2[ridxs] - num = int(ice_keys_2.shape[0] * 0.9) - ice_keys_2 = ice_keys_2[0:num] - ice_tidx_2 = ice_tidx_2[0:num] - print('2: reduced: ', ice_tidx_2.shape) ice_keys_1 = np.array(ice_keys_1) ice_tidx_1 = np.array(ice_tidx_1, dtype='int64') @@ -786,8 +778,8 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): ridxs = np.random.permutation(np.arange(no_ice_keys.shape[0])) no_ice_keys = no_ice_keys[ridxs] no_ice_tidx = no_ice_tidx[ridxs] - no_ice_keys = no_ice_keys[::4] - no_ice_tidx = no_ice_tidx[::4] + no_ice_keys = no_ice_keys[::3] + no_ice_tidx = no_ice_tidx[::3] print('no ice reduced: ', no_ice_keys.shape[0]) print('---------------------------------') @@ -804,7 +796,7 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): all_which = all_which[sidxs] grd_bins = np.full((lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) - #grd_bins = np.full((hgt_space_3000.shape[0], lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) + # grd_bins = np.full((hgt_space_3000.shape[0], lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) cnt_i = 0 cnt_ni = 0 for idx, key in enumerate(all_keys): @@ -819,9 +811,10 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): lat, lon, falt = tup[0], tup[1], tup[2] - #if not check_no_overlap_alt(lon, lat, falt, key, grd_bins, t_delta=t_delta): + # if not check_no_overlap_alt(lon, lat, falt, key, grd_bins, t_delta=t_delta): if not check_no_overlap(lon, lat, key, grd_bins, t_delta=t_delta): - continue + # continue + pass if i_ni == 0: cnt_ni += 1 @@ -846,7 +839,7 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): neg_ice_tidx = np.array(neg_ice_tidx) print('neg ice total: ', neg_ice_keys.shape[0]) - #grd_bins = np.full((hgt_space_3000.shape[0], lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) + # grd_bins = np.full((hgt_space_3000.shape[0], lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) grd_bins = np.full((lat_space_hdeg.shape[0], lon_space_hdeg.shape[0]), -(t_delta+1)) cnt = 0 for idx, key in enumerate(neg_ice_keys): @@ -854,9 +847,10 @@ def process(ice_dct, no_ice_dct, neg_ice_dct, t_delta=600): tup = rpts[neg_ice_tidx[idx]] lat, lon, falt = tup[0], tup[1], tup[2] - #if not check_no_overlap_alt(lon, lat, falt, key, grd_bins, t_delta=t_delta): + # if not check_no_overlap_alt(lon, lat, falt, key, grd_bins, t_delta=t_delta): if not check_no_overlap(lon, lat, key, grd_bins, t_delta=t_delta): - continue + # continue + pass cnt += 1 n_rpts = new_neg_ice_dct.get(key) -- GitLab