Skip to content
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

xyz2grd wrapper #635

Closed
carocamargo opened this issue Sep 28, 2020 · 4 comments · Fixed by #636
Closed

xyz2grd wrapper #635

carocamargo opened this issue Sep 28, 2020 · 4 comments · Fixed by #636
Labels
feature request New feature wanted

Comments

@carocamargo
Copy link
Contributor

Hi,

I tried to write a wrapper of the xyz2grd function , in a similar way to the grdfilter wrapper:
I added the function to the gridops.py file, and call it in the init.py file. Still, the function doesn't appear when I try to call it.
image
Maybe it wasn't as simple as change the 'grdcut' to 'grdfilter', but I would expect it to recognise the function anyway, and then give me errors...

xyz2grd
The function is used to transform a table/text file into a binary grid file.

Right now I use library to call gmt from python:

os.chdir(path_to_xyzfile)
res='60m'
infile=flist[0]
outfile='../nc/test.nc'
command=str('gmt xyz2grd '+str(infile)+' -G'+str(outfile)+' -I'+str(res)+' -Rg')
os.system(command)

Any ideas of how I can solve it?

image
image
image

@weiji14
Copy link
Member

weiji14 commented Sep 28, 2020

Could you try removing the space at line 222 between @kwargs_to_string and def xyz2grd to see if that helps?

@carocamargo
Copy link
Contributor Author

Could you try removing the space at line 222 between @kwargs_to_string and def xyz2grd to see if that helps?

It didn't...

@seisman seisman added the feature request New feature wanted label Sep 28, 2020
@seisman
Copy link
Member

seisman commented Sep 28, 2020

@carocamargo It seems you almost finished wrapping xyz2grd. Perhaps you could submit a pull request so that we can comment and improve it together? Of course, it's OK if you want to finish grdfilter (#616) first.

BTW, xyz2grd is a gridding module. Perhaps better to put it in pygmt/gridding.py, like surface?

@carocamargo
Copy link
Contributor Author

@carocamargo It seems you almost finished wrapping xyz2grd. Perhaps you could submit a pull request so that we can comment and improve it together? Of course, it's OK if you want to finish grdfilter (#616) first.

BTW, xyz2grd is a gridding module. Perhaps better to put it in pygmt/gridding.py, like surface?

Ok, I think I did a PR for the xyz2grd function (on gridding.py)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants