Skip to content

Commit 8879741

Browse files
committed
Update test config; increase figure resolution
1 parent d36bbd0 commit 8879741

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

tests/integration/test_config.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
module_area_potentials:
2-
# Options for buffering: either a string of the form "epsg:xxxx" or "UTM"/"utm"
3-
# - "UTM": project each shape to the UTM zone of its centroid for buffering
4-
# - "epsg:xxxx": use the specified CRS for all buffering
5-
# A good option is "epsg:8857" (WGS 84 / Equal Earth Greenwich) for global coverage
62
buffer_crs: "epsg:8857"
73

4+
land_cover_types:
5+
POST_FLOODING: FARM
6+
RAINFED_CROPLANDS: FARM
7+
MOSAIC_CROPLAND: FARM
8+
MOSAIC_VEGETATION: FARM
9+
CLOSED_TO_OPEN_BROADLEAVED_FOREST: FOREST
10+
CLOSED_BROADLEAVED_FOREST: FOREST
11+
OPEN_BROADLEAVED_FOREST: FOREST
12+
CLOSED_NEEDLELEAVED_FOREST: FOREST
13+
OPEN_NEEDLELEAVED_FOREST: FOREST
14+
CLOSED_TO_OPEN_MIXED_FOREST: FOREST
15+
MOSAIC_FOREST: FOREST
16+
CLOSED_TO_OPEN_REGULARLY_FLOODED_FOREST: FOREST
17+
CLOSED_REGULARLY_FLOODED_FOREST: FOREST
18+
MOSAIC_GRASSLAND: OTHER
19+
CLOSED_TO_OPEN_SHRUBLAND: OTHER
20+
CLOSED_TO_OPEN_HERBS: OTHER
21+
SPARSE_VEGETATION: OTHER
22+
CLOSED_TO_OPEN_REGULARLY_FLOODED_GRASSLAND: OTHER
23+
BARE_AREAS: OTHER
24+
ARTIFICIAL_SURFACES_AND_URBAN_AREAS: URBAN
25+
WATER_BODIES: WATER
26+
PERMANENT_SNOW: NOT_SUITABLE
27+
NO_DATA: NOT_SUITABLE
28+
829
techs:
930
pv_rooftop:
1031
initial_area: settlement_area

workflow/scripts/resample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ def determine_pixel_areas(raster_input):
107107
"""
108108
# the following is based on https://gis.stackexchange.com/a/288034/77760
109109
# and assumes the data to be in EPSG:4326
110-
assert raster_input.rio.crs.to_epsg() == 4326, (
111-
"raster_input does not have the projection EPSG:4326"
112-
)
110+
assert (
111+
raster_input.rio.crs.to_epsg() == 4326
112+
), "raster_input does not have the projection EPSG:4326"
113113
resolution = raster_input.rio.resolution()[0] # resolution in degrees
114114
varea_of_pixel = np.vectorize(lambda lat: _area_of_pixel(resolution, lat))
115115
pixel_area = varea_of_pixel(raster_input.y) * 1000**2 # convert to m^2
@@ -289,7 +289,7 @@ def resample_inputs(
289289

290290
print("Saving image to plot path:", plot_path)
291291
# If needed, resample `resampled` to fit within a maximum of `max_pixels` pixels
292-
max_pixels = 1000000
292+
max_pixels = 5000000
293293
total_pixels = resampled.sizes["y"] * resampled.sizes["x"]
294294
if total_pixels > max_pixels:
295295
# Calculate the new resolution to fit within the max_pixels limit

workflow/scripts/script_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ def plot_all_dataset_variables(ds, ncols=2, savefig=None):
2929
plt.tight_layout()
3030

3131
if savefig:
32-
plt.savefig(savefig, bbox_inches="tight")
32+
plt.savefig(savefig, dpi=300, bbox_inches="tight")
3333

3434
return fig

0 commit comments

Comments
 (0)