From e7cabbeff18f758e5ab3463d2ab277985ab9d344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 29 Mar 2023 12:46:47 +0200 Subject: [PATCH 01/20] Add aliases and basic docstrings for C, F, L --- pygmt/src/select.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index ef07387cd68..29ca13b2ae1 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -17,10 +17,13 @@ @fmt_docstring @use_alias( A="area_thresh", + C="pointfile", D="resolution", + F="polygonfile", G="gridmask", I="reverse", J="projection", + L="line_file", N="mask", R="region", V="verbose", @@ -128,6 +131,18 @@ def select(data=None, outfile=None, **kwargs): and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. + pointfile : str + *pointfile*\ | *lon*/*lat* **+d**\ *dist* + Pass all records whose locations are within *dist* of any of the + points in the ASCII file *pointfile*. + line_file : str + *linefile*\ **+d**\ *dist*\ [**+p**] + Pass all records whose locations are within *dist* of any of the + line segments in the ASCII multiple-segment file *linefile*. + polygonfile : str + *polygonfile* + Pass all records whose locations are within one of the closed + polygons in the multiple-segment file *polygonfile*. {binary} {nodata} {find} From 04b224d5eacd07f70756812aaf49a7a52305dfab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= Date: Wed, 29 Mar 2023 12:54:47 +0200 Subject: [PATCH 02/20] Fix syntax --- pygmt/src/select.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 29ca13b2ae1..0d23ec8c125 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -132,15 +132,15 @@ def select(data=None, outfile=None, **kwargs): given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. pointfile : str - *pointfile*\ | *lon*/*lat* **+d**\ *dist* + *pointfile*\|\ *lon*/*lat*\ **+d**\ *dist*. Pass all records whose locations are within *dist* of any of the points in the ASCII file *pointfile*. line_file : str - *linefile*\ **+d**\ *dist*\ [**+p**] + *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the line segments in the ASCII multiple-segment file *linefile*. polygonfile : str - *polygonfile* + *polygonfile*. Pass all records whose locations are within one of the closed polygons in the multiple-segment file *polygonfile*. {binary} From bb2deaefc2bd305c807edebc743e377fafa20d7f Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 9 Apr 2023 21:14:12 +0200 Subject: [PATCH 03/20] Use aliases from Julia wrapper --- pygmt/src/select.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 0d23ec8c125..9c1e12714c6 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -17,13 +17,13 @@ @fmt_docstring @use_alias( A="area_thresh", - C="pointfile", + C="dist2pt", D="resolution", - F="polygonfile", + F="polygon", G="gridmask", I="reverse", J="projection", - L="line_file", + L="dist2line", N="mask", R="region", V="verbose", @@ -131,15 +131,15 @@ def select(data=None, outfile=None, **kwargs): and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. - pointfile : str + 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*. - line_file : str + dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the line segments in the ASCII multiple-segment file *linefile*. - polygonfile : str + polygon : str *polygonfile*. Pass all records whose locations are within one of the closed polygons in the multiple-segment file *polygonfile*. From 988c7c38b169b63f456b44124ba044702c3df261 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 12 Apr 2023 09:28:53 +0200 Subject: [PATCH 04/20] Add more docs --- pygmt/src/select.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 9c1e12714c6..59ce16d39d8 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -134,15 +134,23 @@ def select(data=None, outfile=None, **kwargs): 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*. + points in the ASCII file *pointfile*. If *dist* is zero then the 3rd + column of *pointfile* must have each point’s individual radius of + influence. If you only have a single point then you can specify + *lon*/*lat* instead of *pointfile*. dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the line segments in the ASCII multiple-segment file *linefile*. + If *dist* is zero then we will scan each sub-header in *linefile* + for an embedded **-D**\ *dist* setting that sets each line’s + individual distance value. polygon : str *polygonfile*. Pass all records whose locations are within one of the closed - polygons in the multiple-segment file *polygonfile*. + polygons in the multiple-segment file *polygonfile*. For spherical + polygons (lon, lat), make sure no consecutive points are separated + by 180 degrees or more in longitude. {binary} {nodata} {find} From 3481807ae4c015bcbd4fce31ccbf32c05466f5dd Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 12 Apr 2023 09:31:18 +0200 Subject: [PATCH 05/20] Add more docs --- pygmt/src/select.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 59ce16d39d8..ba679065e82 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -137,7 +137,8 @@ def select(data=None, outfile=None, **kwargs): points in the ASCII file *pointfile*. If *dist* is zero then the 3rd column of *pointfile* must have each point’s individual radius of influence. If you only have a single point then you can specify - *lon*/*lat* instead of *pointfile*. + *lon*/*lat* instead of *pointfile*. Distances are Cartesian and in + user units. dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the @@ -150,7 +151,8 @@ def select(data=None, outfile=None, **kwargs): Pass all records whose locations are within one of the closed polygons in the multiple-segment file *polygonfile*. For spherical polygons (lon, lat), make sure no consecutive points are separated - by 180 degrees or more in longitude. + by 180 degrees or more in longitude. Distances are Cartesian and in + user units. {binary} {nodata} {find} From 30f43810c32b243955393ccf5bed76588e4df719 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Thu, 10 Aug 2023 08:20:07 +0200 Subject: [PATCH 06/20] Add new aliases in overview list --- pygmt/src/select.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 7d15dd75726..8ebeed2c90e 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -50,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 From e7fb0df2a11db0b0ac3c709c0e63ab78c07d5e2e Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 12:32:12 +0200 Subject: [PATCH 07/20] Shorten formulation --- pygmt/src/select.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 8ebeed2c90e..d1b63d1386a 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -134,16 +134,16 @@ def select(data=None, outfile=None, **kwargs): 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 then the 3rd + 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 then you can specify + influence. If you only have a single point you can specify *lon*/*lat* instead of *pointfile*. Distances are Cartesian and in user units. dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the line segments in the ASCII multiple-segment file *linefile*. - If *dist* is zero then we will scan each sub-header in *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. polygon : str From 9a250ee100f57fa5f4f9dd96f4144ac457f14906 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 13:05:43 +0200 Subject: [PATCH 08/20] Expand docstring for *'dist2line' --- pygmt/src/select.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index d1b63d1386a..1a8af690e18 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -146,6 +146,13 @@ def select(data=None, outfile=None, **kwargs): 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. + 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 segments + endpoints [Default considers points "beyond" the line's endpoints]. polygon : str *polygonfile*. Pass all records whose locations are within one of the closed From f62e207552307f59d5a6d2042c4baf8ed85380d0 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 13:24:25 +0200 Subject: [PATCH 09/20] Expand docstrings for 'dist2cpt', 'dist2line', 'polygon' --- pygmt/src/select.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 1a8af690e18..845364bc001 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -135,31 +135,33 @@ def select(data=None, outfile=None, **kwargs): *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 + 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. - dist2line : str - *linefile*\ **+d**\ *dist*\ [**+p**]. - Pass all records whose locations are within *dist* of any of the - line segments in the ASCII multiple-segment file *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. - Alternatively, if ``region`` and ``projection`` are used the - geographic coordinates are projected to map coordinates (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 segments - endpoints [Default considers points "beyond" the line's endpoints]. + 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 multiple-segment file *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 + 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 segments 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 multiple-segment file *polygonfile*. For spherical - polygons (lon, lat), make sure no consecutive points are separated - by 180 degrees or more in longitude. Distances are Cartesian and in - user units. + polygons in the ASCII multiple-segment file *polygonfile*. For + spherical polygons (lon, lat), make sure no consecutive points are + separated by 180 degrees or more in longitude. {binary} {nodata} {find} From fc4523b9390c4cdc5fe5eb08f8bc637f64d03df8 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 13:32:31 +0200 Subject: [PATCH 10/20] Fix typo --- pygmt/src/select.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 845364bc001..3bb1fff128e 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -138,7 +138,7 @@ def select(data=None, outfile=None, **kwargs): 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 + 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 @@ -149,13 +149,13 @@ def select(data=None, outfile=None, **kwargs): segments in the ASCII multiple-segment file *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 - 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 segments endpoints [Default considers points "beyond" - the line's endpoints]. + 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 From ebb7ddbea731f3cf1c292c7ee0172d0e87d8b3d4 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 13:36:43 +0200 Subject: [PATCH 11/20] Fix links to upstream GMT documentation --- pygmt/src/select.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 3bb1fff128e..a5c99b8ee7f 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -141,7 +141,7 @@ def select(data=None, outfile=None, **kwargs): 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 + :gmt-term:`PROJ_LENGTH_UNIT`) before Cartesian distances are compared to *dist*. dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. @@ -151,7 +151,7 @@ def select(data=None, outfile=None, **kwargs): **-D**\ *dist* setting that sets each line's individual distance value 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) + 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 From d6c0766f3950f7e727d2ebceeb89cb5742197882 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 13:42:04 +0200 Subject: [PATCH 12/20] Add missing sentence --- pygmt/src/select.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index a5c99b8ee7f..5c4d65a3cfa 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -148,14 +148,15 @@ def select(data=None, outfile=None, **kwargs): Pass all records whose locations are within *dist* of any of the line segments in the ASCII multiple-segment file *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 - 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]. + **-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 From 05a5a67fe00886ccfc34a2ccf2238a93c43f80d6 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sun, 27 Aug 2023 14:05:45 +0200 Subject: [PATCH 13/20] Add comma --- pygmt/src/select.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 5c4d65a3cfa..547bb80fad1 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -136,7 +136,7 @@ def select(data=None, outfile=None, **kwargs): 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 + 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 From ba6c65314c797dab431191b0686919ed7b0a0edd Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:28:22 +0200 Subject: [PATCH 14/20] Move docstrings for 'dist2pt', 'dist2line', and 'polyon' up --- pygmt/src/select.py | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 547bb80fad1..530ddd99703 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -72,6 +72,38 @@ 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 multiple-segment file *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 multiple-segment file *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 @@ -131,38 +163,6 @@ def select(data=None, outfile=None, **kwargs): and **+i** reverses the tests to pass record with *z* value NOT in the given range. Finally, if **+c** is not used then it is automatically incremented for each new ``z_subregion`` argument, starting with 2. - 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 multiple-segment file *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 multiple-segment file *polygonfile*. For - spherical polygons (lon, lat), make sure no consecutive points are - separated by 180 degrees or more in longitude. {binary} {nodata} {find} From 87138eab42f51b02126b52e7731d7774db841128 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:38:39 +0200 Subject: [PATCH 15/20] Add link to upstream GMT docs for 'multiple-segment file' --- pygmt/src/select.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 530ddd99703..a1252f356a8 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -87,7 +87,9 @@ def select(data=None, outfile=None, **kwargs): dist2line : str *linefile*\ **+d**\ *dist*\ [**+p**]. Pass all records whose locations are within *dist* of any of the line - segments in the ASCII multiple-segment file *linefile*. If *dist* is + segments in the ASCII :gmt-docs:`multiple-segment file + ` + *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`` @@ -101,7 +103,9 @@ def select(data=None, outfile=None, **kwargs): polygon : str *polygonfile*. Pass all records whose locations are within one of the closed - polygons in the ASCII multiple-segment file *polygonfile*. For + polygons in the ASCII :gmt-docs:`multiple-segment file + ` + *polygonfile*. For spherical polygons (lon, lat), make sure no consecutive points are separated by 180 degrees or more in longitude. resolution : str From 3a3b51580f4d17c9d09483ccb5c8a211e5c80530 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:40:45 +0200 Subject: [PATCH 16/20] Format line length --- pygmt/src/select.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index a1252f356a8..12e6e6b69db 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -89,25 +89,23 @@ def select(data=None, outfile=None, **kwargs): Pass all records whose locations are within *dist* of any of the line segments in the ASCII :gmt-docs:`multiple-segment file ` - *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 + *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 ` - *polygonfile*. For - spherical polygons (lon, lat), make sure no consecutive points are - separated by 180 degrees or more in longitude. + *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 From c9dd476b86449ef51a873b008ae6b18d257a4bd6 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:50:47 +0200 Subject: [PATCH 17/20] Fix line length --- pygmt/src/select.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 12e6e6b69db..35e1ecd06a6 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -91,14 +91,14 @@ def select(data=None, outfile=None, **kwargs): ` *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]. + 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 From d721bf8e7e82d72a28c1a7b01a66b191780628f5 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:55:09 +0200 Subject: [PATCH 18/20] Fix line length --- pygmt/src/select.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 35e1ecd06a6..f64ad30548d 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -95,10 +95,10 @@ def select(data=None, outfile=None, **kwargs): 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]. + 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 From f21347ca9f9eb0ec66b61ee98ac66b7ddcbac7ed Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 19:58:07 +0200 Subject: [PATCH 19/20] Fix line length --- pygmt/src/select.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index f64ad30548d..3adf1e720a5 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -94,11 +94,11 @@ def select(data=None, outfile=None, **kwargs): 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]. + 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 From 40251cfca10db058140c7bcee4752a963f87d215 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 30 Aug 2023 20:02:01 +0200 Subject: [PATCH 20/20] Fix line length --- pygmt/src/select.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index 3adf1e720a5..76edb73c3fc 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -89,16 +89,17 @@ def select(data=None, outfile=None, **kwargs): Pass all records whose locations are within *dist* of any of the line segments in the ASCII :gmt-docs:`multiple-segment file ` - *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]. + *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