polysinfit

tayph.polysinfit(x, y, polydeg, lmfit=True, polyprimer=True, return_primer=False, stepsize=0, w=None, startparams=None)[source] [edit on github]

This fits a polynomial modulated by a sine-wave to a 1D array of points. With a solution tp the hyper-sensitivity to the intial guess frequency by unsym: https://stackoverflow.com/ questions/16716302/how-do-i-fit-a-sine-curve-to-my-data-with-pylab-and-numpy

polyprimer is ignored if startparams is set.