Skip to content

Commit 5150a85

Browse files
willschlitzerMeghan Jones
andauthored
Apply suggestions from code review
Co-authored-by: Meghan Jones <meghanj@alum.mit.edu>
1 parent 0509f02 commit 5150a85

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

pygmt/src/grdvolume.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,32 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs):
2525
r"""
2626
Determine the volume between the surface of a grid and a plane.
2727
28-
Read a 2-D grid file and calculate the volume contained below the surface
29-
and above the plane specified by the given contour (or zero if not given)
30-
and return the contour, area, volume, and maximum mean height
31-
(volume/area). Alternatively, a range of contours can be specified to
32-
return the volume and area inside the contour for all contour values.
28+
Read a 2-D grid file and calculate the volume contained below the surface
29+
and above the plane specified by the given contour (or zero if not given)
30+
and return the contour, area, volume, and maximum mean height
31+
(volume/area). Alternatively, a range of contours can be specified to
32+
return the volume and area inside the contour for all contour values.
3333
3434
Full option list at :gmt-docs:`grdvolume.html`
3535
36-
{aliases}
36+
{aliases}
3737
38-
Parameters
39-
----------
38+
Parameters
39+
----------
4040
grid : str or xarray.DataArray
4141
The file name of the input grid or the grid loaded as a DataArray.
4242
This is the only required parameter.
4343
output_type : str
4444
Determine the format the xyz data will be returned in [Default is
4545
``pandas``]:
46+
4647
- ``numpy`` - :class:`numpy.ndarray`
4748
- ``pandas``- :class:`pandas.DataFrame`
4849
- ``file`` - ASCII file (requires ``outfile``)
4950
outfile : str
5051
The file name for the output ASCII file.
5152
contour : str or int or float or list
52-
*cval*\ |*low/high/delta*\ |**r**\ *low/high*\ |**r**\ *cval*.
53+
*cval*\|\ *low/high/delta*\|\ **r**\ *low/high*\|\ **r**\ *cval*.
5354
Find area, volume and mean height (volume/area) inside and above the
5455
*cval* contour. Alternatively, search using all contours from *low* to
5556
*high* in steps of *delta*. [Default returns area, volume and mean
@@ -62,19 +63,20 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs):
6263
between two contours. If no *contour* is given then there is no contour
6364
and the entire grid area, volume and the mean height is returned and
6465
*cval* will be reported as 0.
65-
{R}
66-
{V}
66+
{R}
67+
{V}
6768
68-
Returns
69-
-------
69+
Returns
70+
-------
71+
ret : pandas.DataFrame or numpy.ndarray or None
7072
ret : pandas.DataFrame or numpy.ndarray or None
7173
Return type depends on ``outfile`` and ``output_type``:
74+
7275
- None if ``outfile`` is set (output will be stored in file set by
73-
``outfile``)
76+
``outfile``)
7477
- :class:`pandas.DataFrame` or :class:`numpy.ndarray` if ``outfile``
75-
is not set (depends on ``output_type`` [Default is
76-
class:`pandas.DataFrame`])
77-
78+
is not set (depends on ``output_type`` [Default is
79+
class:`pandas.DataFrame`])
7880
"""
7981
if output_type not in ["numpy", "pandas", "file"]:
8082
raise GMTInvalidInput(

0 commit comments

Comments
 (0)