Skip to content

Commit

Permalink
update comments & links
Browse files Browse the repository at this point in the history
+ dependency: add cdsapi>=0.7.0 version constraint on pyproject.toml and requirements.txt files

+ tests/test_dload.py: update print out website link

+ README:
   - remove obsolete link to retostauffer.org website
   - update link to the "create a new account" link
  • Loading branch information
yunjunz committed Sep 18, 2024
1 parent 6f49dbf commit e643c02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,19 @@ Test the installation by running:
python PyAPS/tests/test_calc.py
```

### 2. Account setup for [ERA5](https://retostauffer.org/code/Download-ERA5/)
### 2. Account setup for ERA5

Starting from 26 September 2024, ERA5 data set is redistributed over the Copernicus Climate Data Store (CDS)-beta ([guidlines](https://confluence.ecmwf.int/display/CKB/Please+read%3A+CDS+and+ADS+migrating+to+new+infrastructure%3A+Common+Data+Store+%28CDS%29+Engine)). Registration is required for the data access and downloading.
ERA5 data set is redistributed over the Copernicus Climate Data Store (CDS)-beta ([migration guide](https://confluence.ecmwf.int/display/CKB/Please+read%3A+CDS+and+ADS+migrating+to+new+infrastructure%3A+Common+Data+Store+%28CDS%29+Engine)). Registration is required for the data access and downloading.


+ [Create a new account](https://cds.climate.copernicus.eu/user/register) on the CDS website if you don't own a user account yet.
+ [CDS API setup](https://cds-beta.climate.copernicus.eu/how-to-api#install-the-cds-api-client): Create the local file `$HOME/.cdsapirc` and add the following two lines:
+ [Create a new account](https://cds-beta.climate.copernicus.eu/) on the CDS-beta website if you don't own a user account yet. Note: the old CDS account won't work.
+ [CDS API setup](https://cds-beta.climate.copernicus.eu/how-to-api#install-the-cds-api-client): Create the local file `$HOME/.cdsapirc` (in your Unix/Linux environment) and add the following two lines:

```shell
url: https://cds-beta.climate.copernicus.eu/api
key: your-personal-access-token
```

Your Personal Access Token can be found under the [setup guide](https://cds-beta.climate.copernicus.eu/how-to-api#install-the-cds-api-client) or under [Your profile > Personal Access Token](https://cds-beta.climate.copernicus.eu/profile). Alternatively, you could add the token to the `[CDS]` section in `model.cfg` file in the package directory, `site-packages/pyaps3` if installed via conda. Do not put the personal user ID (UID) there, it won't be recognized. Also, if you use your [old API Key](https://cds.climate.copernicus.eu/user/311901), it leads to a 401 Client Error and Authentication failed.
Your Personal Access Token can be found under [Your profile > Personal Access Token](https://cds-beta.climate.copernicus.eu/profile) section or on the [setup guide](https://cds-beta.climate.copernicus.eu/how-to-api#install-the-cds-api-client) page. Alternatively, you could add the token to the `[CDS]` section in `model.cfg` file in the package directory, `site-packages/pyaps3` if installed via conda. Note: using your [old CDS API key](https://cds.climate.copernicus.eu/) will lead to a 401 Client Error and Authentication failed.

+ **Make sure** that you accept the data license in the Terms of use on ECMWF website: Login, under [Datasets > ERA5 hourly data on pressure levels from 1940 to present > Download > Terms of use](https://cds-beta.climate.copernicus.eu/datasets/reanalysis-era5-pressure-levels?tab=download), click **Accept** to accespt the license to use Copernicus Products.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers=[
"Programming Language :: Python :: 3",
]
dependencies = [
"cdsapi",
"cdsapi>=0.7.0",
"matplotlib",
"numpy",
"pygrib",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# for running
cdsapi
cdsapi>=0.7.0
matplotlib
numpy
pygrib
Expand All @@ -11,4 +11,4 @@ urllib3
pip
setuptools
setuptools_scm
wheel
wheel
4 changes: 2 additions & 2 deletions tests/test_dload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
print('import pyaps3 from {}'.format(pa.__file__))
print('------------------------------------------------')
print('test ERA5 data download')
print('NOTE: Account setup is required on the Copernicus Climate Data Store (CDS).')
print(' More detailed info can be found on: https://retostauffer.org/code/Download-ERA5/')
print('NOTE: Account setup is required on the Copernicus Climate Data Store (CDS)-beta.')
print(' More detailed info can be found on: https://cds-beta.climate.copernicus.eu/how-to-api')
print(' Add your account info to ~/.cdsapirc file.')
filedir = os.path.join(os.path.dirname(__file__), 'data', 'ERA5')
pa.ECMWFdload(['20200601','20200901'], hr='14', filedir=filedir, model='ERA5', snwe=(30,40,120,140))
Expand Down

0 comments on commit e643c02

Please sign in to comment.