Hello,
Sorry in advance for the (certainly numerous) grammar and orthograph errors, english is not my primary language.
Long story short, my problem is that I’m getting strange not really exploitable results when using LombScargle on simple, not noisy sinus. Every time i try, the periodogram i obtain show multiple spikes and the highest one is never the correct one and i would like to understand why and how to solve this issue.
For a little context, i am trying to judge the results of an implementation of the LombScargle function and i planned to use the one in astropy as a point of reference.
I precise that i do not have any astrophysics nor Signal theory background
I’ve tried running the LombScargle function on a simple, not noisy sinus with a periode of 250 seconds. I’ve created a sample with a constant step between each value and every time i try to run the code, the obtained periodogram show one spike indicating the correct frequency and two false spikes with frequencies at 0.5 and 1.0 and of course the 0.5 and 1.0 spikes are higher than the correct one.
the sinus is a simple sinus sin(2*pi/250 * t) with a point of data every two seconds
i’ve run the default LombScargle presented in the doc on it with 125 points of data and the result is this
If i’ve understood this algorithm correctly the highest spikes is supposed to be the frequence of the function and on a simple function as the one i used i was expecting to see a single very high spike.
What am i doing wrong for the result to be this bad ? Is there any parameter i forgot to apply or maybe I’m using this tool completely backward ?
the code i used is as follows:
from astropy.timeseries import LombScargle
points = list(range(0,250,2))
sample = (points,map(lambda x: math.sin(math.pi*2/250*x),points))
res = LombScargle(*sample).autopower
I’ve tried this on astropy 6.0.0 and 6.0.1
i’ve also tried different options for the autopower (scipy,slow,and cython) and adding more data points up to 1000 with always the same step between them with no luck.
I have not tried to mess with the frequence range manually since i have no real understanding of the internals working of this algorithm
Thanks in advance