QGram#

class gwpy.signal.qtransform.QGram(
plane: QPlane,
energies: list[TimeSeries],
search: tuple[float, float] | None,
)[source]#

Bases: object

Store tile energies over an irregularly gridded plane.

Parameters:
planeQPlane

The time-frequency plane over which to populate.

energieslist of TimeSeries

A list of signal energies for each row of tiles.

searchSegment

Search window of interest to determine the loudest tile.

Methods Summary

interpolate([tres, fres, logf, outseg])

Interpolate this QGram over a regularly-gridded spectrogram.

table([snrthresh])

Represent this QPlane as an EventTable.

Methods Documentation

interpolate(
tres: float | None | str = '<default>',
fres: float | None | str = '<default>',
*,
logf: bool = False,
outseg: Segment | None = None,
) Spectrogram[source]#

Interpolate this QGram over a regularly-gridded spectrogram.

Parameters:
tresfloat

Desired time resolution (seconds) of output Spectrogram, default is abs(outseg) / 1000.

fresfloat, int, None

Desired frequency resolution (Hertz) of output Spectrogram, or, if logf=True, the number of frequency samples; give None to skip this step and return the original resolution, default is 0.5 Hz or 500 frequency samples.

logfbool

Boolean switch to enable (True) or disable (False) use of log-sampled frequencies in the output Spectrogram.

outsegSegment

GPS [start, stop) segment for output Spectrogram, default is the full duration of the input.

Returns:
outSpectrogram

Output Spectrogram of normalised Q energy.

See also

scipy.interpolate

This method uses InterpolatedUnivariateSpline to cast all frequency rows to a common time-axis, and then interp2d to apply the desired frequency resolution across the band.

Notes

This method will return a Spectrogram of dtype float32 if norm is given, and float64 otherwise.

To optimize plot rendering with pcolormesh, the output Spectrogram can be given a log-sampled frequency axis by passing logf=True at runtime. The fres argument is then the number of points on the frequency axis. Note, this is incompatible with imshow.

It is also highly recommended to use the outseg keyword argument when only a small window around a given GPS time is of interest.

table(snrthresh: float = 5.5) EventTable[source]#

Represent this QPlane as an EventTable.

Parameters:
snrthreshfloat

Lower inclusive threshold on individual tile SNR to keep in the table, default: 5.5.

Returns:
outEventTable

A table of time-frequency tiles on this QPlane.

Notes

Only tiles with signal energy greater than or equal to snrthresh ** 2 / 2 will be stored in the output EventTable.