Skip to content

New over-dense spectrogram method (TimeSeries.spectrogram2)

This PR introduces a new over-dense spectrogram method for calculating and displaying short-duration spectrograms. Also included is a new example, with the following code:

from gwpy.timeseries import TimeSeries
gwdata = TimeSeries.fetch('L1:OAF-CAL_DARM_DQ', 'Feb 28 2015 06:02:05', 'Feb 28 2015 06:02:10')
specgram = gwdata.spectrogram2(fftlength=0.15, overlap=0.14) ** (1/2.)
medratio = specgram.ratio('median')
plot = medratio.plot(norm='log', vmin=0.5, vmax=10)
plot.set_yscale('log')
plot.set_ylim(40, 8192)
plot.add_colorbar(label='Amplitude relative to median')
plot.set_title('L1 $h(t)$ with noise interference')
plot.show()

which produces the following output:

spectrogram2

There are minor problems with precision errors making their way up to determine the length of the spectrogram, but since this is mainly for visualisation purposes, I'm not too fussed.

This should fix #25 (closed).

Merge request reports