smoothing.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:ThePayne 作者: pacargile 项目源码 文件源码
def smooth_fft_vsini(dv,spec,sigma):
    # The Fourier coordinate
    ss = rfftfreq(len(spec), d=dv)

    # Make the fourier space taper
    ss[0] = 0.01 #junk so we don't get a divide by zero error
    ub = 2. * np.pi * sigma * ss
    sb = j1(ub) / ub - 3 * np.cos(ub) / (2 * ub ** 2) + 3. * np.sin(ub) / (2 * ub ** 3)
    #set zeroth frequency to 1 separately (DC term)
    sb[0] = 1.

    # Fourier transform the spectrum
    FF = np.fft.rfft(spec)

    # Multiply in fourier space
    FF_tap = FF * sb

    # Fourier transform back
    spec_conv = np.fft.irfft(FF_tap)
    return spec_conv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号