Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an inline example for load_earth_mask #2355

Merged
merged 5 commits into from
Feb 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pygmt/datasets/earth_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ def load_earth_mask(resolution="01d", region=None, registration=None):
- 3: Islands in lakes in the land areas
- 4: Smaller lakes in islands that are found within lakes
inside the land area

Examples
--------

>>> from pygmt.datasets import load_earth_mask
>>> # load the default grid (gridline-registered 1 arc-degree grid)
>>> grid = load_earth_mask()
>>> # Location (120E, 50N) is in land area (1)
seisman marked this conversation as resolved.
Show resolved Hide resolved
>>> grid.sel(lon=120, lat=50).values
array(1, dtype=int8)
>>> # Location (170E, 50N) is in oceanic area (0)
seisman marked this conversation as resolved.
Show resolved Hide resolved
>>> grid.sel(lon=170, lat=50).values
array(0, dtype=int8)
"""
grid = _load_remote_dataset(
dataset_name="earth_mask",
Expand Down