Skip to content

pygmt.surface fails with recent GMT dev #1184

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

Closed
seisman opened this issue Apr 6, 2021 · 2 comments
Closed

pygmt.surface fails with recent GMT dev #1184

seisman opened this issue Apr 6, 2021 · 2 comments
Labels
bug Something isn't working upstream Bug or missing feature of upstream core GMT
Milestone

Comments

@seisman
Copy link
Member

seisman commented Apr 6, 2021

Python script to reproduce the issue:

import pygmt

ship_data = pygmt.datasets.load_sample_bathymetry()
data = ship_data.values
output = pygmt.surface(data=data, spacing="5m", region=[245, 255, 20, 30])

Error messages:

[Session pygmt-session (2)]: Error returned from GMT API: GMT_NOT_A_VALID_ID (38)
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    output = pygmt.surface(data=data, spacing="5m", region=[245, 255, 20, 30])
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/helpers/decorators.py", line 296, in new_module
    return module_func(*args, **kwargs)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/helpers/decorators.py", line 437, in new_module
    return module_func(*args, **kwargs)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/src/surface.py", line 103, in surface
    lib.call_module(module="surface", args=arg_str)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/clib/session.py", line 504, in call_module
    raise GMTCLibError(
pygmt.exceptions.GMTCLibError: Module 'surface' failed with status code 79:

Adding verbose="d" to the pygmt.surface() gives more debugging messages:

surface [DEBUG]: Look for file 245/255/20/30 in /Users/seisman/.gmt
surface [DEBUG]: Look for file 245/255/20/30 in /Users/seisman/.gmt/data,/Users/seisman/Gits/gmt-china/china-geospatial-data
surface [DEBUG]: Look for file 245/255/20/30 in /Users/seisman/.gmt/cache
surface [DEBUG]: Look for file 245/255/20/30 in /Users/seisman/.gmt/server
surface [DEBUG]: Got regular w/e/s/n for region (245/255/20/30)
surface [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
surface [DEBUG]: Geographic input grid, longitudes span less than 360
surface [DEBUG]: Chosen boundary condition for all edges: geographic
surface [DEBUG]: Geographic input grid, longitudes span less than 360
surface [DEBUG]: Object ID 1 : Registered Grid Memory Reference 7f918f7e8df0 as an Input resource with geometry Surface [n_objects = 2]
surface [DEBUG]: Successfully created a new Grid container
surface [INFORMATION]: Grid domain: W: 245 E: 255 S: 20 N: 30 n_columns: 120 n_rows: 120 [gridline registration]
surface [INFORMATION]: Processing input table data
surface [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Point
surface (gmtapi_init_import): tried to free unallocated memory
[Session pygmt-session (2)]: Error returned from GMT API: GMT_NOT_A_VALID_ID (38)
surface [DEBUG]: GMT_Init_IO: Returned first Input object ID = -1
surface [DEBUG]: GMT_Begin_IO: Mode value 1 not considered (ignored)
surface [DEBUG]: GMT_Begin_IO: Initialize record-by-record access for Input
surface [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=0 ID=1 W=Input F=Grid M=Memory Reference S=Unused P=7f918f7e8df0 N=(null)
surface [DEBUG]: GMTAPI_Garbage_Collection freed 1 memory objects
surface [DEBUG]: gmtlib_unregister_io: Unregistering object no 1 [n_objects = 1]
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    output = pygmt.surface(data=data, spacing="5m", region=[245, 255, 20, 30], verbose='d')
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/helpers/decorators.py", line 296, in new_module
    return module_func(*args, **kwargs)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/helpers/decorators.py", line 437, in new_module
    return module_func(*args, **kwargs)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/src/surface.py", line 103, in surface
    lib.call_module(module="surface", args=arg_str)
  File "/Users/seisman/Gits/gmt/pygmt/pygmt/clib/session.py", line 504, in call_module
    raise GMTCLibError(
pygmt.exceptions.GMTCLibError: Module 'surface' failed with status code 79:
@seisman seisman added bug Something isn't working upstream Bug or missing feature of upstream core GMT labels Apr 6, 2021
@seisman
Copy link
Member Author

seisman commented Apr 6, 2021

Ping @PaulWessel

@seisman
Copy link
Member Author

seisman commented Apr 21, 2021

All pygmt.surface tests pass for v6.2.0rc1. Closing the issue.

@seisman seisman closed this as completed Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Bug or missing feature of upstream core GMT
Projects
None yet
Development

No branches or pull requests

1 participant