models Module

class skbeam.core.fitting.models.ComptonModel(*args, **kwargs)

Bases: lmfit.model.Model

Wrap the compton function for fitting within lmfit framework

Model compton peak, which is generated as an inelastic peak and always stays to the left of elastic peak on the spectrum.

Parameters
xarray

energy value

compton_amplitudefloat

area for gaussian peak, gaussian step and gaussian tail functions

coherent_sct_energyfloat

incident energy

fwhm_offsetfloat

global fitting parameter for peak width

fwhm_fanoprimefloat

global fitting parameter for peak width

e_offsetfloat

offset of energy calibration

e_linearfloat

linear coefficient in energy calibration

e_quadraticfloat

quadratic coefficient in energy calibration

compton_anglefloat

compton angle in degree

compton_fwhm_corrfloat

correction factor on peak width

compton_f_stepfloat

weight factor of the gaussian step function

compton_f_tailfloat

weight factor of gaussian tail on lower side

compton_gammafloat

normalization factor of gaussian tail on lower side

compton_hi_f_tailfloat

weight factor of gaussian tail on higher side

compton_hi_gammafloat

normalization factor of gaussian tail on higher side

epsilonfloat

energy to create a hole-electron pair for Ge 2.96, for Si 3.61 at 300K needs to double check this value

Returns
countsarray

compton peak

References

1

M. Van Gysel etc, “Description of Compton peaks in energy-dispersive x-ray fluorescence spectra”, X-Ray Spectrometry, vol. 32, pp. 139-147, 2003.

class skbeam.core.fitting.models.ElasticModel(*args, **kwargs)

Bases: lmfit.model.Model

Wrap the elastic function for fitting within lmfit framework Model of elastic peak in X-Ray fluorescence

Parameters
xarray

energy value

coherent_sct_amplitudefloat

area of elastic peak

coherent_sct_energyfloat

incident energy

fwhm_offsetfloat

global fitting parameter for peak width

fwhm_fanoprimefloat

global fitting parameter for peak width

e_offsetfloat

offset of energy calibration

e_linearfloat

linear coefficient in energy calibration

e_quadraticfloat

quadratic coefficient in energy calibration

epsilonfloat

energy to create a hole-electron pair for Ge 2.96, for Si 3.61 at 300K needs to double check this value

Returns
valuearray

elastic peak

class skbeam.core.fitting.models.Lorentzian2Model(*args, **kwargs)

Bases: lmfit.model.Model

Wrap the lorentzian2 function for fitting within lmfit framework 1-d lorentzian squared profile

Parameters
xarray

independent variable

areafloat

area of lorentzian squared peak, If area is set as 1, the integral is unity.

centerfloat

center position

sigmafloat

standard deviation

skbeam.core.fitting.models.set_default(model_name, func_name)

Set values and bounds to Model parameters in lmfit.

Parameters
model_nameclass object

Model class object from lmfit

func_namefunction

function name of physics peak