Skip to content

Commit 3a9cce8

Browse files
willschlitzermichaelgrundseisman
authored
Add inline example for sph2grd (#1718)
Add an inline example for the sph2grd documentation. Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
1 parent 14a4947 commit 3a9cce8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pygmt/src/sph2grd.py

+9
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ def sph2grd(data, **kwargs):
6363
- :class:`xarray.DataArray` if ``outgrid`` is not set
6464
- None if ``outgrid`` is set (grid output will be stored in file set by
6565
``outgrid``)
66+
67+
Example
68+
-------
69+
>>> import pygmt # doctest: +SKIP
70+
>>> # Create a new grid from the remote file "EGM96_to_36.txt",
71+
>>> # set the grid spacing to 1, and the region to "g"
72+
>>> new_grid = pygmt.sph2grd(
73+
... data="@EGM96_to_36.txt", spacing=1, region="g"
74+
... ) # doctest: +SKIP
6675
"""
6776
with GMTTempFile(suffix=".nc") as tmpfile:
6877
with Session() as lib:

0 commit comments

Comments
 (0)