python类wofz()的实例源码

profile.py 文件源码 项目:smhr 作者: andycasey 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
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
Model.py 文件源码 项目:BayesVP 作者: cameronliang 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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
fitting.py 文件源码 项目:Py2DSpectroscopy 作者: SvenBo90 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
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
dispersion.py 文件源码 项目:HYDROS 作者: dtold 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def Z(zeta):
    return wofz(zeta)

#Initialize some variables only once
function_library.py 文件源码 项目:kafe 作者: dsavoiu 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号