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

Download NetCDF/GRIB files: consider using the GRIB filter service #9

Open
albertotb opened this issue Nov 9, 2022 · 0 comments
Open

Comments

@albertotb
Copy link

albertotb commented Nov 9, 2022

As far as I understand, this repository uses the ASCII service of the OpenDAP server to download the data. To get a NetCDF instead of a CSV file (this seems to be on the roadmap), an optional dependency NetCDF4 could be added. Then the NetCDF file can also be downloaded directly from the OpenDAP server using, for instance, xarray (see an example here). However I found this to be quite unreliable, throwing this error quite frequently (even when everything seems OK):

RuntimeError: NetCDF: Malformed or inaccessible DAP2 DATADDS or DAP4 DAP response

For that reason, I would consider using the service GFS filter. This service is able to filter and download the GFS GRIB files directly. I wrote an example notebook if you want to take a look. The only problem is that you need to add the dependency cfgrib, which in turn depends on ecCodes, that cannot be installed with pip. Reading the description, avoid using ecCodes seems to be one of the main motivations of this library. However, I think you can get around ecCodes not working on Windows by installing it with conda.

In any case, I would consider adding either one of both of the previous ways with the optional dependencies NetCDF4 or cfgrib, since I think it is much easier than constructing the NetCDF file "by hand" from the ASCII response.

@albertotb albertotb changed the title Consider using the GRIB filter service Download NetCDF/GRIB files: consider using the GRIB filter service Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant