pybaselines.Baseline.interp_pts
- Baseline.interp_pts(data=None, baseline_points=(), interp_method='linear')[source]
Creates a baseline by interpolating through input points.
- Parameters:
- dataarray_like, optional
The y-values. Not used by this function, but input is allowed for consistency with other functions.
- 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_method
str, optional The method to use for interpolation. See
scipy.interpolate.interp1dfor all options. Default is 'linear', which connects each point with a line segment.
- Returns:
- baseline
numpy.ndarray, shape (N,) The baseline array constructed from interpolating between each input baseline point.
dictAn empty dictionary, just to match the output of all other algorithms.
- baseline
- Raises:
ValueErrorRaised of baseline_points does not contain at least two values, signifying one x-y point.
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.