iterfit¶
- pydl.pydlutils.bspline.iterfit(xdata, ydata, invvar=None, upper=5, lower=5, x2=None, maxiter=10, groupbadpix=False, **kwargs)[source]¶
Iteratively fit a B-spline set to data, with rejection.
Additional keyword parameters are passed to
bspline
.- Parameters:
- xdata
numpy.ndarray
Independent variable.
- ydata
numpy.ndarray
Dependent variable.
- invvar
numpy.ndarray
, optional Inverse variance of
ydata
. If not set, it will be calculated based on the standard deviation.- upper
int
orfloat
, optional Upper rejection threshold in units of sigma, defaults to 5 sigma.
- lower
int
orfloat
, optional Lower rejection threshold in units of sigma, defaults to 5 sigma.
- x2
numpy.ndarray
, optional Orthogonal dependent variable for 2d fits.
- maxiter
int
, optional Maximum number of rejection iterations, default 10. Set this to zero to disable rejection.
- groupbadpix
bool
, optional This keyword will be passed to
djs_reject()
.
- xdata
- Returns:
tuple
A tuple containing the fitted bspline object and an output mask.