fitlegendre

pySurf.data2D.fitlegendre(x, y=None, deg=None, nanstrict=False, fixnans=False)

Return a legendre fit of degree deg.

Work with 1 or 2D y (if 2D, each column is independently fit and x is the coordinate of first axis). if nanstrict is True, every column containing nan (or Inf) is considered invalid and a column of nan is returned, if False, nan are excluded and fit is calculated on valid points only (note that since columns are slices along first index, the option has no effect on 1D data (nans are always returned as nans).

2020/09/16 modified 1D/2D mechanism, where all the code, including the part in common 1D/2D was moved to the 2D specific part, while the 1D part is completely delegated to functions in pyProfile.profile.