pybaselines.morphological.amormol
- pybaselines.morphological.amormol(data, half_window=None, tol=0.001, max_iter=200, pad_kwargs=None, x_data=None, window_kwargs=None, **kwargs)[source]
Iteratively averaging morphological and mollified (aMorMol) baseline.
- Parameters:
- dataarray_like, shape (N,)
The y-values of the measured data, with N data points.
- half_window
int, optional The half-window used for the morphology functions. If a value is input, then that value will be used. Default is None, which will optimize the half-window size using
optimize_window()and window_kwargs.- tol
float, optional The exit criteria. Default is 1e-3.
- max_iter
int, optional The maximum number of iterations. Default is 200.
- 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.- x_dataarray_like, optional
The x-values. Not used by this function, but input is allowed for consistency with other functions.
- window_kwargs
dict, optional A dictionary of keyword arguments to pass to
optimize_window()for estimating the half window if half_window is None. 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 window_kwargs.
- Returns:
- baseline
numpy.ndarray, shape (N,) The calculated baseline.
- params
dict A dictionary with the following items:
- 'half_window': int
The half window used for the morphological calculations.
- 'tol_history': numpy.ndarray
An array containing the calculated tolerance values for each iteration. The length of the array is the number of iterations completed. If the last value in the array is greater than the input tol value, then the function did not converge.
- baseline
References
Chen, H., et al. An Adaptive and Fully Automated Baseline Correction Method for Raman Spectroscopy Based on Morphological Operations and Mollifications. Applied Spectroscopy, 2019, 73(3), 284-293.