Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/climatebenchpress/data_loader/datasets/esa_biomass_cci.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Define rough bounding box coordinates for mainland France.
# Format: [min_longitude, min_latitude, max_longitude, max_latitude].
FRANCE_BBOX = [-5.5, 42.3, 9.6, 51.1]
FRANCE_BBOX = [-2.5, 42.3, 8.6, 49.1]

# Biomass estimate for the year 2020.
BIOMASS_URL = "https://dap.ceda.ac.uk/neodc/esacci/biomass/data/agb/maps/v5.01/netcdf/ESACCI-BIOMASS-L4-AGB-MERGED-100m-2020-fv5.01.nc"
Expand Down Expand Up @@ -47,11 +47,15 @@ def open(download_path: Path) -> xr.Dataset:
# The global snapshot would be around 20 GB, which is too large for our use case.
# We chose France because it should have a fairly diverse set of biomass estimates
# but the choice is overall somewhat arbitrary.
ds = ds.sel(
lon=slice(FRANCE_BBOX[0], FRANCE_BBOX[2]),
lat=slice(FRANCE_BBOX[3], FRANCE_BBOX[1]),
).chunk(-1)
return ds[["agb"]]
ds = (
ds[["agb"]]
.sel(
lon=slice(FRANCE_BBOX[0], FRANCE_BBOX[2]),
lat=slice(FRANCE_BBOX[3], FRANCE_BBOX[1]),
)
.chunk(-1)
)
return ds


if __name__ == "__main__":
Expand Down