func_fit¶
-
pydl.pydlutils.trace.func_fit(x, y, ncoeff, invvar=None, function_name='legendre', ia=None, inputans=None, inputfunc=None)[source]¶ Fit
x,ypositions to a functional form.Parameters: x : array-like
X values (independent variable).
y : array-like
Y values (dependent variable).
ncoeff :
intNumber of coefficients to fit.
invvar : array-like, optional
Weight values; inverse variance.
function_name :
str, optionalFunction name, default ‘legendre’.
ia : array-like, optional
An array of bool of length
ncoeffspecifying free (True) and fixed (False) parameters.inputans : array-like, optional
An array of values of length
ncoeffspecifying the values of the fixed parameters.inputfunc : array-like, optional
Multiply the function fit by these values.
Returns: tuple()of array-likeFit coefficients, length
ncoeff; fitted values.Raises: :exc:`KeyError`
If an invalid function type is selected.
:exc:`ValueError`
If input dimensions do not agree.