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

snaphot...

parent 14a39df5
Branches
No related tags found
No related merge requests found
......@@ -57,6 +57,19 @@ label_params = l2_params
data_params = l2_params
def keep_tile(param_s, tile):
k = param_s.index('cloud_fraction')
grd_k = tile[k, ].flatten()
keep = np.invert(np.isnan(grd_k))
total = np.sum(keep)
keep = np.where(keep, np.invert(0.05 < grd_k < 0.95), False)
if keep/total > 0.5:
return True
else:
return False
def run_all(directory, out_directory, day_night='ANY'):
cnt = 10
......@@ -215,6 +228,8 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
continue
nda = data[:, j_m-border:j_stop, i_m-border:i_stop]
if not keep_tile(param_s, nda):
continue
tiles.append(nda)
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment