question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Global earth relief data loaded as xarray doesn't work if projection center is not 0

See original GitHub issue

Description 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

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
seismancommented, Aug 4, 2020

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.

0reactions
PaulWesselcommented, Jul 23, 2020

OK, so -JH120/10.c does not to any rotation and messes up at -180 + 120 = 60W it seems.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found