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

snapshot...

parent 811850f0
No related branches found
No related tags found
No related merge requests found
......@@ -53,14 +53,15 @@ emis_params = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13
# l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'cloud_fraction']
# l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', 'cld_opd_dcomp']
# l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', 'cloud_probability']
l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', 'cloud_fraction']
l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', 'cloud_probability']
# l2_params = ['temp_11_0um_nom', 'temp_12_0um_nom', 'refl_0_65um_nom', 'cloud_fraction']
label_params = l2_params
data_params = l2_params
def keep_tile(param_s, tile):
pass
k = param_s.index('cloud_fraction')
grd_k = tile[k, ].flatten()
keep = np.invert(np.isnan(grd_k))
......@@ -76,6 +77,19 @@ def keep_tile(param_s, tile):
return False
def process_cld_prob(param_s, tile):
k = param_s.index('cloud_probability')
grd_k = tile[k, ].flatten().copy()
keep = np.invert(np.isnan(grd_k))
total = np.sum(keep)
if total == 0:
return None
grd_k = np.where(np.logical_and(keep, grd_k < 0.5), 0.0, 1.0)
tile[k,] = grd_k
return tile
def run_all(directory, out_directory, day_night='ANY'):
cnt = 10
......@@ -244,7 +258,10 @@ def run(data_h5f, param_s, train_tiles, valid_tiles, num_keep_x_tiles=8, tile_wi
nda = data[:, j_a:j_b, i_a:i_b]
if not keep_tile(param_s, nda):
continue
valid_tiles.append(nda)
nda = process_cld_prob(param_s, nda)
if nda is not None:
valid_tiles.append(nda)
def scan(directory):
......
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