-
Notifications
You must be signed in to change notification settings - Fork 78
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
ValueError: multiple values for unique key... on GRIB files with more than one value of a key per variable. #2
Comments
@bbonenfant we only support GRIB files with a single |
To be more precise, we support only one |
…ndex before building the cube. See #2.
@bbonenfant I added in the Some examples:
Not all variables are accessible, yet. |
Other useful
|
Thank you for such a substantial response to my issue. I look forward to seeing how this project progresses. |
Thanks, also bumped into this while trying to read a GFS grib2 file, e.g.
The work around seems to work, but hits another snag for this particular data example, i.e.
It's not easy to figure out if this is cfgrib or the data is not conforming. |
@darrenleeweber from your report I think the the GRIB file has two variables with a pressure dimension, but on different pressure levels and in fact we don't support that at the moment. This a different issue than this one and it is better tracked as such, see #13. |
In For example:
As soon as I find the time to sync the Advanced usage section of the README I'll publish release |
Just a quick question about your approach...why do you return a list of xarray datasets? Why not combine them into a single dataset? |
@rabernat an Note that a NetCDF Dataset can represent such a GRIB file according the NetCDF Data Model as long as you place different hypercubes in different Groups. The fact that an I prefer not to arbitrarily change the variable names ( |
Understood. So the different items in this list correspond to datasets with different vertical sampling schemes? |
Not just that. You may have a GRIB file containing a variable with one message with Basically we have a list of GRIB keys that are required to be identical on all messages of a hypercube. |
Would it make sense to return something more like a dict of Dataset objects? It's hard to predictably program with lists where the order of entries is arbitrary. |
I've tried with GRIB2 files relative to MSG CloudMask products (that you can download from the EUMETSAT DataCentre at the following link https://www.eumetsat.int/website/home/Data/DataDelivery/EUMETSATDataCentre/index.html), but I've got an error because there is no attribute "step" |
@shoyer I see your point, and that would be consistent with the idea that the different At the moment the unique identifier of a |
@mdbmdb74 woops! Those GRIB files crash cfgrib in several ways! It should not be too hard to fix, thou. We just need to relax assumptions on what coordinate need to be present. Apparently both |
@mdbmdb74 current
Unfortunately ecCodes does not seem to support the |
I close this issue with the release of version 0.9.0. |
Sorry to reopen this issue -- feel free to move this somewhere else, but I think I may have found a bug or at least something I do not understand in the implementation of the Here is some output I receive when trying to open one of those NAM grib files:
You can see that it successfully returns a Dataset, but looking at the variables it returns, there is the U component of the wind but not the V component of the wind. I'm not sure why this is the case, since I've inspected the grib and find nothing apparent wrong with the v-winds. I've additionally tried this on other NAM gribs with similar results (even in your comment above on Sept. 30 this was the case). I am unsure if this is an error on my part or if there is a way around this. |
@bbonenfant thanks for your help! I opened a new issue with your comment, and leave this one closed as I consider the general problem solved by |
@darrenleeweber I started to learn grib data format and faced with the same issue. Use it like this; import xarray as xr path = "gfsanl_4_2019101000.g2" |
The |
Sorry to bring this up but I think it's a usage question around this functionality. Was trying this today to get u10 from GFS via ftp. If you like me to ask this someone else please let me know. (xr 0.16.2 and cfgrib 0.9.8.5)
output is
and see
|
Great! Worked for me. |
* var_encoding options for to_netcdf convertor
I am able to successfully load the test grib file that was suggested in the README, however when I try to read a grib file such as the one below I get the following error output.
I've tried with both grib1 and grib2 file types and it seems the formatting is incorrect for all the files I've tried. Any suggestions?
The text was updated successfully, but these errors were encountered: