Skip to content

Commit 2cbe6c9

Browse files
committed
Fix grdlandmask and improve docstrings
1 parent 5e1ebe8 commit 2cbe6c9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pygmt/src/grdlandmask.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ def grdlandmask(
5454
Ignored unless ``mask`` is set. Select the resolution of the coastline dataset
5555
to use. The available resolutions from highest to lowest are: ``"full"``,
5656
``"high"``, ``"intermediate"``, ``"low"``, and ``"crude"``, which drops by 80%
57-
between levels. Note that because the coastlines differ in details it is not
58-
guaranteed that a point will remain inside [or outside] when a different
59-
resolution is selected.
57+
between levels. Note that because the coastlines differ in details a node in a
58+
mask file using one resolution is not guaranteed to remain inside [or outside]
59+
when a different resolution is selected. If ``None``, the low resolution is used
60+
by default.
6061
bordervalues : bool, str, float, or list
6162
Nodes that fall exactly on a polygon boundary should be
6263
considered to be outside the polygon [Default considers them to be
@@ -100,7 +101,9 @@ def grdlandmask(
100101
if kwargs.get("I") is None or kwargs.get("R") is None:
101102
raise GMTInvalidInput("Both 'region' and 'spacing' must be specified.")
102103

103-
kwargs["D"] = kwargs.get("D", _parse_coastline_resolution(resolution))
104+
kwargs["D"] = kwargs.get(
105+
"D", _parse_coastline_resolution(resolution, allow_auto=True)
106+
)
104107

105108
with Session() as lib:
106109
with lib.virtualfile_out(kind="grid", fname=outgrid) as voutgrd:

pygmt/src/select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def select(
123123
``"high"``, ``"intermediate"``, ``"low"``, and ``"crude"``, which drops by 80%
124124
between levels. Note that because the coastlines differ in details it is not
125125
guaranteed that a point will remain inside [or outside] when a different
126-
resolution is selected.
126+
resolution is selected. If ``None``, the low resolution is used by default.
127127
gridmask : str
128128
Pass all locations that are inside the valid data area of the grid
129129
*gridmask*. Nodes that are outside are either NaN or zero.

0 commit comments

Comments
 (0)