From 5f87f7b1f0273603d81ef96a2c0fbf8df8921268 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 25 Apr 2023 16:07:29 +0200 Subject: [PATCH 1/4] Improve formulation of criteria list --- pygmt/src/select.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pygmt/src/select.py b/pygmt/src/select.py index ef07387cd68..fb8ec89d2fd 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -42,17 +42,17 @@ def select(data=None, outfile=None, **kwargs): Select data table subsets based on multiple spatial criteria. This is a filter that reads (x, y) or (longitude, latitude) positions from - the first 2 columns of *data* and uses a combination of 1-7 criteria to - pass or reject the records. Records can be selected based on whether or not - they are: - - 1. inside a rectangular region (``region`` [and ``projection``]) - 2. within *dist* km of any point in *pointfile* - 3. within *dist* km of any line in *linefile* - 4. inside one of the polygons in the *polygonfile* - 5. inside geographical features (based on coastlines) - 6. has z-values within a given range, or - 7. inside bins of a grid mask whose nodes are non-zero + the first 2 columns of ``data`` and uses a combination of 1-7 + criteria to pass or reject the records. Records can be selected based on + whether or not 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 the *polygonfile* + 5. are inside geographical features (based on shorelines) + 6. have z-values within a given range + 7. are inside bins of a grid mask whose nodes are non-zero The sense of the tests can be reversed for each of these 7 criteria by using the ``reverse`` parameter. From 3883127b37fe0413b28574144be2f8b7570a0834 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 25 Apr 2023 16:16:52 +0200 Subject: [PATCH 2/4] Adjust line length --- 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 fb8ec89d2fd..5d7a9c7641c 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -42,9 +42,9 @@ def select(data=None, outfile=None, **kwargs): Select data table subsets based on multiple spatial criteria. This is a filter that reads (x, y) or (longitude, latitude) positions from - the first 2 columns of ``data`` and uses a combination of 1-7 - criteria to pass or reject the records. Records can be selected based on - whether or not they: + the first 2 columns of ``data`` and uses a combination of 1-7 criteria to + pass or reject the records. Records can be selected based on whether or not + they: 1. are inside a rectangular region (``region`` [and ``projection``]) 2. are within *dist* km of any point in *pointfile* From 7616b915915fa0e94fc062534acdcf57cb277522 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 25 Apr 2023 16:18:50 +0200 Subject: [PATCH 3/4] Revert change --- 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 5d7a9c7641c..0c38f0e7703 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -50,7 +50,7 @@ def select(data=None, outfile=None, **kwargs): 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 the *polygonfile* - 5. are inside geographical features (based on shorelines) + 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 846aa6dbbf1caa00eeabfa4ebd072b35c43901ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:59:35 +0200 Subject: [PATCH 4/4] Remove un-needed word (code review) Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> --- 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 0c38f0e7703..2d8a38e9f72 100644 --- a/pygmt/src/select.py +++ b/pygmt/src/select.py @@ -49,7 +49,7 @@ def select(data=None, outfile=None, **kwargs): 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 the *polygonfile* + 4. are inside one of the polygons in *polygonfile* 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