Skip to content

Corrected bug in Spectrum poly_fit for multiple iterations

Johan Richard requested to merge poly_fit_bug into master

When performing poly_fit on a spectrum with multiple iterations the indices computed from the "err" array do not follow any more the size of the original data d and wavelengths w.

This resulted in an extreme case (10 iterations) of the shortening of the data used for the fit and divergence of the fit.

Adding a new calculation of err based on the original data size (simply repeating the line at every iteration) solves the issue.

Merge request reports