API Lineshapes#

Peak shapes shared by the models. All peaks are normalised to a height of 1 at their centre, and take the full widths at half maximum (FWHM) as input.

satlas2.lineshapes.fwhmToSigma(fwhm: float) → float[source]#

Standard deviation of a Gaussian with the given FWHM.

satlas2.lineshapes.gaussian(x: ArrayLike, fwhm: float) → ArrayLike[source]#

Gaussian peak with height 1.

satlas2.lineshapes.lorentzian(x: ArrayLike, fwhm: float) → ArrayLike[source]#

Lorentzian peak with height 1.

satlas2.lineshapes.skew(x: ArrayLike, skew: float, fwhmg: float) → ArrayLike[source]#

Skewing factor of a peak centred at 0 with Gaussian FWHM fwhmg:

\[1 + \mathrm{erf}\left(\frac{\alpha x}{\sigma\sqrt{2}}\right)\]

with \(\alpha\) the skew and \(\sigma\) the standard deviation of the Gaussian component. This is twice the normal cumulative distribution function of the skew normal distribution, and the definition used by SkewedGaussianModel and SkewedVoigtModel in lmfit. A positive skew moves intensity to the right, a negative skew to the left.

satlas2.lineshapes.voigt(x: ArrayLike, fwhmg: float, fwhml: float) → ArrayLike[source]#

Voigt peak (convolution of a Gaussian and a Lorentzian) with height 1.

satlas2.lineshapes.voigtFWHM(fwhmg: float, fwhml: float, fwhmg_unc: float = 0, fwhml_unc: float = 0, correlation: float = 0) → tuple[float, float][source]#

Total FWHM of a Voigt peak, with its uncertainty.

Uses the approximation of Olivero and Longbothum (1977), accurate to 0.02%: 0.5346 L + sqrt(0.2166 L^2 + G^2).

Returns:

Tuple of the form (value, uncertainty)

Return type:

tuple[float, float]