fit_gaussian_peak

popurri.peakutils.fit_gaussian_peak(w, f, amp_hint=-0.5, cen_hint=None, wid_hint=0.01, shift_hint=0.8, minmax='min')

Fit a single Gaussian to a spectrum line.

Gaussian G(x)=shift+amp*e^(-(x-cen)^2/(2*wid^2))

Uses lmfit package.

Parameters:
w, f1d arrays

Spectrum range where the minimum is located.

amp_hintfloat

Amplitude value to be used as 1st guess when performing the fit.

cen_hintfloat

Wavelength of the minimum location, to be used as 1st guess when fitting. If None, the mean value of w is used.

wid_hintfloat
shift_hintfloat
minmax = str

Specifies if the peak to be fitted is a minimum or a maximum, to know if the gaussian amplitude parameter amp must be negative or positive, respectively. Default: β€˜min’.

Returns:
lmfit results object