Global earth relief data loaded as xarray doesn't work if projection center is not 0
See original GitHub issueDescription of the problem
It may work in GMT 6.0.0 + PyGMT v0.1.2, or not. Currently, PyGMT master + GMT 6.1.0 gives me a wrong result.
Full code that generated the error
import pygmt
from pygmt.datasets import load_earth_relief
grid = load_earth_relief()
fig = pygmt.Figure()
fig.grdimage(grid, cmap="geo", region='d', projection="H10c")
fig.shift_origin(xshift="12c")
fig.grdimage(grid, cmap="geo", region='g', projection="H10c")
fig.shift_origin(xshift="-12c", yshift="6c")
fig.grdimage(grid, cmap="geo", region='d', projection="H120/10c")
# this one sometimes crashes
#fig.shift_origin(xshift="12c")
#fig.grdimage(grid, cmap="geo", region='g', projection="H120/10c")
fig.savefig("map.png")
Output
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Increasing resolution of Cartopy stock background?
I am just wondering if there is some method I don't know about for showing it in a higher resolution/dpi? And if not,...
Read more >Basemap tutorial Documentation - Read the Docs
In this case, the center of the projection, the width and height of the projection are passed as parameters.
Read more >Certified LabVIEW Associate Developer Exam Test Booklet
Detach this page and record your answers as you go along. This page is not included in the actual. CLAD exam; it is...
Read more >Maps with Cartopy - Research Computing in Earth Sciences
Maps often include extra decorations besides just our data (e.g. ... many different ways to make a projection, and we will not attempt...
Read more >"Not a function" error in d3 V4 when trying to use projection ...
I'm going off the current D3 documentation but it seems my version 4 of D3 isn't taking the projection.center([lon, lat]) function when I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue is caused by upstream GMT bugs, which was fixed in a series of upstream PRs (https://github.com/GenericMappingTools/gmt/pull/3813, https://github.com/GenericMappingTools/gmt/pull/3813, https://github.com/GenericMappingTools/gmt/pull/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.
HELP NEEDED
PyGMT users who build GMT from source codes may try GMT’s 6.1 branch (for the upcoming v6.1.1 release) and see if you can find any related bugs before GMT v6.1.1 is released.
OK, so -JH120/10.c does not to any rotation and messes up at -180 + 120 = 60W it seems.