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

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
view raw testing1.ipynb hosted with ❤ by GitHub

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay