From 3eae6271df13dabac844cb8131d0276c4bcd1baa Mon Sep 17 00:00:00 2001 From: Will Schlitzer Date: Fri, 6 May 2022 08:49:13 +0100 Subject: [PATCH] Add inline example for sphinterpolate (#1917) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian --- pygmt/src/sphinterpolate.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pygmt/src/sphinterpolate.py b/pygmt/src/sphinterpolate.py index 8a19cca64e7..551f9c62be2 100644 --- a/pygmt/src/sphinterpolate.py +++ b/pygmt/src/sphinterpolate.py @@ -11,6 +11,8 @@ ) from pygmt.io import load_dataarray +__doctest_skip__ = ["sphinterpolate"] + @fmt_docstring @use_alias( @@ -55,6 +57,15 @@ def sphinterpolate(data, **kwargs): - :class:`xarray.DataArray` if ``outgrid`` is not set - None if ``outgrid`` is set (grid output will be stored in file set by ``outgrid``) + + Example + ------- + >>> import pygmt + >>> # Load a table of Mars with longitude/latitude/radius columns + >>> mars_shape = pygmt.datasets.load_sample_data(name="mars_shape") + >>> # Perform Delaunay triangulation on the table data + >>> # to produce a grid with a 1 arc-degree spacing + >>> grid = pygmt.sphinterpolate(data=mars_shape, spacing=1, region="g") """ with GMTTempFile(suffix=".nc") as tmpfile: with Session() as lib: