Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

spectrochempy.clip

clip(dataset, a_min=None, a_max=None, **kwargs)[source]

Clip (limit) the values in a dataset.

Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

No check is performed to ensure a_min < a_max .

Parameters
  • dataset (array_like) – Input array or object that can be converted to an array.

  • a_min (scalar or array_like or None) – Minimum value. If None, clipping is not performed on lower interval edge. Not more than one of a_min and a_max may be None.

  • a_max (scalar or array_like or None) – Maximum value. If None, clipping is not performed on upper interval edge. Not more than one of a_min and a_max may be None. If a_min or a_max are array_like, then the three arrays will be broadcasted to match their shapes.

Returns

clip – An array with the elements of a , but where values < a_min are replaced with a_min , and those > a_max with a_max .