Skip to content
Snippets Groups Projects
Commit 52851844 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 34d81d30
Branches
No related tags found
No related merge requests found
......@@ -1058,10 +1058,18 @@ def make_ts_bins():
keep_out_edges = make_ts_bins()
keep_out_edges = np.array(keep_out_edges)
def check_times(ts):
bidx = (find_bin_index(keep_out_edges, np.array([ts])))[0]
if bidx != -1 and bidx % 2 == 0:
return True
return False
def tile_extract(trnfile='/home/rink/tiles_l1b_train.h5', tstfile='/home/rink/tiles_l1b_test.h5', L1B_or_L2='L1B',
cld_mask_name='cloud_mask', augment=False, split=0.2):
cld_mask_name='cloud_mask', augment=False, split=0.2, check_keep_out=False):
icing_int_s = []
ice_time_s = []
no_ice_time_s = []
......@@ -1096,6 +1104,8 @@ 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):
if check_keep_out and not check_times(times[i]):
continue
cld_msk = f[cld_mask_name][i, 12:28, 12:28]
for ds_name in params:
dat = f[ds_name][i, 12:28, 12:28]
......@@ -1133,6 +1143,8 @@ def tile_extract(trnfile='/home/rink/tiles_l1b_train.h5', tstfile='/home/rink/ti
lats = f['latitude']
for i in range(num_obs):
if check_keep_out and not check_times(times[i]):
continue
cld_msk = f[cld_mask_name][i, 12:28, 12:28]
for ds_name in params:
dat = f[ds_name][i, 12:28, 12:28]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment