GWForge.glitch.sine_gaussian

Sine-Gaussian glitches, added incoherently: each detector gets its own.

A Morlet-Gabor wavelet is a Gaussian envelope times a complex exponential. Its real part is the sine-Gaussian below with a phase offset, so one function covers both choices of glitch model.

Attributes

Functions

envelope_width(frequency, q)

Gaussian envelope width tau = Q / (sqrt(2) pi f0) in seconds.

sine_gaussian(times, time, frequency, q[, amplitude, ...])

h(t) = A exp(-((t - t0) / tau)^2) cos(2 pi f0 (t - t0) + phi).

optimal_snr(samples, sample_rate, interferometer)

Optimal SNR sqrt(4 df sum |h(f)|^2 / S(f)) of samples against the detector's PSD.

draw_glitches(rng, start, end, rate, snr_range, ...[, ...])

Draw a glitch population for one detector over [start, end].

add_glitches(samples, epoch, sample_rate, glitches, ...)

Add every glitch in glitches to samples in place and return their peak strains.

Module Contents

GWForge.glitch.sine_gaussian.EDGE = 6[source]
GWForge.glitch.sine_gaussian.envelope_width(frequency, q)[source]

Gaussian envelope width tau = Q / (sqrt(2) pi f0) in seconds.

GWForge.glitch.sine_gaussian.sine_gaussian(times, time, frequency, q, amplitude=1.0, phase=0.0)[source]

h(t) = A exp(-((t - t0) / tau)^2) cos(2 pi f0 (t - t0) + phi).

Parameters:
  • times (numpy.ndarray) – Sample times in seconds.

  • time (float) – Centre time (s), central frequency (Hz) and quality factor of the burst.

  • frequency (float) – Centre time (s), central frequency (Hz) and quality factor of the burst.

  • q (float) – Centre time (s), central frequency (Hz) and quality factor of the burst.

  • amplitude (float, optional) – Peak strain and phase at the centre; phase=-pi/2 gives the sine quadrature.

  • phase (float, optional) – Peak strain and phase at the centre; phase=-pi/2 gives the sine quadrature.

GWForge.glitch.sine_gaussian.optimal_snr(samples, sample_rate, interferometer)[source]

Optimal SNR sqrt(4 df sum |h(f)|^2 / S(f)) of samples against the detector’s PSD.

The transform is zero-padded to four times the input so a short burst is resolved in frequency; the band below the detector’s minimum frequency is dropped.

GWForge.glitch.sine_gaussian.draw_glitches(rng, start, end, rate, snr_range, frequency_range, q_range, snr_index=1.0, phases=None)[source]

Draw a glitch population for one detector over [start, end].

The number is Poisson with mean rate * (end - start) / 3600 (rate is per hour), the frequency is log-uniform in frequency_range, the SNR follows the bounded power law p(snr) ~ snr**-snr_index on snr_range (snr_index=1 is log-uniform), Q is uniform in q_range, the phase is drawn from phases when given (else uniform), and the time is uniform but kept EDGE envelope widths inside the span so no burst is cut by a file edge.

The SNR is the optimal SNR against the detector’s PSD. Omicron SNRs quoted in glitch catalogues are lower than this for the same burst.

Returns:

Keys time, frequency, q, snr, phase, one entry per glitch.

Return type:

dict of numpy.ndarray

GWForge.glitch.sine_gaussian.add_glitches(samples, epoch, sample_rate, glitches, interferometer)[source]

Add every glitch in glitches to samples in place and return their peak strains.

Each unit burst is built on time +- EDGE tau only and scaled so its optimal SNR against interferometer’s PSD equals the requested snr.