`LombScargle(..., method="fast")` disagrees with the exact method by more than expected on tightly clustered, non-uniform sampling · Issue #20449 · astropy/astropy · GitHub
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LombScargle(..., method="fast") disagrees with the exact method by more than expected on tightly clustered, non-uniform sampling #20449
For the standard normalization (power bounded to [0, 1]), fast and slow should agree to within a small absolute budget (on the order of 1e-6) across the range of sampling patterns the method is documented to support.
How to Reproduce
importnumpyasnpfromastropy.timeseriesimportLombScarglerng=np.random.default_rng(0)
span=1094.6count=155t=np.sort(np.r_[rng.normal(0, span*1e-8, count-1), span]) # 154 points# clustered near t=0,# plus one at t=spany=rng.normal(size=count)
frequency=0.8+0.0037*np.arange(791)
ls=LombScargle(t, y)
fast_power=ls.power(frequency, method="fast",
assume_regular_frequency=True, normalization="standard")
slow_power=ls.power(frequency, method="slow", normalization="standard")
print(np.max(np.abs(fast_power-slow_power))) # 7.53e-06
Activity