|
15 | 15 | from pyproj import Proj, transform, Transformer |
16 | 16 |
|
17 | 17 | dc_files_dir = 'Data/extreme_data/extreme_context_data_paths' |
18 | | -ex_lc_dir = 'Data/extreme/extreme_test_split/lc' |
| 18 | +ex_lc_dir = 'D:/DS_Lab/Data/extreme_data/extreme_test_split/lc' |
19 | 19 |
|
20 | | -lc_files_dir='C:/Users/Oto/Downloads/ESA_WorldCover_10m_2021_v200_60deg_macrotile_N30E000' |
| 20 | +lc_files_dir='D:/DS_Lab/Data/ESA_WorldCover_10m_2021_v200_60deg_macrotile_N30E000' |
21 | 21 | ESA_file_prefix = 'ESA_WorldCover_10m_2021_V200_' |
22 | 22 | ESA_file_suffix = '_Map.tif' |
23 | 23 |
|
24 | 24 | if not isdir(join(os.getcwd(), ex_lc_dir)): |
25 | 25 | os.mkdir(join(os.getcwd(), ex_lc_dir)) |
26 | 26 |
|
27 | | -with open(join(os.getcwd(), "Data/extreme_data/extreme_context_data_paths.pkl"),'rb') as f: |
| 27 | +with open(join(os.getcwd(), "Data/extreme_data/extreme_data_context_data_paths.pkl"),'rb') as f: |
28 | 28 | dc_paths = pickle.load(f) |
29 | 29 |
|
30 | 30 | ESA_num_pixes = 36000 |
@@ -63,6 +63,11 @@ def get_lc_map_for_dc(dc_name): |
63 | 63 | open_tifs[ESA_file] = tif_file.read() |
64 | 64 |
|
65 | 65 | rel_ESA_N, rel_ESA_E = get_rel_ESA_coord(x, y) |
| 66 | + # Slightly hacky way of dealing with ESA cude boundaries |
| 67 | + if rel_ESA_E == ESA_num_pixes or rel_ESA_N == ESA_num_pixes: |
| 68 | + rel_ESA_E -= 1 |
| 69 | + rel_ESA_N -= 1 |
| 70 | + # Fails at idx 553 |
66 | 71 | pixel_lc = get_lc_for_pixel(rel_ESA_N, rel_ESA_E, open_tifs[ESA_file]) |
67 | 72 |
|
68 | 73 | dc_lc_map[j, k] = pixel_lc |
|
0 commit comments