def _voigt(x, *parameters):
"""
Evaluate a Voigt profile at x, given the profile parameters.
:param x:
The x-values to evaluate the Voigt profile at.
:param parameters:
The position, fwhm, amplitude, and shape of the Voigt profile.
"""
try:
n = len(x)
except TypeError:
n = 1
position, fwhm, amplitude, shape = parameters
profile = 1 / wofz(np.zeros((n)) + 1j * np.sqrt(np.log(2.0)) * shape).real
profile *= amplitude * wofz(2*np.sqrt(np.log(2.0)) * (x - position)/fwhm \
+ 1j * np.sqrt(np.log(2.0))*shape).real
return profile
评论列表
文章目录