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

snapshot...

parent 9f609652
No related branches found
No related tags found
No related merge requests found
...@@ -46,9 +46,9 @@ def run_all(directory, out_directory): ...@@ -46,9 +46,9 @@ def run_all(directory, out_directory):
# if idx % 8 == 0: # if we want to skip some files # if idx % 8 == 0: # if we want to skip some files
if True: if True:
w_o_ext, ext = os.path.splitext(data_f) w_o_ext, ext = os.path.splitext(data_f)
label_f = data_f # label_f = data_f
# label_f = w_o_ext+'.highres'+ext label_f = w_o_ext+'.highres'+ext
# label_f = label_f.replace('snpp_viirs', 'VNP02MOD') label_f = label_f.replace('snpp_viirs', 'VNP02MOD')
if not os.path.exists(label_f): if not os.path.exists(label_f):
continue continue
...@@ -69,7 +69,7 @@ def run_all(directory, out_directory): ...@@ -69,7 +69,7 @@ def run_all(directory, out_directory):
label_tiles = [] label_tiles = []
try: try:
run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=16, border=7) run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=32, kernel_size=7)
except Exception as e: except Exception as e:
print(e) print(e)
data_h5f.close() data_h5f.close()
...@@ -142,10 +142,12 @@ def run_all(directory, out_directory): ...@@ -142,10 +142,12 @@ def run_all(directory, out_directory):
print('num_train_samples, num_valid_samples: ', num_train_samples, num_valid_samples) print('num_train_samples, num_valid_samples: ', num_train_samples, num_valid_samples)
def run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=64, border=9): def run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=64, kernel_size=9):
if label_h5f is None: if label_h5f is None:
label_h5f = data_h5f label_h5f = data_h5f
border = int((kernel_size - 1)/2)
l1b_param_name = data_params[0] l1b_param_name = data_params[0]
l2_param_name = label_params[0] l2_param_name = label_params[0]
...@@ -185,13 +187,13 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=64, border= ...@@ -185,13 +187,13 @@ def run(data_h5f, label_h5f, data_tiles, label_tiles, mod_tile_width=64, border=
#num_keep_x_tiles = 3 #num_keep_x_tiles = 3
num_keep_x_tiles = 1 num_keep_x_tiles = 1
i_skip = 3 * mod_tile_width # i_skip = 3 * mod_tile_width
i_skip = 1
j_skip = 3 * mod_tile_width
#i_start = int(mod_num_pixels / 2) - int((num_keep_x_tiles * 3 * mod_tile_width) / 2) #i_start = int(mod_num_pixels / 2) - int((num_keep_x_tiles * 3 * mod_tile_width) / 2)
i_start = int(mod_num_pixels / 2) - int((mod_tile_width) / 2) i_start = int(mod_num_pixels / 2) - int((mod_tile_width) / 2)
#num_keep_y_tiles = 16
num_keep_y_tiles = 48 num_keep_y_tiles = 48
j_skip = 3 * mod_tile_width
for j in range(num_keep_y_tiles): for j in range(num_keep_y_tiles):
j_c = j * j_skip j_c = j * j_skip
j_m = j_c + border j_m = j_c + border
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment