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¶
|
Gaussian envelope width |
|
|
|
Optimal SNR |
|
Draw a glitch population for one detector over |
|
Add every glitch in |
Module Contents¶
- 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/2gives the sine quadrature.phase (float, optional) – Peak strain and phase at the centre;
phase=-pi/2gives 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))ofsamplesagainst 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(rateis per hour), the frequency is log-uniform infrequency_range, the SNR follows the bounded power lawp(snr) ~ snr**-snr_indexonsnr_range(snr_index=1is log-uniform), Q is uniform inq_range, the phase is drawn fromphaseswhen given (else uniform), and the time is uniform but keptEDGEenvelope 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
glitchestosamplesin place and return their peak strains.Each unit burst is built on
time +- EDGE tauonly and scaled so its optimal SNR againstinterferometer’s PSD equals the requestedsnr.