shnitsel.core.postprocess.norm

norm(da, dim='direction', keep_attrs=None)

Calculate the 2-norm of a DataArray, reducing the dimension with dame dim

Parameters:
  • da (DataArray) – Array to calculate the norm of

  • dim (Hashable) – Dimension to calculate norm along (and therby reduce), by default ‘direction’

  • optional – Dimension to calculate norm along (and therby reduce), by default ‘direction’

  • keep_attrs (bool | str | None) – How to deal with attributes; passed to xr.apply_ufunc, by default None

  • optional – How to deal with attributes; passed to xr.apply_ufunc, by default None

Return type:

A DataArray with dimension dim reduced