For class, we are trying to prove a simple example of the Lomb-Scargle Periodogram using the embedded package in scipy. There is little documentation on how to use this function, and I have not been able to find any help online. When I run the code, I get a value of ~6.3 for the main peak of the periodogram, as opposed to the expected ~23.3. The data that we are pulling from is a simple .dat file with lists of numbers. Here is the code, any ideas on what's happening?
import scipy as sp
import math as m
import numpy as np
from scipy.signal import lombscargle
import pylab as plt
from numpy import shape
x=[]
y=[]
nout = 10000
file=open("hv878_1945.dat", 'r')
for pair in file:
xandy=pair.split()
x.append(float(xandy[0]))
y.append(float(xandy[2]))
x=np.asarray(x)
y=np.asarray(y)
f = np.linspace(0.1, 50, nout)
periodogram=sp.signal.spectral.lombscargle(x,y,f)
normval = x.shape[0]
plt.plot(f, np.sqrt(4*(periodogram/normval)))
plt.show()
Here is the file, if anybody wants to run it: http://www.mediafire.com/download/9a0aw9nc40r4c73/hv878_1945.dat
Any help would be appreciated!