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

Unable to open a ICON grib file #183

Open
winash12 opened this issue Mar 31, 2021 · 4 comments
Open

Unable to open a ICON grib file #183

winash12 opened this issue Mar 31, 2021 · 4 comments

Comments

@winash12
Copy link

I am using ICON which is a icosahedral unstructured grid. I am using pygrib to read the file in the following way

`import pygrib
import numpy as np

file = './igfff00000000'

grbs = pygrib.open(file)

for g in grbs:
lats,lons = g.latlons()
print(lats)
print(lons)
sys.exit()

and when I run this code I get this error message

<frozen importlib._bootstrap>:219: UserWarning: Warning: ecCodes 2.19.1 or higher is recommended. You are running 2.18.0. Traceback (most recent call last): File "test.py", line 13, in <module> lats,lons = g.latlons() File "pygrib/_pygrib.pyx", line 1491, in pygrib._pygrib.gribmessage.latlons ValueError: unsupported grid unstructured_grid

Where am I going wrong ?

@jswhit
Copy link
Owner

jswhit commented Mar 31, 2021

the latlons method is failing to create lat and lon values since there is no support for icosahedral grids in pygrib yet. Can you gzip the file (or a subset of the file if it is too big) here so I can take a look?

@winash12
Copy link
Author

@jswhit It's 95 M . Can I put it somewhere on a file server and you can download it from there ?

@winash12
Copy link
Author

@jswhit
Copy link
Owner

jswhit commented Mar 31, 2021

OK, got it. I was hoping there was some information in the file that could be used to generate the lat/lon values from the grid definition. Unfortunately, the only grid information given is 'general unstructured grid', and that's hardly enough to go on. I am afraid there is no way to make the latlons method work for this grid.

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

2 participants