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 -Gv3.nc -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='v3.nc', # 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/GMT-5.4.2.app/Contents/Resources/bin/gmt sph2grd -I1 -Ng -Rg -Gv3.nc -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?
RE: GmtPy question - Added by Peter 5 months ago
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