GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
843 stars 352 forks source link

One more PyGMT crash with grid shading #3843

Closed seisman closed 4 years ago

seisman commented 4 years ago

The script reads the remote file @tut_relief.nc in to xarray and pass it to grdimage. It crashes with shading=True, but works without shading.

import pygmt
import xarray as xr

pygmt.show_versions()

fig = pygmt.Figure()
fname = pygmt.which("@tut_relief.nc", download='a')
dem = xr.open_dataarray(fname)

fig.grdimage(dem, frame='af', projection='M6i', cmap='geo', shading=True, V='d')

fig.savefig("shading.png")

Here is the screenshot showing where it crashes:

It crashes at line 627 in grdgradient.c: image

image

Related variables:

image

image

PaulWessel commented 4 years ago

Do you know if the variable new_grid is true?

seisman commented 4 years ago

Yes, it's true.