From 354d2c476c0b8f75f9e739ec9a569be38a13d3cd Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 10 Mar 2023 08:17:22 +0100 Subject: [PATCH 01/12] Add alias 'tiling' for 'T' in 'binstats.py' --- pygmt/src/binstats.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index ecc3e160d98..32456d95604 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -20,6 +20,7 @@ I="spacing", N="normalize", R="region", + T="tiling", S="search_radius", V="verbose", W="weight", From b8c0f9bcbe1df252756119b5dc9793cf87f6b088 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 10 Mar 2023 08:23:44 +0100 Subject: [PATCH 02/12] Add basic docstring for 'tiling' --- pygmt/src/binstats.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 32456d95604..5dc542e9227 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -88,6 +88,20 @@ def binstats(data, **kwargs): Sets the *search_radius* that determines which data points are considered close to a node. Append the distance unit. Not compatible with ``tiling``. + tiling : str + **h**\|\ **r**. + Instead of circular, possibly overlapping areas, select + non-overlapping tiling. Choose between rectangular hexagonal + binning. For **r**, set bin sizes via ``spacing`` and we write + the computed statistics to the grid file named in ``outgrid``. + For **h**, we write a table with the centers of the hexagons and + the computed statistics to standard output (or to the file named + in ``outgrid``). Here, the ``spacing`` setting is expected to + set the y-increment only and we compute the x-increment given + the geometry. Because the horizontal spacing between hexagon + centers in x and y have a ratio of, we will automatically + adjust xmax in ``region`` to fit a whole number of hexagons. + Note: Hexagonal tiling requires Cartesian data. weight : str Input data have an extra column containing observation point weight. If weights are given then weighted statistical quantities will be From ed4159530818f456003608941b21c312ff2c4005 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 10 Mar 2023 08:39:29 +0100 Subject: [PATCH 03/12] Fix higlighting --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 5dc542e9227..04c8838db76 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -101,7 +101,7 @@ def binstats(data, **kwargs): the geometry. Because the horizontal spacing between hexagon centers in x and y have a ratio of, we will automatically adjust xmax in ``region`` to fit a whole number of hexagons. - Note: Hexagonal tiling requires Cartesian data. + **Note**: Hexagonal tiling requires Cartesian data. weight : str Input data have an extra column containing observation point weight. If weights are given then weighted statistical quantities will be From 230f39c20718197ef97d8f47cf4a9d67d249ae95 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 10 Mar 2023 08:50:19 +0100 Subject: [PATCH 04/12] Add missing word and highlighting --- pygmt/src/binstats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 04c8838db76..4e62a87874c 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -91,8 +91,9 @@ def binstats(data, **kwargs): tiling : str **h**\|\ **r**. Instead of circular, possibly overlapping areas, select - non-overlapping tiling. Choose between rectangular hexagonal - binning. For **r**, set bin sizes via ``spacing`` and we write + non-overlapping tiling. Choose between **r**\ ectangular and + **h**\ exagonal binning. + For **r**, set bin sizes via ``spacing`` and we write the computed statistics to the grid file named in ``outgrid``. For **h**, we write a table with the centers of the hexagons and the computed statistics to standard output (or to the file named From 0d9088d1dece79d811542b86a93de731911661ee Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 10 Mar 2023 08:56:05 +0100 Subject: [PATCH 05/12] Add highlighting --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 4e62a87874c..6a4deb5a3f9 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -101,7 +101,7 @@ def binstats(data, **kwargs): set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon centers in x and y have a ratio of, we will automatically - adjust xmax in ``region`` to fit a whole number of hexagons. + adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str Input data have an extra column containing observation point weight. From 5bff1cfd3cfe889f8b61585a44b954fffca4dc71 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sat, 11 Mar 2023 09:58:34 +0100 Subject: [PATCH 06/12] Add missing mathematical expression --- pygmt/src/binstats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 6a4deb5a3f9..e9ee22335de 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -100,9 +100,9 @@ def binstats(data, **kwargs): in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon - centers in x and y have a ratio of, we will automatically - adjust *xmax* in ``region`` to fit a whole number of hexagons. - **Note**: Hexagonal tiling requires Cartesian data. + centers in x and y have a ratio of :math:`sqrt(3)`, we will + automatically adjust *xmax* in ``region`` to fit a whole number + of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str Input data have an extra column containing observation point weight. If weights are given then weighted statistical quantities will be From 41c2cfd46ab959efcfe8f32a96d20c911c534800 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sat, 11 Mar 2023 10:10:06 +0100 Subject: [PATCH 07/12] Add missing '\' for mathematical expression --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index e9ee22335de..2ba90f28cb9 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -100,7 +100,7 @@ def binstats(data, **kwargs): in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon - centers in x and y have a ratio of :math:`sqrt(3)`, we will + centers in x and y have a ratio of :math:`\sqrt(3)`, we will automatically adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str From a23709329cd4e81cc1bc1c2b09c528abf03a7714 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sat, 11 Mar 2023 10:13:46 +0100 Subject: [PATCH 08/12] Use correct brackets in mathematical expression --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 2ba90f28cb9..9d8e4f4a3b0 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -100,7 +100,7 @@ def binstats(data, **kwargs): in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon - centers in x and y have a ratio of :math:`\sqrt(3)`, we will + centers in x and y have a ratio of :math:`\sqrt{3}`, we will automatically adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str From a52d8c23b9757d8494423365cdd232e6e84cb6bb Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sat, 11 Mar 2023 10:16:42 +0100 Subject: [PATCH 09/12] Fix brackets in mathematical expression --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 9d8e4f4a3b0..dbd5fa26059 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -100,7 +100,7 @@ def binstats(data, **kwargs): in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon - centers in x and y have a ratio of :math:`\sqrt{3}`, we will + centers in x and y have a ratio of :math:`\sqrt{{ 3 }}`, we will automatically adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str From 991e39ad48752d4bdd4f055486d196e6d1c3c98d Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Sat, 11 Mar 2023 19:40:02 +0100 Subject: [PATCH 10/12] Use singular --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index dbd5fa26059..4acdd30246c 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -100,7 +100,7 @@ def binstats(data, **kwargs): in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given the geometry. Because the horizontal spacing between hexagon - centers in x and y have a ratio of :math:`\sqrt{{ 3 }}`, we will + centers in x and y has a ratio of :math:`\sqrt{{ 3 }}`, we will automatically adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str From 68f25d9aecb409e3f4ea29295224cb61eba4bc91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sun, 12 Mar 2023 07:47:05 +0100 Subject: [PATCH 11/12] Fix alphabetic order (code review) Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- pygmt/src/binstats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 4acdd30246c..1e4c93576e5 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -20,8 +20,8 @@ I="spacing", N="normalize", R="region", - T="tiling", S="search_radius", + T="tiling", V="verbose", W="weight", a="aspatial", From d32819939398de99a7716fd119a856b1108a24e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Sun, 11 Jun 2023 22:42:48 +0200 Subject: [PATCH 12/12] Clearfy (hopefully) formulation --- pygmt/src/binstats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/binstats.py b/pygmt/src/binstats.py index 9ea79548744..4061c56785b 100644 --- a/pygmt/src/binstats.py +++ b/pygmt/src/binstats.py @@ -99,8 +99,8 @@ def binstats(data, **kwargs): the computed statistics to standard output (or to the file named in ``outgrid``). Here, the ``spacing`` setting is expected to set the y-increment only and we compute the x-increment given - the geometry. Because the horizontal spacing between hexagon - centers in x and y has a ratio of :math:`\sqrt{{ 3 }}`, we will + the geometry. Because the spacing between hexagon centers in + x and y directions have a ratio of :math:`\sqrt{{ 3 }}`, we will automatically adjust *xmax* in ``region`` to fit a whole number of hexagons. **Note**: Hexagonal tiling requires Cartesian data. weight : str