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

possible bug accessing grib parameters #202

Open
Yamioni2007 opened this issue May 8, 2022 · 1 comment
Open

possible bug accessing grib parameters #202

Yamioni2007 opened this issue May 8, 2022 · 1 comment

Comments

@Yamioni2007
Copy link

I tried the following in a python notebook:

import pygrib
grbs = pygrib.open('Current_db_2021110500_00.grb2')
file = grbs[1]
print(file)

1:Eastward sea water velocity:m s**-1 (instant):regular_ll:depthBelowSea:level 2 m:fcst time 15 mins:from 202111050000

print(file['stepUnits'])

0

print(grbs[1]['stepUnits'])

1

If I first save the single layer in a variable, print it once and access then the 'stepUnits' I get 0, which is correct for my grib file. If I acess the 'stepUnits' directly, I get 1, which is wrong.

@jswhit
Copy link
Owner

jswhit commented Jun 16, 2022

This doesn't make sense to me - and I can't reproduce it with the sample files I have. Can you post your grib file? (if it's small enough you can just gzip it and attach it to this issue)

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