PyPSA / atlite

Atlite: A Lightweight Python Package for Calculating Renewable Power Potentials and Time Series
https://atlite.readthedocs.io
255 stars 87 forks source link

reanalysis-era5-single-levels #287

Closed dearmaker closed 1 year ago

dearmaker commented 1 year ago

Checklist

I am following the instructions to download data from ERA5. the code is:

cutout = atlite.Cutout( path="western-europe-2011-01.nc", module="era5", x=slice(-13.6913, 1.7712), y=slice(49.9096, 60.8479), time="2011-01", ) cutout.prepare()

Describe the Bug

I believe it is no "reanalysis-era5-single-levels" is available in the ECMWF ADS API.( I checked the link( https://ads.atmosphere.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels ).)

Can you tell me if there are any way to solve this? Or can I change "reanalysis-era5-single-levels" to other data source in ECMWF ?

Error Message

If applicable, paste any terminal output to help illustrating your problem. In some cases it may also be useful to share your list of installed packages: conda list.

Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?0f0f6b2e-9ed0-45aa-b702-e2c8c55c9c19)---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
File [d:\SimuProgram\anaconda\envs\Diffusion\lib\site-packages\cdsapi\api.py:442](file:///D:/SimuProgram/anaconda/envs/Diffusion/lib/site-packages/cdsapi/api.py:442), in Client._api(self, url, request, method)
    441 try:
--> 442     result.raise_for_status()
    443     reply = result.json()

File [my local path  \lib\site-packages\requests\models.py:960](file:///my local path  
  /lib/site-packages/requests/models.py:960), in Response.raise_for_status(self)
    959 if http_error_msg:
--> 960     raise HTTPError(http_error_msg, response=self)

HTTPError: 404 Client Error:  for url: https://ads.atmosphere.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
Cell In[14], line 8
      1 cutout = atlite.Cutout(
      2     path="western-europe-2011-01.nc",
      3     module="era5",
   (...)
      6     time="2011-01",
      7 )
----> 8 cutout.prepare()
...
--> 464     raise Exception(error)
    465 else:
    466     raise

Exception: Resource reanalysis-era5-single-levels not found
pz-max commented 1 year ago

Hi @dearmaker, Thanks for opening the issue. Which instructions did you use (please link such that we can improve that)? Sounds to me more like an Atlite issue. The Atlite repo is here:https://github.com/PyPSA/atlite. Further, it sounds more like a user question and not a direct issue. It would be better to discuss in the google groups or on Discord. You can find both linked here in the Readme somewhere: https://github.com/PyPSA/PyPSA

This docstring might help you: https://github.com/pypsa-meets-earth/pypsa-earth/blob/efe7211f998c0cee237a11ec60434aa9b0f0660c/scripts/build_cutout.py#L8-L18

euronion commented 1 year ago

Moved to the atlite repository.

The product name reanalysis-era5-single-levels is definitely correct and the product exists in the CDS climate store (not ADS!), see here: https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels

Maybe there was an issue on the side of the cdsapi. Can you try again?

If you still get the error, please share the full code which produces the error.

dearmaker commented 1 year ago

Moved to the atlite repository.

The product name reanalysis-era5-single-levels is definitely correct and the product exists in the CDS climate store (not ADS!), see here: https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels

Maybe there was an issue on the side of the cdsapi. Can you try again?

If you still get the error, please share the full code which produces the error.

Thank you! I had used the ADS. You really help me a lot.