pygmt.grdvolume

pygmt.grdvolume(grid, output_type='pandas', outfile=None, *, plane=None, outside_volume=None, slice=None, region=None, unit=None, verbose=None, **kwargs)[source]

Determine the volume between the surface of a grid and a plane.

Read a 2-D grid file and calculate the volume contained below the surface and above the plane specified by the given contour (or zero if not given) and return the contour, area, volume, and maximum mean height (volume/area). Alternatively, a range of contours can be specified to return the volume and area inside the contour for all contour values. Using -T, the contour that produced the maximum mean height (or maximum curvature of heights vs contour value) is returned as well.

Aliases:

  • C = plane

  • Cr = outside_volume

  • D = slice

  • R = region

  • S = unit

  • V = verbose

gridstr or xarray.DataArray

The file name of the input grid or the grid loaded as a DataArray. This is the only required parameter.

output_typestr

Determine the format the xyz data will be returned in [Default is pandas]:

outfilestr

The file name for the output ASCII file.

regionstr or list

Required if this is the first plot command. xmin/xmax/ymin/ymax[+r][+uunit]. Specify the region of interest.

verbosebool or str

Select verbosity level [Default is w], which modulates the messages written to stderr. Choose among 7 levels of verbosity:

  • q - Quiet, not even fatal error messages are produced

  • e - Error messages only

  • w - Warnings [Default]

  • t - Timings (report runtimes for time-intensive algorithms);

  • i - Informational messages (same as verbose=True)

  • c - Compatibility warnings

  • d - Debugging messages

retpandas.DataFrame or numpy.ndarray or None

Return type depends on outfile and output_type: - None if outfile is set (output will be stored in file set by

outfile)