DEV Community

pupper emeritus
pupper emeritus

Posted on

GSoC Week 4 Update

Brief

This week I successfully finished implementing the fast algorithm. Now my LombScargleCrossspectrum and LombScarglePowerspectrum are that much closer to completion. Only things left to sort out/implement are time lags and phase lag functions and checking the phase of the output.

Details

Testing on the following synthetic data has been conducted to compare the outputs with the existing cross spectrum and power spectrum for evenly spaced data first then checking the outputs of the lomb scargle variants on unevenly sampled data

rand = np.random.default_rng(42)
n = 1000
t = np.linspace(0, 10, n)
y = np.sin(2 * np.pi * 3.0 * t) + 0.1 * rand.standard_normal(n)
y2 = np.sin(2 * np.pi * 3.0 * t) + 0.1 * rand.standard_normal(n)
y -= np.min(y)
y2 -= np.min(y2)
Enter fullscreen mode Exit fullscreen mode

The Cross spectra for evenly sampled data

Image description

The time lags for evenly sampled data

As it is evident the time lags need work.

Image description

The power spectra for evenly sampled data

One quirk is that the power spectrum class is returning the power spectrum with a negative sign. This is a known bug. The values otherwise are within margin of error.

Image description

The Lomb Scargle cross spectrum and power spectrum when data is unevenly sampled

t = np.sort(rand.random(n))*10

The cross spectrum

Image description

The power spectrum

Image description

The time lags

Image description

They are off here too. Which will be fixed in the coming week.

For exhaustive testing code refer

Top comments (0)