GmtPy question

Added by Mitchell 7 days ago


I'm trying to use the new gmtpy API but keep getting an unexpected error. For practice, I'm trying to convert the example scripts included with the GMT distribution as python scripts using the gmtpy API. The following comes from example 39 - Venus spherical harmonics topography model.

The original line of code from bash script is:

gmt sph2grd VenusTopo180.txt -I1 -Rg -Ng -F1/1/170/180

My equivalent python code is

gmt.sph2grd( 'VenusTopo180.txt', # topo data file
I=1, # increment
R='g', # region
N='g', # norm
G='', # output grid file
F='1/1/170/180' ) # filter

However, I keep getting the following error.

sph2grd: Error: Unrecognized option -K
Exception: Command sph2grd returned an error. While executing command:
/Applications/ sph2grd -I1 -Ng -Rg -F1/1/170/180 -K VenusTopo180.txt

I would not expect to automatically add the -K since the command is not sending any output to file. Am I doing something wrong or is this a bug? Is there a way to force it to not write -K option?


Replies (1)

RE: GmtPy question - Added by Peter 5 days ago

Hi Mitchell

Don't think the GmtPy module is developed by the same people that develops GMT, so you probably need to ask this question to the developer of GmtPy