.. sectionauthor:: Duncan Macleod .. currentmodule:: gwpy.frequencyseries Plotting a Rayleigh-statistic `Spectum` ####################################### First, we import the :class:`~gwpy.timeseries.TimeSeries` and :meth:`~gwpy.timeseries.TimeSeries.get` the data: .. code-block:: python from gwpy.timeseries import TimeSeries gwdata = TimeSeries.get( 'H1:LDAS-STRAIN,rds', 'September 16 2010 06:40', 'September 16 2010 06:50') Next, we can calculate a Rayleigh statistic `FrequencySeries` using the :meth:`~gwpy.timeseries.TimeSeries.rayleigh_spectrum` method of the `~gwpy.timeseries.TimeSeries` with a 2-second FFT and 1-second overlap (50%): .. code-block:: python rayleigh = gwdata.rayleigh_spectrum(2, 1) and can make a plot using the :meth:`~FrequencySeries.plot` method .. code-block:: python plot = rayleigh.plot() plot.set_xscale('log') plot.set_xlim(40, 4000) plot.set_xlabel('Frequency [Hz]') plot.set_ylabel('Rayleigh statistic') plot.show() .. plot:: ../examples/frequencyseries/rayleigh.py