Skip to content

Commit

Permalink
Add inline example for sphinterpolate (#1917)
Browse files Browse the repository at this point in the history
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
  • Loading branch information
3 people authored May 6, 2022
1 parent 330de2d commit 3eae627
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pygmt/src/sphinterpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
)
from pygmt.io import load_dataarray

__doctest_skip__ = ["sphinterpolate"]


@fmt_docstring
@use_alias(
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3eae627

Please sign in to comment.