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 (xarray.DataArray) – input grid

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

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

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

  • kwargs (Any)

Returns:

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

Return type:

tuple[xarray.DataArray, xarray.DataArray]