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

snapshot...

parent d43daf13
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,8 @@ emis_params = ['temp_10_4um_nom', 'temp_11_0um_nom', 'temp_12_0um_nom', 'temp_13
# data_params = emis_params
# 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', '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']
label_params = l2_params
......@@ -99,6 +99,29 @@ def process_cld_prob_(grd_k):
return grd_k
def process_cld_opd(param_s, tile):
k = param_s.index('cld_opd_dcomp')
grd_k = tile[k, ].copy()
grd_k = process_cld_opd_(grd_k)
if grd_k is not None:
tile[k, ] = grd_k
return tile
else:
return None
def process_cld_opd_(grd_k):
keep = np.invert(np.isnan(grd_k))
num_keep = np.sum(keep)
if num_keep / grd_k.size < 0.98:
return None
grd_k = np.where(np.invert(keep), 0, grd_k)
keep = np.where(keep, np.logical_and(0.1 < grd_k, grd_k < 158.0), False)
if np.sum(keep)/num_keep < 0.50:
return None
return grd_k
def run_all(directory, out_directory, day_night='ANY', start=10):
cnt = start
total_num_train_samples = 0
......@@ -149,7 +172,6 @@ def run_all(directory, out_directory, day_night='ANY', start=10):
try:
run(data_h5f, data_params, data_train_tiles, data_valid_tiles, num_keep_x_tiles=num_keep_x_tiles, tile_width=128, kernel_size=11, day_night=day_night)
# run(data_h5f, label_params, label_data_tiles, label_valid_tiles, tile_width=128, kernel_size=7, day_night=day_night)
except Exception as e:
print(e)
data_h5f.close()
......@@ -242,10 +264,7 @@ def run(data_h5f, param_s, train_tiles, valid_tiles, num_keep_x_tiles=8, tile_wi
continue
nda = data[:, j_a:j_b, i_a:i_b]
# if not keep_tile(param_s, nda):
# continue
nda = process_cld_prob(param_s, nda)
nda = process_cld_opd(param_s, nda)
if nda is not None:
train_tiles.append(nda)
......@@ -264,10 +283,7 @@ def run(data_h5f, param_s, train_tiles, valid_tiles, num_keep_x_tiles=8, tile_wi
continue
nda = data[:, j_a:j_b, i_a:i_b]
# if not keep_tile(param_s, nda):
# continue
nda = process_cld_prob(param_s, nda)
nda = process_cld_opd(param_s, nda)
if nda is not None:
valid_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