Skip to content
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e7cabbe
Add aliases and basic docstrings for C, F, L
Mar 29, 2023
04b224d
Fix syntax
Mar 29, 2023
f196764
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Mar 30, 2023
5d96630
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 1, 2023
3cd9055
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 4, 2023
79b1f74
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 6, 2023
4acc835
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 9, 2023
bb2deae
Use aliases from Julia wrapper
yvonnefroehlich Apr 9, 2023
9fca6da
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 9, 2023
988c7c3
Add more docs
yvonnefroehlich Apr 12, 2023
3481807
Add more docs
yvonnefroehlich Apr 12, 2023
aaa3cde
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 12, 2023
bfee63d
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 16, 2023
4088f94
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Apr 19, 2023
4b767f9
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich May 18, 2023
abe5754
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich May 28, 2023
6b64c07
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Jul 24, 2023
0d2ae36
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 4, 2023
00db765
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 9, 2023
30f4381
Add new aliases in overview list
yvonnefroehlich Aug 10, 2023
2453ff1
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 22, 2023
547fa58
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 25, 2023
ecc058c
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 27, 2023
e7fb0df
Shorten formulation
yvonnefroehlich Aug 27, 2023
9a250ee
Expand docstring for *'dist2line'
yvonnefroehlich Aug 27, 2023
f62e207
Expand docstrings for 'dist2cpt', 'dist2line', 'polygon'
yvonnefroehlich Aug 27, 2023
fc4523b
Fix typo
yvonnefroehlich Aug 27, 2023
ebb7ddb
Fix links to upstream GMT documentation
yvonnefroehlich Aug 27, 2023
d6c0766
Add missing sentence
yvonnefroehlich Aug 27, 2023
05a5a67
Add comma
yvonnefroehlich Aug 27, 2023
89bc275
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 29, 2023
87ff022
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 29, 2023
ba6c653
Move docstrings for 'dist2pt', 'dist2line', and 'polyon' up
yvonnefroehlich Aug 30, 2023
87138ea
Add link to upstream GMT docs for 'multiple-segment file'
yvonnefroehlich Aug 30, 2023
3a3b515
Format line length
yvonnefroehlich Aug 30, 2023
c9dd476
Fix line length
yvonnefroehlich Aug 30, 2023
d721bf8
Fix line length
yvonnefroehlich Aug 30, 2023
f21347c
Fix line length
yvonnefroehlich Aug 30, 2023
40251cf
Fix line length
yvonnefroehlich Aug 30, 2023
cf7b34d
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 30, 2023
a2b69e3
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 31, 2023
c405deb
Merge branch 'main' into add-select-aliases-CFL
yvonnefroehlich Aug 31, 2023
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
44 changes: 41 additions & 3 deletions pygmt/src/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
@fmt_docstring
@use_alias(
A="area_thresh",
C="dist2pt",
D="resolution",
F="polygon",
G="gridmask",
I="reverse",
J="projection",
L="dist2line",
N="mask",
R="region",
V="verbose",
Expand All @@ -47,9 +50,9 @@ def select(data=None, outfile=None, **kwargs):
they:

1. are inside a rectangular region (``region`` [and ``projection``])
2. are within *dist* km of any point in *pointfile*
3. are within *dist* km of any line in *linefile*
4. are inside one of the polygons in *polygonfile*
2. are within *dist* km of any point in *pointfile* (``dist2pt``)
3. are within *dist* km of any line in *linefile* (``dist2line``)
4. are inside one of the polygons in *polygonfile* (``polygon``)
5. are inside geographical features (based on coastlines)
6. have z-values within a given range
7. are inside bins of a grid mask whose nodes are non-zero
Expand All @@ -69,6 +72,41 @@ def select(data=None, outfile=None, **kwargs):
outfile : str
The file name for the output ASCII file.
{area_thresh}
dist2pt : str
*pointfile*\|\ *lon*/*lat*\ **+d**\ *dist*.
Pass all records whose locations are within *dist* of any of the
points in the ASCII file *pointfile*. If *dist* is zero, the 3rd
column of *pointfile* must have each point's individual radius of
influence. If you only have a single point, you can specify
*lon*/*lat* instead of *pointfile*. Distances are Cartesian and in
user units. Alternatively, if ``region`` and ``projection`` are used,
the geographic coordinates are projected to map coordinates (in
centimeters, inches, meters, or points, as determined by
:gmt-term:`PROJ_LENGTH_UNIT`) before Cartesian distances are compared
to *dist*.
dist2line : str
*linefile*\ **+d**\ *dist*\ [**+p**].
Pass all records whose locations are within *dist* of any of the line
segments in the ASCII :gmt-docs:`multiple-segment file
<cookbook/file-formats.html#optional-segment-header-records>`
*linefile*. If *dist* is zero, we will scan each sub-header in
*linefile* for an embedded **-D**\ *dist* setting that sets each
line's individual distance value. Distances are Cartesian and in
user units. Alternatively, if ``region`` and ``projection`` are used,
the geographic coordinates are projected to map coordinates (in
centimeters, inches, meters, or points, as determined by
:gmt-term:`PROJ_LENGTH_UNIT`) before Cartesian distances are
compared to *dist*. Append **+p** to ensure only points whose
orthogonal projections onto the nearest line-segment fall within
the segment's endpoints [Default considers points "beyond" the
line's endpoints].
polygon : str
*polygonfile*.
Pass all records whose locations are within one of the closed
polygons in the ASCII :gmt-docs:`multiple-segment file
<cookbook/file-formats.html#optional-segment-header-records>`
*polygonfile*. For spherical polygons (lon, lat), make sure no
consecutive points are separated by 180 degrees or more in longitude.
resolution : str
*resolution*\ [**+f**].
Ignored unless ``mask`` is set. Selects the resolution of the coastline
Expand Down