Glitch Methods
This page contains the documentation for ‘Glitch_Methods.py’. This module contains functions for generating short transient glitches.
Function Definitions
Generates PSD for colouring glitches. PSDs are from PyCBC’s analytical PSD module.
Parameters:
ifo (string) - Interferometer abbreviation
run (string) - Observing run
low_frequency_cutoff (float) - Low frequency cutoff for filtering
Returns:
pycbc.types.frequencyseries.FrequencySeries - Power spectral density to colour glitch spectra
Rounds to multiple of sampling rate. Used for avoiding errors when functions are given times that are not multiples of the sampling rate.
Parameters:
number (float) - Value to round
rate (float) - Sampling rate; rounds to nearest multiple of this number
Returns:
float - Value rounded to multiple of the given rate
Generates coloured noise based on a real PSD. Noise is based off of both the detector and the given observing run.
Parameters:
duration (float) - Duration of noise in seconds
ifo (string) - Interferometer abbreviation
run (string) - Observing run
seed (Nonetype or int) - Optional random seed
scale (float) - Scale of gaussian noise
Returns:
pycbc.types.timeseries.TimeSeries - Time series containing coloured gaussian noise
Shifts data from the start to the center of a time series. Used in centering the initial 1/16 second long glitch signals.
Parameters:
data (np.array) - Array of data to center
Returns:
np.array - Centered data array
Calculates the frequency signal for a given set of parameters.
Parameters:
freqs (np.array) - Array of frequencies
f0 (float) - Central frequency
gbw (float) - Gamma or inverse bandwidth squared
Returns:
jnp.array - Frequency signal based on the input parameters
Generates a coloured glitch in the complex frequency domain.
Parameters:
amp (float) - Amplitude of glitch
phase (float) - Phase of glitch
f0 (float) - Central frequency of glitch
gbw (float) - ‘Gamma’ or inverse bandwidth squared of glitch
psd (pycbc.types.frequencyseries.FrequencySeries) - PSD to colour glitch
Returns:
jaxlib.xla_extension.ArrayImpl - Complex spectrum of glitch
Generates coloured and windowed glitch time series centered around zero.
Parameters:
amp (float) - Amplitude of glitch
phase (float) - Phase of glitch
f0 (float) - Central frequency of glitch
gbw (float) - ‘Gamma’ or inverse bandwidth squared of glitch
psd (pycbc.types.frequencyseries.FrequencySeries) - PSD to colour glitch
Returns:
np.array - 1/16 second long time series containing centered and windowed glitch
Generates a time series with arbitrary length and number of glitches with coloured, Gaussian noise.
Parameters:
ifo (string) - Interferometer abbreviation
run (string) - Observing run
params (list) - Nested list of glitch parameters [[amplitude, phase, central_freq, gbw], …]
duration (float) - Duration of noise in seconds
noise (np.array) - Time series of same duration containing coloured gaussian noise
gps (float) - Starting GPS time of time series
indexes (list) - Indexes of which parameters correspond to blips (blips get coloured with different PSDs)
Returns:
gwpy.timeseries.TimeSeries - h(t) with gaussian noise and glitches
Randomly generates glitch and parameters given central glitch time.
Parameters:
time (float) - Central time of glitch
probs (list) - List of probabilities of each type of glitch occurring (sum to one)
Returns:
list - List containing glitch parameters
string - Type of glitch generated
Generates number and location of glitches with Poissonian distribution.
Parameters:
mu (float) - Poisson rate parameter; average number of glitches per second
duration (float) - Duration of time series
interval (NoneType or float) - Optional interval of repeating glitches
Returns:
np.array - Central times of each glitch
Randomly generates glitch parameters with seed. This is used in deterministic generations.
Parameters:
glitch (string) - Name of short transient glitch
time (float) - Central time of glitch
suggest (bool) - Option to use suggested bounds on parameter distributions
seed (int) - Random seed
Returns:
list - list containing glitch parameters
float - value rounded to multiple of given rate