Skip to content

Figure.grdcontour crashes for GMT dev (the upcoming v6.2.0) #1177

@seisman

Description

@seisman

Full code that generated the error

The following script is modified from a crashing test test_grdcontour_interval_file_full_opts:

import pygmt

grid = pygmt.datasets.load_earth_relief(registration="gridline")

fig = pygmt.Figure()
fig.grdcontour(
    region=[-161.5, -154, 18.5, 23],
    interval="contours.txt",
    grid=grid,
    resample=100,
    projection="M10c",
    cut=10,
    limit=(-25000, -1),
    pen=["a1p,blue", "c0.5p,blue"]
)
fig.savefig("map.pdf")

Full error message

The script works for GMT 6.1.1, but gives a lot of warnings and crashes for GMT 6.2.0:

...
grdcontour [WARNING]: Latitude (2960.5) at line # 178 exceeds -|+ 90! - set to NaN
grdcontour [WARNING]: Latitude (3141.5) at line # 179 exceeds -|+ 90! - set to NaN
grdcontour [WARNING]: Latitude (3072.5) at line # 180 exceeds -|+ 90! - set to NaN
grdcontour [WARNING]: Latitude (2862) at line # 181 exceeds -|+ 90! - set to NaN
[1]    29831 segmentation fault  python test.py

The above Python script is equivalent to:

gmt grdcontour @earth_relief_01d_g -Ccontours.txt -JM10c -L-25000/-1 -Q10 -R-161.5/-154/18.5/23 -S100 -Wa1p,blue -Wc0.5p,blue -pdf map

The only difference is that the Python script passes a xarray.DataArray grid instead of the @earth_relief_01d_g file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstreamBug or missing feature of upstream core GMT

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions