Python scipy.special 模块,wofz() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用scipy.special.wofz()

项目:smhr    作者:andycasey    | 项目源码 | 文件源码
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
项目:BayesVP    作者:cameronliang    | 项目源码 | 文件源码
def voigt(x, a):
    """
    Real part of Faddeeva function, where    
    w(z) = exp(-z^2) erfc(jz)
    """
    z = x + 1j*a
    return wofz(z).real
项目:Py2DSpectroscopy    作者:SvenBo90    | 项目源码 | 文件源码
def voigt(x, a, b, c, d):
    z = (x-b+1j*d)/c/numpy.sqrt(2)
    result = a*numpy.real(wofz(z))/c/numpy.sqrt(2*numpy.pi)
    return result
项目:HYDROS    作者:dtold    | 项目源码 | 文件源码
def Z(zeta):
    return wofz(zeta)

#Initialize some variables only once
项目:kafe    作者:dsavoiu    | 项目源码 | 文件源码
def voigt(x, x0=0., gamma=1., sigma=0.01, scale=1.):
  if gamma!=0. and sigma/gamma < 1.e-16:
      return lorentz(x, x0, gamma, scale)
  else:
    return scale*wofz(((x - x0)+1.j*gamma)/sqrt(2.)/sigma).real/(sqrt(2.*pi)*sigma)