Skip to content

Commit cfb9572

Browse files
weiji14willschlitzerMeghan Jones
authored
Apply suggestions from code review
Co-authored-by: Will Schlitzer <schlitzer90@gmail.com> Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
1 parent cceb2a6 commit cfb9572

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

pygmt/src/triangulate.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ def triangulate(table=None, x=None, y=None, z=None, **kwargs):
3636
data.
3737
3838
Triangulate reads in x,y[,z] data and performs Delaunay triangulation,
39-
i.e., it find how the points should be connected to give the most
39+
i.e., it finds how the points should be connected to give the most
4040
equilateral triangulation possible. If a map projection (give *region*
4141
and *projection*) is chosen then it is applied before the triangulation
4242
is calculated.
4343
44-
Must provide either *table* or *x*, *y*, and *z*.
44+
Must provide either ``table`` or ``x``, ``y``, and ``z``.
4545
4646
Full option list at :gmt-docs:`triangulate.html`
4747
@@ -55,17 +55,12 @@ def triangulate(table=None, x=None, y=None, z=None, **kwargs):
5555
Pass in (x, y, z) or (longitude, latitude, elevation) values by
5656
providing a file name to an ASCII data table, a 2D
5757
{table-classes}.
58-
projection : str
59-
Select map projection.
60-
region
61-
``'xmin/xmax/ymin/ymax[+r][+uunit]'``.
62-
Specify the region of interest.
63-
spacing : str
64-
``'xinc[unit][+e|n][/yinc[unit][+e|n]]'``.
65-
x_inc [and optionally y_inc] is the grid spacing.
58+
{J}
59+
{R}
60+
{I}
6661
outgrid : bool or str
6762
Use triangulation to grid the data onto an even grid (specified with
68-
*region* and *spacing*). Set to True, or pass in the name of the output
63+
``region`` and ``spacing``). Set to ``True``, or pass in the name of the output
6964
grid file. The interpolation is performed in the original coordinates,
7065
so if your triangles are close to the poles you are better off
7166
projecting all data to a local coordinate system before using
@@ -79,16 +74,16 @@ def triangulate(table=None, x=None, y=None, z=None, **kwargs):
7974
{h}
8075
{i}
8176
{r}
82-
Only valid with *outgrid*.
77+
Only valid with ``outgrid``.
8378
8479
Returns
8580
-------
86-
ret: xarray.DataArray or None
87-
Return type depends on whether the outgrid parameter is set:
81+
ret: pandas.DataFrame or xarray.DataArray or None
82+
Return type depends on whether the ``outgrid`` parameter is set:
8883
89-
- pandas.DataFrame if outgrid is None (default)
90-
- xarray.DataArray if outgrid is True
91-
- None if outgrid is a str (grid output will be stored in outgrid)
84+
- pandas.DataFrame if ``outgrid`` is None (default)
85+
- xarray.DataArray if ``outgrid`` is True
86+
- None if ``outgrid`` is a str (grid output will be stored in ``outgrid``)
9287
"""
9388
with GMTTempFile(suffix=".nc") as tmpfile:
9489
with Session() as lib:

0 commit comments

Comments
 (0)