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

snapshot...

parent fc869f41
Branches
No related tags found
No related merge requests found
......@@ -191,7 +191,6 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
solzen = get_grid_values(data_h5f, 'solar_zenith_angle', 0, 0, None, num_lines, num_pixels)
grd_s = []
for param in param_s:
fill_value, fill_value_name = get_fill_attrs(param)
try:
......@@ -200,38 +199,31 @@ def run(data_h5f, param_s, tiles, tile_width=64, kernel_size=9, day_night='ANY')
except Exception as e:
print(e)
return
data = np.stack(grd_s)
tile_width + 2 * border
num_keep_x_tiles = 4
#num_keep_x_tiles = 1
i_skip = num_keep_x_tiles * tile_width
j_skip = 1 * tile_width
i_skip = tile_width
j_skip = tile_width
i_start = int(num_pixels / 2) - int((num_keep_x_tiles * tile_width) / 2)
num_keep_y_tiles = 24
num_keep_y_tiles = int(num_lines / tile_width) - 1
for j in range(num_keep_y_tiles):
j_c = j * j_skip
j_m = j_c + border
j_a = j * j_skip
j_b = j_a + tile_width
for i in range(num_keep_x_tiles):
i_c = i * i_skip + i_start
i_m = i_c + border
j_stop = j_m + tile_width + border
if j_stop > num_lines - 1:
continue
i_stop = i_m + tile_width + border
if i_stop > num_pixels - 1:
continue
i_a = i_start + i * i_skip
i_b = i_a + tile_width
if day_night == 'DAY' and not is_day(solzen[j_m-border:j_stop, i_m-border:i_stop]):
if day_night == 'DAY' and not is_day(solzen[j_a:j_b, i_a:i_b]):
continue
elif day_night == 'NIGHT' and is_day(solzen[j_m-border:j_stop, i_m-border:i_stop]):
elif day_night == 'NIGHT' and is_day(solzen[j_a:j_b, i_a:i_b]):
continue
nda = data[:, j_m-border:j_stop, i_m-border:i_stop]
nda = data[:, j_a:j_b, i_a:i_b]
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 register or to comment