pybaselines.Baseline.noise_median
- Baseline.noise_median(data, half_window=None, smooth_half_window=None, sigma=None, pad_kwargs=None, **kwargs)[source]
The noise-median method for baseline identification.
Assumes the baseline can be considered as the median value within a moving window, and the resulting baseline is then smoothed with a Gaussian kernel.
- Parameters:
- dataarray_like, shape (N,)
The y-values of the measured data, with N data points.
- half_window
int, optional The index-based size to use for the median window. The total window size will range from [-half_window, ..., half_window] with size 2 * half_window + 1. Default is None, which will use twice the output from
optimize_window(), which is an okay starting value.- smooth_half_window
int, optional The half window to use for smoothing. Default is None, which will use the same value as half_window.
- sigma
float, optional The standard deviation of the smoothing Gaussian kernel. Default is None, which will use (2 * smooth_half_window + 1) / 6.
- pad_kwargs
dict, optional A dictionary of keyword arguments to pass to
pad_edges()for padding the edges of the data to prevent edge effects from convolution. Default is None.- **kwargs
Deprecated since version 1.2.0: Passing additional keyword arguments is deprecated and will be removed in version 1.4.0. Pass keyword arguments using pad_kwargs.
- Returns:
- baseline
numpy.ndarray, shape (N,) The calculated and smoothed baseline.
dictAn empty dictionary, just to match the output of all other algorithms.
- baseline
References
Friedrichs, M., A model-free algorithm for the removal of baseline artifacts. J. Biomolecular NMR, 1995, 5, 147-153.