pybaselines.misc.interp_pts

pybaselines.misc.interp_pts(x_data, baseline_points=(), interp_method='linear', data=None)[source]

Creates a baseline by interpolating through input points.

Parameters:
x_dataarray_like, shape (N,)

The x-values of the measured data.

baseline_pointsarray_like, shape (L, 2)

An array of ((x_1, y_1), (x_2, y_2), ..., (x_L, y_L)) values for each point representing the baseline.

interp_methodstr, optional

The method to use for interpolation. See scipy.interpolate.interp1d for all options. Default is 'linear', which connects each point with a line segment.

dataarray_like, optional

The y-values. Not used by this function, but input is allowed for consistency with other functions.

Returns:
baselinenumpy.ndarray, shape (N,)

The baseline array constructed from interpolating between each input baseline point.

dict

An empty dictionary, just to match the output of all other algorithms.

Notes

This method is only suggested for use within user-interfaces.

Regions of the baseline where x_data is less than the minimum x-value or greater than the maximum x-value in baseline_points will be assigned values of 0.