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
评论列表
文章目录