SplineSplrepFitter#
- class astropy.modeling.spline.SplineSplrepFitter[source]#
Bases:
_SplineFitterFit a spline using the
scipy.interpolate.splrepfunction interface.Methods Summary
__call__(model, x, y, **kwargs)Fit a spline to data using the splrep interface.
Methods Documentation
- __call__(model, x, y, **kwargs)[source]#
Fit a spline to data using the splrep interface.
- Parameters:
- model
Spline1D The spline model to fit.
- xnumpy:array_like
The x data values.
- ynumpy:array_like
The y data values.
- task
python:int, optional Task parameter for splrep. Default is 0. See
scipy.interpolate.splrepfor details.- tnumpy:array_like, optional
The interior knots needed for
task=-1. If given, thentaskis automatically set to -1. seescipy.interpolate.splrepfor details. Interior knots for the spline. If not provided, the model’s existing interior knots (t_interior) are used if available.- s
python:float, optional Positive smoothing factor used to choose the number of knots. The user can use
sto control the tradeoff between closeness and smoothness of fit. Largersmeans more smoothing while smaller values ofsindicate less smoothing. If not provided orNone,sis calculated automatically based on the data.- **kwargs
python:dict, optional Additional keyword arguments:
weightsarray-like, optionalWeights for the data points.
bboxarray-like, optionalThe bounding box limits as
[xmin, xmax]. Default is[None, None].
- model
- Returns:
- fitted_copy
Spline1D A copy of the input model with fitted parameters.
- fitted_copy
Notes
The fit information (fp, ier, msg) from splrep is stored in the
fit_infoattribute of the fitter instance.