pybaselines.utils

Helper functions for pybaselines.

Created on March 5, 2021 @author: Donald Erb

Exceptions

ParameterWarning

Warning issued when a parameter value is outside of the recommended range.

SortingWarning

Issued when assume_sorted is set to True and inputs are not in ascending order.

Functions

difference_matrix

Creates an n-order finite-difference matrix.

gaussian

Generates a Gaussian distribution based on height, center, and sigma.

gaussian2d

Generates a Gaussian distribution based on height, center, and sigma.

gaussian_kernel

Creates an area-normalized gaussian kernel for convolution.

optimize_window

Optimizes the morphological half-window size.

pad_edges

Adds left and right edges to the data.

pad_edges2d

Adds left, right, top, and bottom edges to the data.

padded_convolve

Pads data before convolving to reduce edge effects.

pspline_smooth

Smooths the input data using Penalized Spline smoothing.

relative_difference

Calculates the relative difference, (norm(new-old) / norm(old)), of two values.

whittaker_smooth

Smooths the input data using Whittaker smoothing.