residual_voigt¶
- TRXASprefitpack.res.residual_voigt(x0: ndarray, num_voigt: int, edge: str | None = None, num_edge: int | None = 0, base_order: int | None = None, e: ndarray = None, intensity: ndarray = None, eps: ndarray = None) ndarray[source]¶
scipy.optimize.least_squares compatible vector residual function for fitting static spectrum with the sum of voigt function, edge function base function
- Parameters:
x0 –
initial parameter
i th: peak position e0_i for i th voigt component
\({num}_{voigt}+i\) th: fwhm_G of i th voigt component
\(2{num}_{voigt}+i\) th: fwhm_L of i th voigt component
if edge is not None:
\(3{num}_{voigt}+i\) th: ith edge position
\(3{num}_{voigt}+{num}_{edge}+i\) th: fwhm of ith edge function
num_voigt – number of voigt component
edge ({'g', 'l'}) – type of edge shape function if edge is not set, it does not include edge function.
num_edge – number of edge component
base_order (int) – polynomial order of baseline function if base_order is not set, it does not include baseline function.
e – 1d array of energy points of data (n,)
intensity – intensity of static data (n,)
eps – estimated error of data (n,)
- Returns:
Residucal vector
Note
If fwhm_G of ith voigt component is zero then it is treated as lorenzian function with fwhm_L
If fwhm_L of ith voigt component is zero then it is treated as gaussian function with fwhm_G