Skip to content

Commit ba51f80

Browse files
weiji14willschlitzerMeghan Jonesseisman
authored
Wrap triangulate (#731)
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 <[email protected]> Co-authored-by: Meghan Jones <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
1 parent 0041492 commit ba51f80

File tree

5 files changed

+571
-0
lines changed

5 files changed

+571
-0
lines changed

doc/api/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ Operations on tabular data
124124
sphdistance
125125
sphinterpolate
126126
surface
127+
triangulate
128+
triangulate.regular_grid
129+
triangulate.delaunay_triples
127130
xyz2grd
128131

129132
Operations on raster data

pygmt/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
sphdistance,
5757
sphinterpolate,
5858
surface,
59+
triangulate,
5960
which,
6061
x2sys_cross,
6162
x2sys_init,

pygmt/src/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from pygmt.src.subplot import set_panel, subplot
4848
from pygmt.src.surface import surface
4949
from pygmt.src.text import text_ as text # "text" is an argument within "text_"
50+
from pygmt.src.triangulate import triangulate
5051
from pygmt.src.velo import velo
5152
from pygmt.src.which import which
5253
from pygmt.src.wiggle import wiggle

0 commit comments

Comments
 (0)