skultrafast.fit_spectrum ======================== .. py:module:: skultrafast.fit_spectrum .. autoapi-nested-parse:: Module to fit the whole spektrum by peak functions. Attributes ---------- .. autoapisummary:: skultrafast.fit_spectrum.pi Functions --------- .. autoapisummary:: skultrafast.fit_spectrum.voigt skultrafast.fit_spectrum.lorentz_peaks skultrafast.fit_spectrum.gauss_peaks skultrafast.fit_spectrum.voigt_peaks skultrafast.fit_spectrum.fit_spectrum skultrafast.fit_spectrum.bin_every_n Module Contents --------------- .. py:data:: pi .. py:function:: voigt(x, A, mu, sig, gamma=0.1) .. py:function:: lorentz_peaks(x, A, x0, w) .. py:function:: gauss_peaks(x, A, x0, w) .. py:function:: voigt_peaks(x, A, x0, w) .. py:function:: 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) 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. :param x: The x-values to fit, e.g. wavelengths or wavenumbers. :type x: (n)-ndarray :param y: The y-values to fit. :type y: (n, m)-ndarray :param start_peak_list: A list containing (x0, amp, w) tuples. Used as starting values. :type start_peak_list: list :param yerr: The errors of the data. Default None. :type yerr: (n, m)-ndarray :param peaks_func: Function which calculates the peaks. Has the following signature: func(x, A_arr, x0_arr, w_arr), defaults to lorentz_peaks. :type peaks_func: function, optional :param amp_penalty: Regulazition parameter for the amplitudes. Defaults to 0.001. :type amp_penalty: float, optional :param amp_bounds: Min and max bounds for the amplitude. :type amp_bounds: (float, float)-tuple, optional :param wmax: Upper bound for the width parameter. :type wmax: float, optional :param wmin: Lower bound for the width parameter. :type wmin: float, optional :param add_const: Weather to add an const background. :type add_const: bool .. py:function:: bin_every_n(x, start_idx, n=10, reduction_func=lambda x: np.mean(x, 0))