PolyfitClip#
- excalibuhr.utils.PolyfitClip(x, y, order, mask=None, clip=4.0, max_iter=20)[source]#
Perform weighted least-square polynomial fit, iterratively cliping pixels above a certain sigma threshold
- Parameters:
x (array) – the x and y arrays to be fitted
y (array) – the x and y arrays to be fitted
order (int) – degree of polynomial
clip (int) – sigma clip threshold
max_iter (int) – max number of iteration in sigma clip
mask (bool) – boolean array with the masked values set to False.
- Returns:
y_model (array) – polynomial fitted results
coeffs (array) – best fit polynomial coefficient