-
Notifications
You must be signed in to change notification settings - Fork 224
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
Cylindrical projections 'Q' plot incorrectly in pygmt when using xarrays #390
Comments
This is just an update about the problem pygmt is having with xarray grids. I just tried the above example with the latest commit on master, and am now getting the following error:
|
The issue is caused by upstream GMT bugs, which was fixed in a series of upstream PRs (GenericMappingTools/gmt#3813, GenericMappingTools/gmt#3813, GenericMappingTools/gmt#3829) and already merged into GMT's master and 6.1 branches. GMT may release v6.1.1 this month. When GMT v6.1.1 is released, I think we can bump the minimum required GMT version to v6.1.1 and release PyGMT v0.2.0. @MarkWieczorek If you can build GMT from source codes, please try the GMT's 6.1 branch and see if you still have any grid related issues. |
After reinstalling gmt via brew from HEAD ( |
I'm reopening the issue so that we won't forget to add some tests for this issue. |
Just for reference (since it took me a while to remember), we did add some tests for |
Yet another half-yearly update. Upstream GMT issues to track this are at GenericMappingTools/gmt#4335 (comment) and GenericMappingTools/gmt#4440 (comment). Might be a longstanding issue with pixel registered grids? |
Just checked in after a long hiatus from coding, and it seems that this still isn't working (unfortunately). I suspect that this is unrelated to the GMT thread that you noted above, as the problem is simply related to setting the prime meridian. |
For info, I just checked that this problem still persists with pygmt 0.12. I was hoping that the virtual file changes would have fixed this :( |
Yes, the virtualfile changes in v0.12.0 were only for the output (i.e. going from GMT virtualfile -> xarray). To fix this, we'll need to handle the reverse direction (i.e. going from xarray -> GMT virtualfiles). Keep an eye on #3099 if you're interested 😉 |
Pygmt incorrectly plots xarrays when using cylindrical projections ('Q').
This is not an issue with gmt: if the dataarray is first exported to a netcdf file, pygmt works as intended when using the file. Thus, this appears to be a problem with how pygmt treats internal xarrays, and only for the case of cylindrical projections (the most basic of all the projections!). This is demonstrated in the following script.
The script generates a simple dataset, and the plots the following:
As you see, the upper two rows plot the data correctly. However, for the bottom left image, the data are not plotted with the correct
central_longitude
. Furthermore, there is a problem with the first longitude band not being plotted.It is possible that this is related to this issue: #375
The text was updated successfully, but these errors were encountered: