diff --git a/modules/util/viirs_l1b_l2.py b/modules/util/viirs_l1b_l2.py index d509392355e0e4fc9c0084b723569be98e310e1f..bf7fc59bd312f0ec856ce8152441ed9255f1e06d 100644 --- a/modules/util/viirs_l1b_l2.py +++ b/modules/util/viirs_l1b_l2.py @@ -46,9 +46,9 @@ def run_all(directory, out_directory): # if idx % 8 == 0: # if we want to skip some files if True: w_o_ext, ext = os.path.splitext(data_f) - label_f = data_f - # label_f = w_o_ext+'.highres'+ext - # label_f = label_f.replace('snpp_viirs', 'VNP02MOD') + # label_f = data_f + label_f = w_o_ext+'.highres'+ext + label_f = label_f.replace('snpp_viirs', 'VNP02MOD') if not os.path.exists(label_f): continue @@ -69,7 +69,7 @@ def run_all(directory, out_directory): label_tiles = [] 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: print(e) data_h5f.close() @@ -142,10 +142,12 @@ def run_all(directory, out_directory): 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: label_h5f = data_h5f + border = int((kernel_size - 1)/2) + l1b_param_name = data_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= #num_keep_x_tiles = 3 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((mod_tile_width) / 2) - #num_keep_y_tiles = 16 num_keep_y_tiles = 48 - j_skip = 3 * mod_tile_width for j in range(num_keep_y_tiles): j_c = j * j_skip j_m = j_c + border