skued.pseudo_voigt

skued.pseudo_voigt(coordinates, center, fwhm_g, fwhm_l)

Unit integral pseudo-Voigt profile. Deviation from real Voigt by less than 1% [1].

Parameters:
  • coordinates (array_like) – Can be either a list of ndarrays, as a meshgrid coordinates list, or a single ndarray for 1D computation

  • center (array_like) – Center of the pseudo-voigt. Should be the same shape as coordinates.ndim.

  • fwhm_g (float) – Full-width at half-max of the Gaussian and Lorentzian parts respectively.

  • fwhm_l (float) – Full-width at half-max of the Gaussian and Lorentzian parts respectively.

Returns:

out – Pseudo-Voigt profile of unit integral.

Return type:

ndarray

Example

>>> import numpy as np
>>> from skued import pseudo_voigt
>>>
>>> span = np.arange(-5, 5, 0.01)
>>> xx, yy = np.meshgrid(span, span)
>>> pV = pseudo_voigt( coordinates = [xx,yy], center = [0,0], fwhm_g = 0.1, fwhm_l = 0.1)
>>> pV.shape == xx.shape
True
>>> np.trapz(np.trapz(pV, span[None, :], axis=1), span, axis=0) # Integral should be unity
0.9938490810821982

References