skued.baseline_dwt
- skued.baseline_dwt(array, max_iter, level=None, wavelet='sym6', background_regions=None, mask=None, mode='constant', axis=-1)
Iterative method of baseline determination, based on the discrete wavelet transform.
- Parameters:
array (~numpy.ndarray) – Data with background.
max_iter (int) – Number of iterations to perform.
level (int or None, optional) – Decomposition level. A higher level will result in a coarser approximation of the input signal (read: a lower frequency baseline). If None (default), the maximum level possible is used.
wavelet (PyWavelet.Wavelet object or str, optional) – Wavelet with which to perform the algorithm. See PyWavelet documentation for available values. Default is ‘sym6’.
background_regions (iterable or None, optional) –
Indices of the array values that are known to be purely background. Depending on the dimensions of array, the format is different:
1D signal: background_regions is a list of ints (indices) or slices, e.g.
[0, 7, slice(534, 1000)]
.2D signal: background_regions is a list of tuples of ints (indices) or tuples of slices, e.g.
[(14, 19), (slice(59, 82), slice(81,23))]
.
Default is empty list.
mask (~numpy.ndarray, dtype bool, optional) – Mask array that evaluates to True for pixels that are invalid. Useful to determine which pixels are masked by a beam block.
mode (str, optional) – Signal extension mode, see pywt.Modes.
axis (int or tuple, optional) – Axis over which to compute the wavelet transform. Can also be a 2-tuple of ints for 2D baseline
- Returns:
baseline – Baseline of the input array.
- Return type:
~numpy.ndarray, shape (M,N)
See also
baseline_dt
Baseline-removal based on the dual-tree complex wavelet transform
References