Skip to content

Commit

Permalink
Add incols to COMMON_OPTIONS, blockmean, and blockmedian (#1300)
Browse files Browse the repository at this point in the history
* Add incols to COMMON_OPTIONS in decorators.py

* Add incols to blockm.py
  • Loading branch information
Meghan Jones authored May 27, 2021
1 parent 46f739a commit 44efccc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,36 @@
geographical data). Full documentation is at
:gmt-docs:`gmt.html#f-full`.
""",
"i": r"""
incols : str or 1d array
Specify data columns for primary input in arbitrary order. Columns
can be repeated and columns not listed will be skipped [Default
reads all columns in order, starting with the first (i.e., column
0)].
- For *1d array*: specify individual columns in input order (e.g.,
``incols=[1,0]`` for the 2nd column followed by the 1st column).
- For :py:class:`str`: specify individual columns or column
ranges in the format *start*\ [:*inc*]:*stop*, where *inc*
defaults to 1 if not specified, with columns and/or column ranges
separated by commas (e.g., ``incols='0:2,4+l'`` to input the
first three columns followed by the log-transformed 5th column).
To read from a given column until the end of the record, leave
off *stop* when specifying the column range. To read trailing
text, add the column **t**. Append the word number to **t** to
ingest only a single word from the trailing text. Instead of
specifying columns, use ``incols='n'`` to simply read numerical
input and skip trailing text. Optionally, append one of the
following modifiers to any column or column range to transform
the input columns:
- **+l** to take the *log10* of the input values.
- **+d** to divide the input values by the factor *divisor*
[default is 1].
- **+s** to multiple the input values by the factor *scale*
[default is 1].
- **+o** to add the given *offset* to the input values [default
is 0].""",
"j": r"""
distcalc : str
**e**\|\ **f**\|\ **g**.
Expand Down
4 changes: 4 additions & 0 deletions pygmt/src/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def _blockm(block_method, table, outfile, **kwargs):
V="verbose",
a="aspatial",
f="coltypes",
i="incols",
r="registration",
)
@kwargs_to_strings(R="sequence")
Expand Down Expand Up @@ -103,6 +104,7 @@ def blockmean(table, outfile=None, **kwargs):
{V}
{a}
{i}
{f}
{r}
Expand All @@ -126,6 +128,7 @@ def blockmean(table, outfile=None, **kwargs):
V="verbose",
a="aspatial",
f="coltypes",
i="incols",
r="registration",
)
@kwargs_to_strings(R="sequence")
Expand Down Expand Up @@ -161,6 +164,7 @@ def blockmedian(table, outfile=None, **kwargs):
{V}
{a}
{f}
{i}
{r}
Returns
Expand Down

0 comments on commit 44efccc

Please sign in to comment.