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

snaphot...

parent 14a39df5
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,19 @@ label_params = l2_params ...@@ -57,6 +57,19 @@ label_params = l2_params
data_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'): def run_all(directory, out_directory, day_night='ANY'):
cnt = 10 cnt = 10
...@@ -215,6 +228,8 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY') ...@@ -215,6 +228,8 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
continue continue
nda = data[:, j_m-border:j_stop, i_m-border:i_stop] nda = data[:, j_m-border:j_stop, i_m-border:i_stop]
if not keep_tile(param_s, nda):
continue
tiles.append(nda) tiles.append(nda)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment