fit_gaussian_spec

popurri.peakutils.fit_gaussian_spec(w, f, imin, imax1, imax2, amp_hint=-0.5, cen_hint=None, wid_hint=0.01, shift_hint=0.8, minmax='min', nfitmin=None, returntype='pandas')

Fit len(imin) peaks in the spectrum w, f.

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

Uses fit_gaussian_peak.

Parameters:
amp_hintarray or float

Amplitude value(s) to be used as 1st guess when performing the fit. If it is a float, the same value is used for all the peaks. If it is an array, it must contain a value for each peak in w[imin], i.e. len(amp_hint) == len(imin).

cen_hintarray, float or None

Wavelength(s) of the minimum location, to be used as 1st guess when fitting. If it is a float, the same value is used for all the peaks. If it is an array, it must contain a value for each peak, e.g. w[imin]. If None, the mean value of w is used.

wid_hintarray or float
shift_hintarray or float
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’.

returntype{‘pandas’, ‘lmfit’}

Type of returned value. If ‘pandas’, return a pandas dataframe with the most important fit parameters of each peak. If ‘lmfit’, return a list with the output of the lmfit fit function.

}