Skip to content

Commit

Permalink
Update ERA5 data downloading instructions for CDS-Beta and fix some d…
Browse files Browse the repository at this point in the history
…ocs typos (#17)

* Update example_era5.ipynb

Update `Downloading the Data` instructions for CDS-Beta.
Fix attribute for `surf_vars_ds` and `atmos_vars_ds` when instantiating a Batch.

* Update example_era5.ipynb

Add info about accepting terms of use to be able to download the dataset.

* Update example_hres_t0.ipynb

Update instructions for downloading ERA5 data according to CDS-Beta platform.
Fix attributes calling for `surf_vars_ds` and `atmos_vars_ds`.

* Update example_hres_t0.ipynb

Fix formatting

* Update example_hres_t0.ipynb

Add new line

* Update batch.md

Replace `Batch.static_vars` with `Batch.atmos_vars`
  • Loading branch information
luciano-drozda authored Aug 30, 2024
1 parent febfd97 commit 08ac374
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The following static variables are allowed:

## `Batch.atmos_vars`

`Batch.static_vars` is a dictionary mapping names of atmospheric variables to the
`Batch.atmos_vars` is a dictionary mapping names of atmospheric variables to the
numerical values of the variables.
The atmospheric variables must be of the form `(b, t, c, h, w)` where `b` is the batch size,
`t` the history dimension, `c` the number of pressure levels, `h` the number of latitudes,
Expand Down
14 changes: 8 additions & 6 deletions docs/example_era5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
"\n",
"## Downloading the Data\n",
"\n",
"To begin with, register an account with the [Climate Data Store](https://cds.climate.copernicus.eu/) and create `$HOME/.cdsapirc` with the following content:\n",
"To begin with, register an account with the [Climate Data Store](https://cds-beta.climate.copernicus.eu/) and create `$HOME/.cdsapirc` with the following content:\n",
"\n",
"```\n",
"url: https://cds.climate.copernicus.eu/api/v2\n",
"key: <UID>:<API key>\n",
"url: https://cds-beta.climate.copernicus.eu/api\n",
"key: <API key>\n",
"```\n",
"\n",
"You can find your UID and API key on your account page.\n",
"You can find your API key on your account page.\n",
"\n",
"In order to be able to download ERA5 data, you need to accept the terms of use in the [dataset page](https://cds-beta.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=download).\n",
"\n",
"We now download the ERA5 data."
]
Expand Down Expand Up @@ -196,8 +198,8 @@
" # Converting to `datetime64[s]` ensures that the output of `tolist()` gives\n",
" # `datetime.datetime`s. Note that this needs to be a tuple of length one:\n",
" # one value for every batch element.\n",
" time=(surf_vars_ds.time.values.astype(\"datetime64[s]\").tolist()[i],),\n",
" atmos_levels=tuple(int(level) for level in atmos_vars_ds.level.values),\n",
" time=(surf_vars_ds.valid_time.values.astype(\"datetime64[s]\").tolist()[i],),\n",
" atmos_levels=tuple(int(level) for level in atmos_vars_ds.pressure_level.values),\n",
" ),\n",
")"
]
Expand Down
14 changes: 8 additions & 6 deletions docs/example_hres_t0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,16 @@
"## Downloading Static Variables from ERA5 Data\n",
"\n",
"The static variables are not available in WeatherBench2, so we need to download them from ERA5, just like we did [in the example for ERA5](example_era5#downloading-the-data).\n",
"To do so, register an account with the [Climate Data Store](https://cds.climate.copernicus.eu/) and create `$HOME/.cdsapirc` with the following content:\n",
"To do so, register an account with the [Climate Data Store](https://cds-beta.climate.copernicus.eu/) and create `$HOME/.cdsapirc` with the following content:\n",
"\n",
"```\n",
"url: https://cds.climate.copernicus.eu/api/v2\n",
"key: <UID>:<API key>\n",
"url: https://cds-beta.climate.copernicus.eu/api\n",
"key: <API key>\n",
"```\n",
"\n",
"You can find your UID and API key on your account page."
"You can find your API key on your account page.\n",
"\n",
"In order to be able to download ERA5 data, you need to accept the terms of use in the [dataset page](https://cds-beta.climate.copernicus.eu/datasets/reanalysis-era5-single-levels?tab=download)."
]
},
{
Expand Down Expand Up @@ -220,8 +222,8 @@
" # Converting to `datetime64[s]` ensures that the output of `tolist()` gives\n",
" # `datetime.datetime`s. Note that this needs to be a tuple of length one:\n",
" # one value for every batch element.\n",
" time=(surf_vars_ds.time.values.astype(\"datetime64[s]\").tolist()[i],),\n",
" atmos_levels=tuple(int(level) for level in atmos_vars_ds.level.values),\n",
" time=(surf_vars_ds.valid_time.values.astype(\"datetime64[s]\").tolist()[i],),\n",
" atmos_levels=tuple(int(level) for level in atmos_vars_ds.pressure_level.values),\n",
" ),\n",
")"
]
Expand Down

0 comments on commit 08ac374

Please sign in to comment.