Calculating the period of the sunspot cycle

Nice to see solar data being used to illustrate a fundamental tool of the astronomer: the FFT :o)

The IDL Data Point

Two weeks ago, I used the sunspot number data provided by the Solar Physics Group at NASA’s Marshall Space Flight Center to demonstrate positioning plots in window. This week, I’d like to show how to calculate the period of the sunspot cycle.

If you haven’t already done so, download the sunspot numbers file and place it in your IDL path. Read it with the astrolib READCOL procedure:

file = file_which('spot_num.txt', /include)
readcol, file, year, month, sunspots

Next, transform the sunspot series to the frequency domain and compute magnitude and power spectra:

mspec = abs(fft(sunspots))
pspec = mspec^2

(Aside: FFT: it’s all you need.)

I’d like to display the power spectrum as a function of frequency. This requires a few statements to set up a frequency vector based on the time data from the sunspot numbers file:

sampling_interval = 1/

View original post 348 more words

Advertisements
Calculating the period of the sunspot cycle