polartoolkit.grid_trend

Contents

polartoolkit.grid_trend#

grid_trend(da, coords=('x', 'y', 'z'), deg=1, plot=False, **kwargs)[source]#

Fit an arbitrary order trend to a grid and use it to detrend.

Parameters:
  • da (DataArray) – input grid

  • coords (tuple[str, str, str]) – coordinate names of the supplied grid, by default [ā€˜x’, ā€˜y’, ā€˜z’]

  • deg (int) – trend order to use, by default 1

  • plot (bool) – plot the results, by default False

  • kwargs (Any)

Returns:

returns xarray.DataArrays of the fitted surface, and the detrended grid.

Return type:

tuple[DataArray, DataArray]