skultrafast.fit_spectrum

Module to fit the whole spektrum by peak functions.

Module Contents

Functions

voigt(x, A, mu, sig[, gamma])

lorentz_peaks(x, A, x0, w)

gauss_peaks(x, A, x0, w)

voigt_peaks(x, A, x0, w)

fit_spectrum(x, y, start_peaks_list[, yerr, ...])

Fits multiple peaks to mulitple spektra, the position and width of

bin_every_n(x, start_idx[, n, reduction_func])

Attributes

pi

skultrafast.fit_spectrum.pi[source]
skultrafast.fit_spectrum.voigt(x, A, mu, sig, gamma=0.1)[source]
skultrafast.fit_spectrum.lorentz_peaks(x, A, x0, w)[source]
skultrafast.fit_spectrum.gauss_peaks(x, A, x0, w)[source]
skultrafast.fit_spectrum.voigt_peaks(x, A, x0, w)[source]
skultrafast.fit_spectrum.fit_spectrum(x, y, start_peaks_list, yerr=None, peak_func=lorentz_peaks, amp_penalty=0.01, amp_bounds=(-0.6, 0.4), wmin=2, wmax=10, add_const=False)[source]

Fits multiple peaks to mulitple spektra, the position and width of each peak is the same for all spectra, only the amplitude is allowed to differ.

Parameters:
  • x ((n)-ndarray) – The x-values to fit, e.g. wavelengths or wavenumbers.

  • y ((n, m)-ndarray) – The y-values to fit.

  • start_peak_list (list) – A list containing (x0, amp, w) tuples. Used as starting values.

  • yerr ((n, m)-ndarray) – The errors of the data. Default None.

  • peaks_func (function, optional) – Function which calculates the peaks. Has the following signature: func(x, A_arr, x0_arr, w_arr), defaults to lorentz_peaks.

  • amp_penalty (float, optional) – Regulazition parameter for the amplitudes. Defaults to 0.001.

  • amp_bounds ((float, float)-tuple, optional) – Min and max bounds for the amplitude.

  • wmax (float, optional) – Upper bound for the width parameter.

  • wmin (float, optional) – Lower bound for the width parameter.

  • add_const (bool) – Weather to add an const background.

skultrafast.fit_spectrum.bin_every_n(x, start_idx, n=10, reduction_func=lambda x: ...)[source]