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

The coordinate of U in pressure level is wrong.(HWRF GRIB) #76

Closed
ben108472 opened this issue Apr 23, 2019 · 4 comments
Closed

The coordinate of U in pressure level is wrong.(HWRF GRIB) #76

ben108472 opened this issue Apr 23, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@ben108472
Copy link

I use cfgrib 0.9.6.2 to read HWRF grib.
I find the coordinate of U in pressure level is wrong is specific pressure level,but V is correct.
It causes the U turn 90 degrees.

Here is the sample file and U/V picture in all pressure level:
https://drive.google.com/open?id=1IBtvmN3smluEY0zXAEuLgO-psptZN84O

2019042118_HWRF-U1000_84_-16-73847
2019042118_HWRF-U975_84_-16-73847

@alexamici alexamici self-assigned this May 27, 2019
@alexamici alexamici added the bug Something isn't working label May 27, 2019
@alexamici
Copy link
Contributor

I couldn't reproduce exactly this error, but I have seen several cases when accessing variables stored in MULTI-FIELD messages, usually u and v components, are mixed up with unrelated variables.

To access MULTI-FIELD messages I'm using eccodes.codes_grib_multi_support_on(), but it looks like it creates more problems than it solves.

@ben108472
Copy link
Author

ben108472 commented May 28, 2019

I use the following code to read the HWRF grib files.

filename = 'invest91s.2019042118.hwrfprs.core.0p015.f084.grb2'
data = xr.open_dataset('%s'%(filename),engine='cfgrib',backend_kwargs={'filter_by_keys': {'typeOfLevel': 'isobaricInhPa'},'errors': 'ignore'})

lats,lons,U,V = xr.broadcast(data['latitude'],data['longitude'],data['u'],data['v'])
pressure= data['isobaricInhPa']

and plot all levels by basemap and matplotlib.
The HWRF sample files is in previous link.

@alexamici
Copy link
Contributor

After a few tries I still cannot get ecCodes to read MULTI-FIELD messages correctly, so at the moment only the first of the fields is read from a message. For this reason the correct definition of the issue is #111 and I'll close this one.

@alexamici
Copy link
Contributor

@ben108472 if you are still interested I have just committed a tentative fix in the stable/0.9.8.x branch. It looks good to me, and I'll try to release a fixed version soon.

Thanks again for your excellent bug report that helped me testing the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants