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
Strange behavior with data from grib file #4549
Comments
Do the axes limits matter at all? There are some known bugs with some projections. |
It's hard to see with the map we have, but this is an exceedingly common problem with plotting geometries which touch/cross the dateline and/or poles. Are you getting any warnings with the contourf call? I'm expecting you to get something like a non-monotonic warning? The general solution to this is not to work in lat/lons - doing so can result in a loss of coordinate topology (due to the modulus 360). In practice, I don't know how well basemap deals with that. @WeatherGod might be able to help with that. This kind of problem is the bread and butter of a package called cartopy (which I originally wrote), which deals with the geometry/contour topology problems that basemap's approach cannot. It might be also worth looking at that as an option. Either way, this is not really a matplotlib issue, more of a https://github.com/matplotlib/basemap issue. |
@JFMass, Try plotting without basemap: just make a simple call to contourf with lon and lat as your x and y. Check min and max for lon and lat; are the lons all negative, consistent with your choice of negative corner longitudes? Are the lons and lats monotonic? Have you made a simple plot of lon versus index? |
Thanks for the help, couln'd solve the bug but I could work around by regridding with wgrib and then opening new grib. Problem solved that way. |
Hi
I've been using matplotlib and basemaps with pygrib to plot meteorological data from grib files.
However, when using a particular grib, I get some strange behavior where a large horizontal strip of value 80 appears on the map. Digging into the problem I can tell the problem is not related to the data inside the grib file because grads plots perfectly. I could can also confirm that the problem doesn't seem to come from pyplot either because checking individual grid values show normal value where the map shows 80. I could identify that the plotted value is near 80 by playing with levels.
The only thing left would be with the contour and contourf functions.
The data I am using 10km polar steregraphic projection rainfall data. Interestingly, 15km resolution files plot perfectly without any strip into the image.
Anyone can tell what is wrong?
The text was updated successfully, but these errors were encountered: