pygrib
pygrib copied to clipboard
Unable to open a ICON grib file
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 ?
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?
@jswhit It's 95 M . Can I put it somewhere on a file server and you can download it from there ?
https://gofile.io/d/r0I6EN
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.