Skip to content

Commit a5154d4

Browse files
authored
pygmt.blockmean/blockmedian/blockmode: Add the center parameter (-C) (#4780)
1 parent dfb06c4 commit a5154d4

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎pygmt/src/blockm.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def blockmean(
8888
z=None,
8989
output_type: Literal["pandas", "numpy", "file"] = "pandas",
9090
outfile: PathLike | None = None,
91+
center: bool = False,
9192
spacing: Sequence[float | str] | None = None,
9293
region: Sequence[float | str] | str | None = None,
9394
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -112,6 +113,7 @@ def blockmean(
112113
Full GMT docs at :gmt-docs:`blockmean.html`.
113114
114115
$aliases
116+
- C = center
115117
- I = spacing
116118
- R = region
117119
- V = verbose
@@ -129,6 +131,9 @@ def blockmean(
129131
Arrays of x and y coordinates and values z of the data points.
130132
$output_type
131133
$outfile
134+
center
135+
Use the center of each block as the output location. By default, the
136+
mean x and y coordinates are used.
132137
$spacing
133138
summary : str
134139
[**m**\|\ **n**\|\ **s**\|\ **w**].
@@ -170,6 +175,7 @@ def blockmean(
170175
>>> data_bmean = pygmt.blockmean(data=data, region=[245, 255, 20, 30], spacing="5m")
171176
"""
172177
aliasdict = AliasSystem(
178+
C=Alias(center, name="center"),
173179
I=Alias(spacing, name="spacing", sep="/", size=2),
174180
).add_common(
175181
R=region,
@@ -203,6 +209,7 @@ def blockmedian(
203209
z=None,
204210
output_type: Literal["pandas", "numpy", "file"] = "pandas",
205211
outfile: PathLike | None = None,
212+
center: bool = False,
206213
spacing: Sequence[float | str] | None = None,
207214
region: Sequence[float | str] | str | None = None,
208215
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -227,6 +234,7 @@ def blockmedian(
227234
Full GMT docs at :gmt-docs:`blockmedian.html`.
228235
229236
$aliases
237+
- C = center
230238
- I = spacing
231239
- R = region
232240
- V = verbose
@@ -244,6 +252,9 @@ def blockmedian(
244252
Arrays of x and y coordinates and values z of the data points.
245253
$output_type
246254
$outfile
255+
center
256+
Use the center of each block as the output location. By default, the
257+
median x and median y coordinates are used.
247258
$spacing
248259
$region
249260
$verbose
@@ -279,6 +290,7 @@ def blockmedian(
279290
... )
280291
"""
281292
aliasdict = AliasSystem(
293+
C=Alias(center, name="center"),
282294
I=Alias(spacing, name="spacing", sep="/", size=2),
283295
).add_common(
284296
R=region,
@@ -318,6 +330,7 @@ def blockmode(
318330
z=None,
319331
output_type: Literal["pandas", "numpy", "file"] = "pandas",
320332
outfile: PathLike | None = None,
333+
center: bool = False,
321334
spacing: Sequence[float | str] | None = None,
322335
region: Sequence[float | str] | str | None = None,
323336
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
@@ -342,6 +355,7 @@ def blockmode(
342355
Full GMT docs at :gmt-docs:`blockmode.html`.
343356
344357
$aliases
358+
- C = center
345359
- I = spacing
346360
- R = region
347361
- V = verbose
@@ -359,6 +373,9 @@ def blockmode(
359373
Arrays of x and y coordinates and values z of the data points.
360374
$output_type
361375
$outfile
376+
center
377+
Use the center of each block as the output location. By default, the
378+
modal x and y coordinates are used.
362379
$spacing
363380
$region
364381
$verbose
@@ -392,6 +409,7 @@ def blockmode(
392409
>>> data_bmode = pygmt.blockmode(data=data, region=[245, 255, 20, 30], spacing="5m")
393410
"""
394411
aliasdict = AliasSystem(
412+
C=Alias(center, name="center"),
395413
I=Alias(spacing, name="spacing", sep="/", size=2),
396414
).add_common(
397415
R=region,

0 commit comments

Comments
 (0)