Skip to content

Commit 8ffb2d0

Browse files
authored
Merge branch 'main' into wrap/gmtselect
2 parents 35ea6b8 + 2cfb303 commit 8ffb2d0

28 files changed

+212
-32
lines changed

doc/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ Operations on grids:
9393
grdcut
9494
grdfill
9595
grdfilter
96-
grdlandmask
9796
grdgradient
97+
grdlandmask
9898
grdsample
9999
grdtrack
100100
xyz2grd

pygmt/datasets/earth_relief.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def load_earth_relief(resolution="01d", region=None, registration=None, use_srtm
6666
Notes
6767
-----
6868
The :class:`xarray.DataArray` grid doesn't support slice operation, for
69-
Earth relief data with resolutions higher than "05m", which are stored as
70-
smaller tiles.
69+
Earth relief data with resolutions of 5 arc-minutes or higher, which are
70+
stored as smaller tiles.
7171
7272
Examples
7373
--------

pygmt/helpers/tempfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def read(self, keep_tabs=False):
8484
content : str
8585
Content of the temporary file as a Unicode string.
8686
"""
87-
with open(self.name) as tmpfile:
87+
with open(self.name, mode="r", encoding="utf8") as tmpfile:
8888
content = tmpfile.read()
8989
if not keep_tabs:
9090
content = content.replace("\t", " ")

pygmt/sphinx_gallery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __call__(self, block, block_vars, gallery_conf):
2424
Called by sphinx-gallery to save the figures generated after running
2525
code.
2626
"""
27-
image_names = list()
27+
image_names = []
2828
image_path_iterator = block_vars["image_path_iterator"]
2929
figures = SHOWED_FIGURES
3030
while figures:

pygmt/src/contour.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@
2727
N="no_clip",
2828
R="region",
2929
S="skip",
30+
U="timestamp",
3031
V="verbose",
3132
W="pen",
3233
X="xshift",
3334
Y="yshift",
35+
b="binary",
3436
c="panel",
37+
d="nodata",
38+
e="find",
39+
f="coltypes",
40+
h="header",
3541
i="incols",
3642
l="label",
3743
p="perspective",
@@ -81,7 +87,10 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
8187
E : str
8288
Network information.
8389
label_placement : str
84-
Placement of labels.
90+
[**d**\|\ **f**\|\ **n**\|\ **l**\|\ **L**\|\ **x**\|\ **X**]\ *args*.
91+
Control the placement of labels along the quoted lines. It supports
92+
five controlling algorithms. See :gmt-docs:`contour.html#g` for
93+
details.
8594
I : bool
8695
Color the triangles using CPT.
8796
triangular_mesh_pen : str
@@ -103,9 +112,15 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
103112
to be of the format [*annotcontlabel*][/*contlabel*]. If either
104113
label contains a slash (/) character then use ``|`` as the
105114
separator for the two labels instead.
115+
{U}
106116
{V}
107117
{XY}
118+
{b}
108119
{c}
120+
{d}
121+
{e}
122+
{f}
123+
{h}
109124
{i}
110125
{p}
111126
{t}

pygmt/src/grdcontour.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def grdcontour(self, grid, **kwargs):
7777
label_placement : str
7878
[**d**\|\ **f**\|\ **n**\|\ **l**\|\ **L**\|\ **x**\|\ **X**]\
7979
*args*.
80-
The required parameter controls the placement of labels along the
81-
quoted lines. It supports five controlling algorithms. See
82-
:gmt-docs:`grdcontour.html#g` for details.
80+
Control the placement of labels along the quoted lines. It supports
81+
five controlling algorithms. See :gmt-docs:`grdcontour.html#g` for
82+
details.
8383
{U}
8484
{V}
8585
{W}

pygmt/src/grdlandmask.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616

1717
@fmt_docstring
1818
@use_alias(
19+
A="area_thresh",
20+
D="resolution",
21+
E="bordervalues",
1922
G="outgrid",
2023
I="spacing",
24+
N="maskvalues",
2125
R="region",
2226
V="verbose",
2327
r="registration",
2428
)
25-
@kwargs_to_strings(R="sequence")
29+
@kwargs_to_strings(R="sequence", N="sequence", E="sequence")
2630
def grdlandmask(**kwargs):
2731
r"""
2832
Create a grid file with set values for land and water.
@@ -45,6 +49,38 @@ def grdlandmask(**kwargs):
4549
in.
4650
{I}
4751
{R}
52+
{A}
53+
resolution : str
54+
*res*\[\ **+f**\]. Selects the resolution of the data set to use
55+
((**f**)ull, (**h**)igh, (**i**)ntermediate, (**l**)ow, or
56+
(**c**)rude). The resolution drops off by ~80% between data sets.
57+
[Default is **l**]. Append **+f** to automatically select a lower
58+
resolution should the one requested not be available
59+
[abort if not found]. Alternatively, choose (**a**)uto to automatically
60+
select the best resolution given the chosen region. Note that because
61+
the coastlines differ in details a node in a mask file using one
62+
resolution is not guaranteed to remain inside [or outside] when a
63+
different resolution is selected.
64+
bordervalues : bool or str or float or list
65+
Nodes that fall exactly on a polygon boundary should be
66+
considered to be outside the polygon [Default considers them to be
67+
inside]. Alternatively, append either a list of four values
68+
[*cborder*, *lborder*, *iborder*, *pborder*] or just the single value
69+
*bordervalue* (for the case when they should all be the same value).
70+
This turns on the line-tracking mode. Now, after setting the mask
71+
values specified via ``maskvalues`` we trace the lines and change the
72+
node values for all cells traversed by a line to the corresponding
73+
border value. Here, *cborder* is used for cells traversed by the
74+
coastline, *lborder* for cells traversed by a lake outline, *iborder*
75+
for islands-in-lakes outlines, and *pborder* for
76+
ponds-in-islands-in-lakes outlines [Default is no line tracing].
77+
maskvalues : str or list
78+
[*wet*, *dry*] or [*ocean*, *land*, *lake*, *island*, *pond*].
79+
Sets the values that will be assigned to nodes. Values can
80+
be any number, including the textstring NaN
81+
[Default is [0, 1, 0, 1, 0] (i.e., [0, 1])]. Also select
82+
``bordervalues`` to let nodes exactly on feature boundaries be
83+
considered outside [Default is inside].
4884
{V}
4985
{r}
5086

pygmt/src/grdview.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Y="yshift",
3535
c="panel",
3636
f="coltypes",
37+
n="interpolation",
3738
p="perspective",
3839
t="transparency",
3940
)
@@ -116,6 +117,7 @@ def grdview(self, grid, **kwargs):
116117
{XY}
117118
{c}
118119
{f}
120+
{n}
119121
{p}
120122
{t}
121123
"""

pygmt/src/histogram.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@
2727
X="xshift",
2828
Y="yshift",
2929
Z="histtype",
30+
b="binary",
3031
c="panel",
32+
d="nodata",
33+
e="find",
34+
g="gap",
35+
h="header",
3136
l="label",
3237
p="perspective",
3338
t="transparency",
39+
w="wrap",
3440
)
3541
@kwargs_to_strings(R="sequence", T="sequence", c="sequence_comma", p="sequence")
3642
def histogram(self, table, **kwargs):
@@ -119,9 +125,15 @@ def histogram(self, table, **kwargs):
119125
{XY}
120126
{U}
121127
{V}
128+
{b}
129+
{d}
130+
{e}
131+
{g}
132+
{h}
122133
{l}
123134
{p}
124135
{t}
136+
{w}
125137
"""
126138
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access
127139
with Session() as lib:

pygmt/src/image.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
D="position",
1313
F="box",
1414
M="monochrome",
15+
U="timestamp",
1516
V="verbose",
1617
X="xshift",
1718
Y="yshift",
@@ -54,6 +55,7 @@ def image(self, imagefile, **kwargs):
5455
monochrome : bool
5556
Convert color image to monochrome grayshades using the (television)
5657
YIQ-transformation.
58+
{U}
5759
{V}
5860
{XY}
5961
{c}

0 commit comments

Comments
 (0)