Making a power spectrum from a TimeSeries¶
How to estimate the power spectrum of a TimeSeries.
import matplotlib.pyplot as plt from scipy import signal import astropy.units as u import sunpy.timeseries from sunpy.data.sample import RHESSI_TIMESERIES
Let’s first load a RHESSI TimeSeries from sunpy’s sample data. This data contains 9 columns, which are evenly sampled with a time step of 4 seconds.
ts = sunpy.timeseries.TimeSeries(RHESSI_TIMESERIES)
We now use SciPy’s
periodogram to estimate the
power spectra of the first column of the Timeseries. The first column contains
X-Ray emmisions in the range of 3-6 keV. An alternative version is Astropy’s
Let’s plot the results.
Total running time of the script: ( 0 minutes 0.357 seconds)