pygmt.GrdMathCalc

class pygmt.GrdMathCalc(arg_str=None)[source]

Raster calculator for grids (element by element).

Examples

>>> grdcalc = GrdMathCalc()
>>> # Basic square root operation
>>> grid0 = grdcalc.sqrt(
...     ingrid="@earth_relief_01d", outgrid=True, region=[0, 3, 6, 9]
... )

Methods Summary

GrdMathCalc.compute()

Perform the grdmath computation and returns an xarray.DataArray object.

GrdMathCalc.grdmath(operator[, ingrid, ...])

Raster calculator for grids (element-wise operations).

GrdMathCalc.multiply(ingrid[, outgrid])

A * B.

GrdMathCalc.sqrt(ingrid[, outgrid])

sqrt (A).

GrdMathCalc.std(ingrid[, outgrid])

Standard deviation of A.