-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document default Delaunay Triangulation algorithm as Shewchuk #6438
Document default Delaunay Triangulation algorithm as Shewchuk #6438
Conversation
Current default should be the Shewchuk [1996] algorithm, and not Watson [1982]. Modified documentation in contour.rst, triangulate.rst and gmt.conf.rst to be clear on this. Also mentioned using `gmt get GMT_TRIANGULATE` as the way to know which one is being used.
In makegmt.macro there are two parameters that can be defined: | ||
TRIANGLE_D and TRIANGLE_O. By default they are commented out. | ||
TRIANGLE_D and TRIANGLE_O. By default these lines are commented out. | ||
To use Shewchuk's [1996] routine, remove the # from the | ||
beginning of the lines and then 'make clean' and 'make install'. | ||
To revert to the default GMT usage of Watson's [1982] algorithm, | ||
To revert to using Watson's [1982] algorithm, | ||
simply place a # in the first column at these two lines. | ||
Then, say 'make clean' and 'make install' again. | ||
Then, run 'make clean' and 'make install' again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need a bit of help rewording these lines. I don't see makegmt.macro
anywhere (the git blame
on this file dates back to Dec 2000!!). I do see a TRIANGLE_D
here:
Lines 6580 to 6585 in 434ed18
/* GMT_TRIANGULATE */ | |
#ifdef TRIANGLE_D | |
GMT->current.setting.triangulate = GMT_TRIANGLE_SHEWCHUK; | |
#else | |
GMT->current.setting.triangulate = GMT_TRIANGLE_WATSON; | |
#endif |
but no mention of TRIANGLE_O
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My best guess is that these macros are in reference to the pre-CMake days. I think that this paragraph and the preceding to sentences should instead make these points:
- Use
gmt set GMT_TRIANGULATE
to control which algorithm is used on the fly. - Use
set (LICENSE_RESTRICTED GPL)
incmake/ConfigUserAdvanced.cmake
to disable Shewchuk's routine entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, pre-CMake language.
Wrapping the triangulate function which does "Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data". Original GMT documentation can be found at https://docs.generic-mapping-tools.org/6.3/triangulate.html. Aliased outgrid (G), spacing (I), projection (J), region (R), verbose (V), registration (r). * Refactor triangulate to use virtualfile_from_data * Refactor triangulate implementation to use pygmt.io.load_dataarray * Alias binary(b), nodata(d), find(e), coltypes(f), header(h), incols(i) * Rename the parameter 'table' to 'data' As per #1479. * Refactor test_triangulate to use Table_5_11_mean.xyz instead of tut_ship * Refactor test_triangulate_with_outgrid to use xr.testing.assert_allclose * Refactor test_triangulate_input_xyz to use pd.testing.assert_frame_equal * Implement regular_grid and delaunay_triples staticmethod for triangulate * Let list inputs to spacing (I) and incols (i) work Use I="sequence" and i="sequence_comma". * Ensure triangulate.delaunay_triples output_type is valid Must be either one of numpy, pandas or file * Autocorrect output_type to 'file' if outfile parameter is set * Allow only str or None inputs to outgrid parameter Xref #1807 * Use gmt get GMT_TRIANGULATE to check whether Watson or Shewchuk is used * State that Shewchuk is the default triangulation algorithm As per GenericMappingTools/gmt#6438 * Actually document the output_type parameter for delaunay_triples Co-authored-by: Will Schlitzer <schlitzer90@gmail.com> Co-authored-by: Meghan Jones <meghanj@alum.mit.edu> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Remind me if this is ready to be approved - it has been languishing for some time. |
Might need some more changes to the wording. Feel free to work directly on this branch, I'm a bit short on time right now. |
OK, but not sure how to check out your branch... |
Here are the instructions for checking out a PR - https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally. That said, I am not sure whether you'd be able to push to Wei Ji's branch (I haven't ever tried to push to a fork from a local checkout). This is an improvement, so IMO you could merge this as a part 1 and make any additional edits as a separate PR if it's easier. |
Thanks, that is easier, now merged. |
Wrapping the triangulate function which does "Delaunay triangulation or Voronoi partitioning and gridding of Cartesian data". Original GMT documentation can be found at https://docs.generic-mapping-tools.org/6.3/triangulate.html. Aliased outgrid (G), spacing (I), projection (J), region (R), verbose (V), registration (r). * Refactor triangulate to use virtualfile_from_data * Refactor triangulate implementation to use pygmt.io.load_dataarray * Alias binary(b), nodata(d), find(e), coltypes(f), header(h), incols(i) * Rename the parameter 'table' to 'data' As per GenericMappingTools#1479. * Refactor test_triangulate to use Table_5_11_mean.xyz instead of tut_ship * Refactor test_triangulate_with_outgrid to use xr.testing.assert_allclose * Refactor test_triangulate_input_xyz to use pd.testing.assert_frame_equal * Implement regular_grid and delaunay_triples staticmethod for triangulate * Let list inputs to spacing (I) and incols (i) work Use I="sequence" and i="sequence_comma". * Ensure triangulate.delaunay_triples output_type is valid Must be either one of numpy, pandas or file * Autocorrect output_type to 'file' if outfile parameter is set * Allow only str or None inputs to outgrid parameter Xref GenericMappingTools#1807 * Use gmt get GMT_TRIANGULATE to check whether Watson or Shewchuk is used * State that Shewchuk is the default triangulation algorithm As per GenericMappingTools/gmt#6438 * Actually document the output_type parameter for delaunay_triples Co-authored-by: Will Schlitzer <schlitzer90@gmail.com> Co-authored-by: Meghan Jones <meghanj@alum.mit.edu> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Description of proposed changes
Current default should be the Shewchuk [1996] algorithm, and not Watson [1982]. Modified documentation in contour.rst, triangulate.rst, gmt.conf.rst and TRIANGLE.HOWTO to be clear on this. Also mentioned using
gmt get GMT_TRIANGULATE
as the way to know which one is being used.Fixes #6436
Reminders