c-scale-community / workflow-coastal-hydrowaq

Porting and deploying the HiSea use case on C-SCALE
Apache License 2.0
3 stars 1 forks source link

Terms and conditions for CDS API #18

Closed sebastian-luna-valero closed 2 years ago

sebastian-luna-valero commented 2 years ago

Hi @lorincmeszaros

In parallel to https://github.com/c-scale-community/use-case-hisea/issues/17 I am also running the script https://github.com/c-scale-community/use-case-hisea/blob/main/scripts/download_era5.py with the provided credentials.

Here is what I get:

python download_era5.py --year 2021 --output out.2021
2021-11-11 08:52:30,282 INFO Welcome to the CDS
2021-11-11 08:52:30,282 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels
Traceback (most recent call last):
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/cdsapi/api.py", line 427, in _api
    result.raise_for_status()
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/requests/models.py", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error:  for url: https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/cloudadm/devel/c-scale-community/use-case-hisea/scripts/download_era5.py", line 64, in <module>
    download_era5()
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/cloudadm/devel/c-scale-community/use-case-hisea/scripts/download_era5.py", line 15, in download_era5
    c.retrieve(
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/cdsapi/api.py", line 348, in retrieve
    result = self._api("%s/resources/%s" % (self.url, name), request, "POST")
  File "/opt/cloudadm/c-scale-hisea/conda-install/envs/hisea/lib/python3.9/site-packages/cdsapi/api.py", line 450, in _api
    raise Exception(error)
Exception: Client has not agreed to the required terms and conditions.. To access this resource, you first need to accept the termsof 'Licence to use Copernicus Products' at https://cds.climate.copernicus.eu/cdsapp/#!/terms/licence-to-use-copernicus-products

Here I am thinking about sharing the script with a different C-SCALE use case, what are the steps to make this automatic?

Many thanks, Sebastian

lorincmeszaros commented 2 years ago

Hi,

When creating an account there is an option to have organizational account: image

I tried to specify a C-SCALE account but it is not clear how this is verified. Maybe through the email address?

Here is additional information regarding registration: "To register, users will have to enter the following details: Name and surname, a valid email account, and their country of residence and the sector in which users work. Please note that a user can be a person or an entity. The registration - and with it any license accepted thereunder - only applies to its named holder. Any user can only have one account."

The only follow up action I can think of is to contact ECMWF to ask if it's possible to have a project account. I will do that.

sebastian-luna-valero commented 2 years ago

Thanks for checking!

sebastian-luna-valero commented 2 years ago

Follow up shared in https://github.com/c-scale-community/use-case-hisea/issues/17#issuecomment-998907225