Use of scipy.signal.lombscargle

孤人 提交于 2019-12-09 02:32:30

It would appear you have the same problem described here. Basically you are not testing the frequency of interest and did not take into account that the frequencies passed to lombscargle are angular frequencies.

If you change your list of tested frequencies, you'll see there's a peak near the angular frequency of ~138, which corresponds to a frequency of 22.28 (=angular frequency /2/pi):

import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import lombscargle

plt.ion()
data = np.loadtxt('hv878_1945.dat')

ang_freq = np.linspace(.1, 25*6, 10000)
periodogram = lombscargle(data[:,0], data[:,2], ang_freq)
print(ang_freq[np.argmax(periodogram)]/2/np.pi)
plt.plot(ang_freq, periodogram)

I will make the same remark that Jaime made in the other SO question:

you cannot rely on just looking for the max of periodogram to find the dominant frequency, because the harmonics may fool you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!