spline_fitter
- jwst.residual_fringe.fitter.spline_fitter(x, y, weights, knots, degree, reject_outliers=False, domain=10, tolerance=0.0001)[source]
Fit a spline function to 1D data.
- Parameters:
- xndarray
Independent variable. Must be increasing.
- yndarray
Dependent variable, matching dimensions of
x.- weightsndarray
Weights for spline fitting. Must be positive.
- knotsndarray
Interior knots for the spline.
- degreeint
Degree of the spline to fit,
>= 1and<= 5.- reject_outliersbool, optional
If
True, iteratively fit the data with outlier rejection.- domainint, optional
Factor controlling the outlier threshold when
reject_outliersisTrue.- tolerancefloat, optional
Fit convergence tolerance when
reject_outliersisTrue.
- Returns:
- callable
The spline function fit to the data.