Skip to content

Commit 48e364c

Browse files
committed
Add comments
1 parent 694af89 commit 48e364c

5 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/climatebenchpress/data_loader/datasets/cams.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def download(download_path: Path, progress: bool = True):
3535
def open(download_path: Path) -> xr.Dataset:
3636
ds = xr.open_dataset(download_path / Path(NO2_FILE).name)
3737

38+
# Restrict data to a single day.
39+
# The specific day is arbitrary.
3840
ds = ds.sel(valid_time=slice("2023-06-15", "2023-06-15"))
3941
# Needed to make the dataset CF-compliant.
4042
ds.longitude.attrs["axis"] = "X"

src/climatebenchpress/data_loader/datasets/cmip6/abc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def download_with(
4848
zstore = zstore.replace("gs://", "https://storage.googleapis.com/")
4949

5050
ds = xr.open_zarr(fsspec.get_mapper(zstore), consolidated=True)
51-
# Only select the year 2020 for the dataset.
51+
# Only select the year 2020 for the dataset. The exact choice of this
52+
# year is arbitrary,
5253
# .chunk(-1) ensures that we only use a single chunk for the entire dataset.
5354
ds = ds.sel(time=slice("2020", "2020")).chunk(-1)
5455
if variable_selector is not None:

src/climatebenchpress/data_loader/datasets/era5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def download(download_path: Path, progress: bool = True):
2626

2727
era5 = xr.open_zarr(ERA5_GCP_PATH, chunks={"time": 48}, consolidated=True)
2828

29+
# Restrict data to a single day.
30+
# The specific day is arbitrary.
2931
ds = era5.sel(time=slice("2020-03-01", "2020-03-01"))[
3032
[
3133
"mean_sea_level_pressure",

src/climatebenchpress/data_loader/datasets/esa_biomass_cci.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def open(download_path: Path) -> xr.Dataset:
4444
# Needed to make the dataset CF-compliant.
4545
ds.lon.attrs["axis"] = "X"
4646
ds.lat.attrs["axis"] = "Y"
47+
# We are constraining the dataset to mainland France to reduce its overall size.
48+
# The global snapshot would be around 20 GB, which is too large for our use case.
49+
# We chose France because it should have a fairly diverse set of biomass estimates
50+
# but the choice is overall somewhat arbitrary.
4751
ds = ds.sel(
4852
lon=slice(FRANCE_BBOX[0], FRANCE_BBOX[2]),
4953
lat=slice(FRANCE_BBOX[3], FRANCE_BBOX[1]),

src/climatebenchpress/data_loader/datasets/nextgems.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def download(download_path: Path, progress: bool = True):
4444
zoom=ZOOM, time=TIME_RESOLUTION, chunks=dict()
4545
).to_dask()
4646

47+
# Restrict data to a single day.
48+
# The specific day is arbitrary.
4749
ds = icon[[PRECIP_KEY, OLR_KEY]].sel(time=slice("2020-03-01", "2020-03-01"))
4850
# Regrid the data to 0.125 degree resolution.
4951
# NOTE:

0 commit comments

Comments
 (0)