paren8esis
commited on
Commit
·
4eb4415
1
Parent(s):
6ee48af
Fix bugs in S4A.py
Browse files
S4A.py
CHANGED
@@ -138,32 +138,47 @@ class S4A(datasets.GeneratorBasedBuilder):
|
|
138 |
x, y = PATCH_IDX[year][tile]
|
139 |
for x_i in range(x + 1):
|
140 |
for y_i in range(y + 1):
|
141 |
-
|
142 |
-
|
|
|
|
|
|
|
|
|
143 |
elif self.config.name == 'cat_2019':
|
144 |
year = '2019'
|
145 |
for tile in CAT_TILES:
|
146 |
x, y = PATCH_IDX[year][tile]
|
147 |
for x_i in range(x + 1):
|
148 |
for y_i in range(y + 1):
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
151 |
elif self.config.name == 'cat_2020':
|
152 |
year = '2020'
|
153 |
for tile in CAT_TILES:
|
154 |
x, y = PATCH_IDX[year][tile]
|
155 |
for x_i in range(x + 1):
|
156 |
for y_i in range(y + 1):
|
157 |
-
|
158 |
-
|
|
|
|
|
|
|
|
|
159 |
elif self.config.name == 'fr_2019':
|
160 |
year = '2019'
|
161 |
for tile in FR_TILES:
|
162 |
x, y = PATCH_IDX[year][tile]
|
163 |
for x_i in range(x + 1):
|
164 |
for y_i in range(y + 1):
|
165 |
-
|
166 |
-
|
|
|
|
|
|
|
167 |
|
168 |
return [
|
169 |
datasets.SplitGenerator(
|
|
|
138 |
x, y = PATCH_IDX[year][tile]
|
139 |
for x_i in range(x + 1):
|
140 |
for y_i in range(y + 1):
|
141 |
+
try:
|
142 |
+
downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
|
143 |
+
root_paths.append(downloaded_paths)
|
144 |
+
except FileNotFoundError as e:
|
145 |
+
continue
|
146 |
+
|
147 |
elif self.config.name == 'cat_2019':
|
148 |
year = '2019'
|
149 |
for tile in CAT_TILES:
|
150 |
x, y = PATCH_IDX[year][tile]
|
151 |
for x_i in range(x + 1):
|
152 |
for y_i in range(y + 1):
|
153 |
+
try:
|
154 |
+
downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
|
155 |
+
root_paths.append(downloaded_paths)
|
156 |
+
except FileNotFoundError as e:
|
157 |
+
continue
|
158 |
+
|
159 |
elif self.config.name == 'cat_2020':
|
160 |
year = '2020'
|
161 |
for tile in CAT_TILES:
|
162 |
x, y = PATCH_IDX[year][tile]
|
163 |
for x_i in range(x + 1):
|
164 |
for y_i in range(y + 1):
|
165 |
+
try:
|
166 |
+
downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
|
167 |
+
root_paths.append(downloaded_paths)
|
168 |
+
except FileNotFoundError as e:
|
169 |
+
continue
|
170 |
+
|
171 |
elif self.config.name == 'fr_2019':
|
172 |
year = '2019'
|
173 |
for tile in FR_TILES:
|
174 |
x, y = PATCH_IDX[year][tile]
|
175 |
for x_i in range(x + 1):
|
176 |
for y_i in range(y + 1):
|
177 |
+
try:
|
178 |
+
downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
|
179 |
+
root_paths.append(downloaded_paths)
|
180 |
+
except FileNotFoundError as e:
|
181 |
+
continue
|
182 |
|
183 |
return [
|
184 |
datasets.SplitGenerator(
|