fit_peaks function

Refine position and value of extremes by fitting