Skip to content

Commit

Permalink
Add inline example to load_earth_geoid (#2258)
Browse files Browse the repository at this point in the history
Co-authored-by: Yvonne Fröhlich <[email protected]>
  • Loading branch information
willschlitzer and yvonnefroehlich authored Dec 21, 2022
1 parent 6a327e1 commit d460d7b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pygmt/datasets/earth_geoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings

__doctest_skip__ = ["load_earth_geoid"]


@kwargs_to_strings(region="sequence")
def load_earth_geoid(resolution="01d", region=None, registration=None):
Expand Down Expand Up @@ -57,6 +59,21 @@ def load_earth_geoid(resolution="01d", region=None, registration=None):
The :class:`xarray.DataArray` grid doesn't support slice operation, for
Earth geoid grids with resolutions of 5 arc-minutes or higher,
which are stored as smaller tiles.
Examples
--------
>>> from pygmt.datasets import load_earth_geoid
>>> # load the default grid (gridline-registered 1 arc-degree grid)
>>> grid = load_earth_geoid()
>>> # load the 30 arc-minutes grid with "gridline" registration
>>> grid = load_earth_geoid(resolution="30m", registration="gridline")
>>> # load high-resolution (5 arc-minutes) grid for a specific region
>>> grid = load_earth_geoid(
... resolution="05m",
... region=[120, 160, 30, 60],
... registration="gridline",
... )
"""
grid = _load_remote_dataset(
dataset_name="earth_geoid",
Expand Down

0 comments on commit d460d7b

Please sign in to comment.