Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Dataformat from ERA5 Single Levels: .nc to .zip #413

Open
2 tasks done
TimFuermann opened this issue Dec 3, 2024 · 0 comments · May be fixed by #414
Open
2 tasks done

Changed Dataformat from ERA5 Single Levels: .nc to .zip #413

TimFuermann opened this issue Dec 3, 2024 · 0 comments · May be fixed by #414

Comments

@TimFuermann
Copy link

TimFuermann commented Dec 3, 2024

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of atlite.

  • I have confirmed this bug exists on the current master branch of atlite.

Issue Description

Downloading era5 single-level-values from CDS has changed. In detail, the selection "data-format": "netcdf" returns a .zip file with multiple single .nc files by default, in case multiple fields are downloaded at once.

I suggest changing the retrieve_data function in the era5.py dataset, to per default download a .zip file and combine all .nc files within it directly.

The changes are linked in a few minutes.

Reproducible Example

import atlite

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()

Expected Behavior

The expected behavior should be to return the cutout, instead the code fails, with an value error (see below). The value comes from the fact, that we try to load a .zip file as a .nc file and need to dezip it beforehand.

*** ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'scipy', 'rasterio']. Consider explicitly selecting one of the installed engines via the `engine parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
https://docs.xarray.dev/en/stable/user-guide/io.html

Installed Versions

Local version of the master branch.
Added: IO Backend for Xarray -> ['h5netcdf']

@TimFuermann TimFuermann linked a pull request Dec 3, 2024 that will close this issue
5 tasks
@lkstrp lkstrp linked a pull request Dec 9, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant