Skip to content

Commit 3eae627

Browse files
willschlitzerweiji14seisman
authored
Add inline example for sphinterpolate (#1917)
Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
1 parent 330de2d commit 3eae627

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pygmt/src/sphinterpolate.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
)
1212
from pygmt.io import load_dataarray
1313

14+
__doctest_skip__ = ["sphinterpolate"]
15+
1416

1517
@fmt_docstring
1618
@use_alias(
@@ -55,6 +57,15 @@ def sphinterpolate(data, **kwargs):
5557
- :class:`xarray.DataArray` if ``outgrid`` is not set
5658
- None if ``outgrid`` is set (grid output will be stored in file set by
5759
``outgrid``)
60+
61+
Example
62+
-------
63+
>>> import pygmt
64+
>>> # Load a table of Mars with longitude/latitude/radius columns
65+
>>> mars_shape = pygmt.datasets.load_sample_data(name="mars_shape")
66+
>>> # Perform Delaunay triangulation on the table data
67+
>>> # to produce a grid with a 1 arc-degree spacing
68+
>>> grid = pygmt.sphinterpolate(data=mars_shape, spacing=1, region="g")
5869
"""
5970
with GMTTempFile(suffix=".nc") as tmpfile:
6071
with Session() as lib:

0 commit comments

Comments
 (0)