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

Issues with extracting data from OpenWRF #181

Open
jendrusk opened this issue Feb 24, 2021 · 1 comment
Open

Issues with extracting data from OpenWRF #181

jendrusk opened this issue Feb 24, 2021 · 1 comment

Comments

@jendrusk
Copy link

Im trying to extract data from OpenWRF grib, and for messages with u/v wind and u/v current I'm getting errors:

ECCODES ERROR : unable to create iterator ECCODES ERROR : numberOfPoints != size(values) (12600!=12608)

I'm using file 'France_12km_WRF_WAM_210224-00.grb' you can download it from here

Steps to reproduce:

import pygrib


grb = pygrib.open("openwrf_data/France_12km_WRF_WAM_210224-00.grb")
mes = grb.message(15)
print(mes)
vals = mes.codedValues
/home/andrzej/PycharmProjects/veo-grib-importer/venv/bin/python /snap/pycharm-community/226/plugins/python-ce/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 46875 --file /home/andrzej/PycharmProjects/veo-grib-importer/grib_bug.py
Connected to pydev debugger (build 203.7148.72)
15:U-component of current:m s**-1 (instant):regular_ll:surface:level 0:fcst time 0 hrs:from 202102240000
ECCODES ERROR   :  numberOfPoints != size(values) (12600!=12608)
ECCODES ERROR   :  unable to create iterator
Traceback (most recent call last):
  File "/snap/pycharm-community/226/plugins/python-ce/helpers/pydev/pydevd.py", line 1477, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/snap/pycharm-community/226/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/andrzej/PycharmProjects/veo-grib-importer/grib_bug.py", line 8, in <module>
    vals1 = mes.latLonValues
  File "pygrib/_pygrib.pyx", line 764, in pygrib._pygrib.gribmessage.__getattr__
  File "pygrib/_pygrib.pyx", line 1168, in pygrib._pygrib.gribmessage.__getitem__
RuntimeError: b'Grid description is wrong or inconsistent'

Process finished with exit code 1
@jswhit
Copy link
Owner

jswhit commented Feb 24, 2021

Apparently the grib file is encoded incorrectly - the ECCODES C library is reporting that the stated grid size doesn't match the number of data values.

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