pyRing.NR_amp.
Amp_KHS
(eta, chi_eff)[source]¶Bases: object
QNM real amplitudes fitting functions for remnant BHs resulting from the coalescence of two non-precessing progenitors in a quasi-circular orbit. References: https://arxiv.org/abs/1207.0399, https://arxiv.org/abs/1406.3201.
pyRing.NR_amp.
Amp_MMRDNP
(eta, chi_s, chi_a, delta)[source]¶Bases: object
QNM complex amplitudes fitting functions for remnant BHs resulting from the coalescence of two non-precessing progenitors in a quasi-circular orbit. Reference: https://arxiv.org/abs/1801.08208.
pyRing.NR_amp.
Amp_MMRDNS
(eta)[source]¶Bases: object
QNM complex amplitudes fitting functions for remnant BHs resulting from the coalescence of two non-spinning progenitors in a quasi-circular orbit. Reference: https://github.com/llondon6/kerr_public/blob/master/kerr/formula/mmrdns_amplitudes.py (the ones in the original publication https://arxiv.org/abs/1404.3197 are not up to date).
pyRing.eob_utils.
Y
(double Y_0, double b_1, double b_2, double b_3, double c_1, double c_2, double c_3, double af, double af2, double af3)¶pyRing.inject_signal.
TEOBPM_injection
(**kwargs)[source]¶Create an injection using a TEOBPM waveform model.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – TEOBPM waveform model.
object
pyRing.inject_signal.
damped_sinusoids_injection
(**kwargs)[source]¶Create an injection using a damped sinusoid waveform model.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – Damped sinusoid waveform model.
object
pyRing.inject_signal.
inject_IMR_signal
(times, triggertime, ifo, print_output=True, **kwargs)[source]¶Create an IMR waveform model to be injected into the data.
times (array) – Array containing the times at which the waveform will be evaluated.
triggertime (float) – Time of the trigger.
ifo (string) – Name of the interferometer.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – IMR waveform model.
object
pyRing.inject_signal.
inject_ringdown_signal
(times, triggertime, ifo, print_output=True, **kwargs)[source]¶Main function to set an injection using one of the analytical ringdown templates available. Handles parameters common to all templates.
times (array) – Time axis of the data.
triggertime (float) – GPS time of the trigger.
ifo (str) – Name of the detector.
kwargs (dict) – Dictionary containing the parameters of the injection.
wave – Time series of the injected signal.
array
pyRing.inject_signal.
kerr_injection
(**kwargs)[source]¶Create an injection using a Kerr waveform model.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – Kerr waveform model.
object
pyRing.inject_signal.
khs_injection
(**kwargs)[source]¶Create an injection using a KHS waveform model.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – KHS waveform model.
object
pyRing.inject_signal.
load_injected_ra_dec
(triggertime, kwargs)[source]¶Load the sky position of the signal injection.
triggertime (float) – GPS time of the trigger.
kwargs (dict) – Dictionary containing the parameters of the injection.
ra (float) – Right ascension of the signal injection.
dec (float) – Declination of the signal injection.
pyRing.inject_signal.
mmrdnp_injection
(**kwargs)[source]¶Create an injection using a MMRDNP waveform model.
kwargs (dict) – Dictionary containing the parameters of the injection.
wf_model – MMRDNP waveform model.
object
pyRing.likelihood.
inner_product_direct_inversion
(ndarray vector1, ndarray vector2, ndarray inverse_covariance) → double¶Compute the inner product between two vectors using the inverse of the covariance matrix.
vector1 (array of shape (n,)) – The first vector.
vector2 (array of shape (n,)) – The second vector.
inverse_covariance (array of shape (n,n)) – The inverse of the covariance matrix.
inner_product – The inner product between the two vectors.
double
pyRing.likelihood.
loglikelihood
(model, x, waveform_model, double ra, double dec, double psi, double t_start, dict time_delay, unicode ref_det, int truncate, int duration_n, unsigned int OnsourceACF=0, unsigned int MaxEntPSD=0, unsigned int Dirac_comb=0, unsigned int Zeroing_data=0, unicode likelihood_method=u'direct-inversion', unsigned int split_inner_prod=0)¶pyRing.likelihood.
project
(ndarray hs, ndarray hvx, ndarray hvy, ndarray hp, ndarray hc, detector, double ra, double dec, double psi, tgps) → ndarray¶Compute the complex time series projected onto the given detector.
hs (array of shape (n,)) – The complex time series of the breathing mode.
hvx (array of shape (n,)) – The complex time series of the longitudinal mode in the x direction.
hvy (array of shape (n,)) – The complex time series of the longitudinal mode in the y direction.
hp (array of shape (n,)) – The complex time series of the plus polarization.
hc (array of shape (n,)) – The complex time series of the cross polarization.
detector (laldetector structure) – The detector.
ra (double) – The right ascension.
dec (double) – The declination.
psi (double) – The polarisation angle.
tgps (double) – The time (GPS seconds).
pyRing.likelihood.
residuals_inner_product_cholesky_solve_triangular
(ndarray residuals, ndarray cholesky) → double¶Compute the inner product between the residuals using the inverse of the covariance matrix through the scipy solve_triangular method, exploiting the Cholesky decomposition.
residuals (array of shape (n,)) – The residuals.
cholesky (array of shape (n,n)) – The Cholesky decomposition of the covariance matrix.
inner_product – The inner product between the residuals.
double
pyRing.likelihood.
residuals_inner_product_direct_inversion
(ndarray residuals, ndarray inverse_covariance) → double¶Compute the inner product between the residuals using the direct inverse of the covariance matrix.
residuals (array of shape (n,)) – The residuals.
inverse_covariance (array of shape (n,n)) – The inverse of the covariance matrix.
inner_product – The inner product between the residuals.
double
pyRing.likelihood.
residuals_inner_product_toeplitz_inversion
(ndarray residuals, ndarray acf) → double¶Compute the inner product between the residuals using the inverse of the covariance matrix through the scipy solve_toeplitz method.
residuals (array of shape (n,)) – The residuals.
acf (array of shape (n,)) – The autocorrelation function of the residuals.
inner_product – The inner product between the residuals.
double
pyRing.likelihood.
toeplitz_slogdet
(ndarray r) → tuple¶Method from Marano et al. “Fitting Earthquake Spectra: Colored Noise and Incomplete Data”, Bulletin of the Seismological Society of America, Vol. 107, No. 1, pp. –, February 2017, doi: 10.1785/0120160030 Code available here: http://mercalli.ethz.ch/~marra/publications/2017_fitting_earthquake_spectra_colored_noise_and_incomplete_data/ All credits go to the original authors.
Compute the log determinant of a positive-definite symmetric toeplitz matrix. The determinant is computed recursively. The intermediate solutions of the Levinson recursion are exploited.
r (array of shape (n,)) – The first row of the Toeplitz matrix.
sign – Sign of the determinant
logdet – Natural log of the determinant
pyRing.likelihood.
vector_module
(ndarray X) → double¶Compute the module of a vector.
X (array of shape (n,)) – The vector.
module – The module of the vector.
double
pyRing.noise.
UNCHECKED_acf_finite
(y, k)[source]¶Estimate directly from the data y Weighting by 1/(N-i) for lag i where N=len(y) k specifies the desired size of the ACF, i.e. the number of samples in the on-source segment.
- y: numpy array
Array of data.
- k: int
Number of samples in the on-source segment.
- R: numpy array
Array of ACF values.
pyRing.noise.
UNCHECKED_acf_from_ideal_psd
(ASDtxtfile, fmin, srate, T)[source]¶Build the ACF from an ideal PSD.
ASDtxtfile (string) – Path to the file containing the ASD.
fmin (float) – Minimum frequency of the PSD.
srate (float) – Sampling rate of the ACF.
T (float) – Length of the ACF.
lag (numpy array) – Array of lags.
R (numpy array) – Array of ACF values.
pyRing.noise.
UNCHECKED_estimated_acf
(x)[source]¶Estimate ACF directly from the data.
x (numpy array) – Array of data.
r – Array of ACF values.
numpy array
pyRing.noise.
acf
(y, fft=True, simple_norm=False)[source]¶Returns the autocorrelation function (ACF): R[i] = sum_n x[n]*x[n+i], in the form of an array spanned by the index i.
Computes the ACF using either the standard correlation (with the appropriate normalisation) or the fft method. The latter simply exploits the fact that the ACF is a convolution product and that the Fourier transform of a a convolution product is a product in the Fourier domain, see section ‘Efficient computation’ of ‘https://en.wikipedia.org/wiki/Autocorrelation#cite_note-3.
The difference between the two methods is in the treatment of boundary terms. When computing the ACF using the standard correlation, we ‘slide’ the data vector against a delayed copy of itself, obtaining the correlation at different lags. For all lags except lag=0, part of the ‘slided’ vector will spill over the boundaries of the fixed vector. In this method, terms outside the vectors boundaries are assigned zeros. This implies that for increasing lag, an increasingly smaller number of terms will contribute, and the variance of large-lag terms grow. Also, the ACF will eventually go to zero, when the maximum lag is reached. When employing the fft method instead, the data are windowed at the boundaries to avoid Gibbs phenomena, and periodic boundary conditions are assumed when applying the Fourier transform, implying a different structure for large lags.
For small lags (compared to the total length of the vector), the portion of the sum which dependent on boundary terms will be small, since the vectors still possess a significant overlap, and the specific method used should not matter (if gaussianity and stationarity assumptions are respected). For this reason, the length of the data on which the ACF is estimated, should always be much larger than the analysis segment length.
y (numpy array) – The data vector.
fft (bool) – Whether to use the fft method.
simple_norm (bool) – Whether to use the simple normalization (1/N) or the standard normalization (1/(N-lag)).
acf_normed – The normalized ACF.
numpy array
pyRing.noise.
add_injection
(on_source_times, on_source_strain, triggertime, ifo, kwargs)[source]¶Add an injection to the data.
on_source_times (numpy array) – The times of the on-source data.
on_source_strain (numpy array) – The on-source strain data.
triggertime (float) – The time of the trigger.
ifo (string) – The interferometer in which the signal is injected.
kwargs (dictionary) – The dictionary of keyword arguments.
on_source_strain – The on-source strain data including the injection.
numpy array
pyRing.noise.
bandpass_data
(rawstrain, f_min_bp, f_max_bp, srate_dt, bandpassing_flag)[source]¶Bandpass the raw strain between [f_min, f_max] Hz.
rawstrain (numpy array) – The raw strain data.
f_min_bp (float) – The lower frequency of the bandpass filter.
f_max_bp (float) – The upper frequency of the bandpass filter.
srate_dt (float) – The sampling rate of the data.
bandpassing_flag (bool) – Whether to apply bandpassing or not.
strain – The bandpassed strain data.
numpy array
pyRing.noise.
check_Plancherel_ratio
(psd_window_norm, df_welch, psd_welch, dt, ACF, debug)[source]¶This function checks if the Plancherel theorem is verified by our ACF estimate, by using the fact that twice the Fourier transform of the ACF = one-sided PSD (approximately, in the truncated case). Since the psd is the one-sided, we only stored positive values, but Plancherel theorem must be evaluated on both positive and negative frequencies. Also, need to take into account the fact that the window absorbed some power.
psd_window_norm (float) – Normalization factor for the window.
df_welch (float) – Frequency resolution of the PSD estimate.
psd_welch (1D numpy array) – PSD estimate.
dt (float) – Time resolution of the ACF estimate.
ACF (1D numpy array) – ACF estimate.
debug (boolean) – If True, it prints additional information.
Nothing. It just prints the Plancherel theorem ratio E(f)/E(t) (expected value
~1)
pyRing.noise.
check_chunksizes_consistency
(signal_chunk_size, noise_chunk_size, truncate)[source]¶Check the consistency of the chunksizes.
signal_chunk_size (int) – The size of the signal chunk.
noise_chunk_size (int) – The size of the noise chunk.
truncate (bool) – Whether to truncate the data.
pyRing.noise.
check_consistency_loading_options
(ifo_datafile, download_data_flag, kwargs)[source]¶Check that the options passed for data loading are consistent.
ifo_datafile (str) – Path to the data file to be loaded.
download_data_flag (bool) – Flag to download data from the data server.
kwargs (dict) – Dictionary of options passed to the script.
Nothing, it just raises an error if the options are not consistent.
pyRing.noise.
check_covariance_matrix_inversion_stability
(Covariance_matrix_signal, debug, tolerance=100000000000000.0)[source]¶This function checks the stability of the covariance matrix inversion, by computing its conditioning number. If the latter is larger than a certain user-specified tolerance, it raises a warning.
Covariance_matrix_signal (2D numpy array) – Covariance matrix of the signal.
debug (boolean) – If True, it prints additional information.
tolerance (float) – Tolerance for the conditioning number of the covariance matrix. If the conditioning number is larger than this value, it raises a warning.
Nothing. It just raises a warning if the covariance matrix is not well conditioned.
pyRing.noise.
check_data_gaussianity
(times, data, Covariance, signal_seglen, trigger_time, string_output, outdir)[source]¶This function checks if the data are Gaussian, by computing the ACF and the reduced chisquare of the ACF estimate.
times (1D numpy array) – Time array.
data (1D numpy array) – Data array.
Covariance (2D numpy array) – Covariance matrix.
signal_seglen (float) – Signal segment length.
trigger_time (float) – Trigger time.
string_output (string) – Output string.
outdir (string) – Output directory.
Nothing. It just plots the whitened data against a normal distribution, to visually check gaussianity.
pyRing.noise.
check_sampling_rate_compatibility
(requested_sampling_rate, data_sampling_rate)[source]¶Check that the requested sampling rate is not higher than the data sampling rate. Raise a error otherwise.
requested_sampling_rate (float) – The requested sampling rate.
data_sampling_rate (float) – The sampling rate of the input data.
Nothing, but raises a ValueError if the requested sampling rate is higher than the data sampling rate.
pyRing.noise.
check_seglen_compatibility
(signal_chunk_size, noise_chunk_size, T)[source]¶Check that the noise and signal chunk sizes are shorter than the data duration. Raise a error otherwise.
signal_chunk_size (float) – The requested signal chunk size.
noise_chunk_size (float) – The requested noise chunk size.
Nothing, but raises a ValueError if the requested sampling rate is higher than the data sampling rate.
pyRing.noise.
chisquare_computation
(ACF, chisquare_flag)[source]¶This function computes the reduced chisquare of the ACF estimate, and prints it.
ACF (1D numpy array) – ACF estimate.
chisquare_flag (boolean) – If True, it computes the reduced chisquare of the ACF estimate.
Nothing. It just prints the reduced chisquare of the ACF estimate.
pyRing.noise.
chunks
(times, strain, chunksize, trigger_time)[source]¶Divide the data in chunks. Skip the 0th and the last chunks which have filter ringing from downsampling.
times (numpy array) – The times of the data.
strain (numpy array) – The strain data.
chunksize (int) – The size of the chunks.
trigger_time (float) – The time of the trigger.
time_chunks_list (numpy array) – The times of the chunks.
data_chunks_list (numpy array) – The data of the chunks.
index_trig (int) – The index of the trigger time.
pyRing.noise.
chunks_iterator
(times, strain, chunksize, avoid=None, window=False, alpha=0.1)[source]¶Divide the data in chunks. Skip the 0th and the last chunks which have filter ringing from downsampling.
times (numpy array) – The times of the data.
strain (numpy array) – The strain data.
chunksize (int) – The size of the chunks.
avoid (float) – The time to avoid.
window (bool) – Whether to apply a window to the data.
alpha (float) – The alpha parameter of the Tukey window.
strain – The strain data.
numpy array
pyRing.noise.
compute_Welch_PSD
(off_source_strain, srate, noise_seglen, psd_window)[source]¶Compute the one-sided PSD with the Welch method.
off_source_strain (numpy array) – The off-source strain.
srate (float) – The sampling rate.
noise_seglen (int) – The length of the noise segments.
psd_window (str) – The window to use for the PSD estimation.
psd_welch (numpy array) – The one-sided PSD.
freqs_welch (numpy array) – The frequencies associated to the PSD.
df_welch (float) – The PSD frequency resolution.
pyRing.noise.
compute_acf_and_whitening_psd
(times, strain, starttime, T, srate, triggertime, index_trigtime, dt, window_flag, alpha_window, noise_chunk_size, noise_seglen, signal_seglen, f_min_bp, f_max_bp, fft_acf, freqs_welch, psd_welch, ifo, kwargs)[source]¶Compute the ACF and the whitening PSD.
times (numpy array) – The times of the data.
strain (numpy array) – The strain data.
starttime (float) – The start time of the data.
T (float) – The duration of the data.
srate (float) – The sampling rate.
triggertime (float) – The trigger time.
index_trigtime (int) – The index of the trigger time.
dt (float) – The time resolution.
window_flag (bool) – Whether to apply a window to the data.
alpha_window (float) – The alpha parameter of the Tukey window.
noise_chunk_size (int) – The size of the noise chunks.
noise_seglen (int) – The length of the noise segments.
signal_seglen (int) – The length of the signal segments.
f_min_bp (float) – The minimum frequency of the bandpass filter.
f_max_bp (float) – The maximum frequency of the bandpass filter.
fft_acf (bool) – Whether to use the fft method to compute the ACF.
freqs_welch (numpy array) – The frequencies associated to the PSD.
psd_welch (numpy array) – The one-sided PSD.
ifo (str) – The interferometer.
kwargs (dict) – The dictionary of keyword arguments.
acf (numpy array) – The ACF.
acf_normed (numpy array) – The normalized ACF.
psd (numpy array) – The one-sided PSD.
freqs (numpy array) – The frequencies associated to the PSD.
df (float) – The PSD frequency resolution.
pyRing.noise.
compute_maxent_PSD
(times, strain, starttime, T, srate, triggertime, index_trigtime, dt, alpha_window, window_flag, noise_seglen, signal_seglen, fft_acf, freqs_welch, psd_welch, ifo, kwargs)[source]¶Compute the one-sided average PSD with the MESA method. Currently not used.
times (array) – The time axis of the data.
strain (array) – The data to be analysed.
starttime (float) – The start time of the data.
T (float) – The duration of the data.
srate (float) – The sampling rate of the data.
triggertime (float) – The time of the signal injection.
index_trigtime (int) – The index of the time of the signal injection.
dt (float) – The time step of the data.
alpha_window (float) – The alpha parameter of the Tukey window.
window_flag (string) – The windowing function to be used.
noise_seglen (int) – The length of the noise segments.
signal_seglen (int) – The length of the signal segments.
fft_acf (bool) – Whether the ACF is computed in the time or frequency domain.
freqs_welch (array) – The frequencies at which the Welch PSD is evaluated.
psd_welch (array) – The one-sided Welch PSD.
ifo (string) – The detector name.
kwargs (dict) – The dictionary of the input parameters.
freqs_maxent (array) – The frequencies at which the PSD is evaluated.
psd_maxent (array) – The one-sided average PSD.
pyRing.noise.
compute_on_off_source_strain
(times, strain, signal_seglen, index_trigtime)[source]¶Compute the on-source and off-source strain data.
times (numpy array) – The times of the data.
strain (numpy array) – The strain data.
signal_seglen (int) – The length of the signal segment.
index_trigtime (int) – The index of the trigger time.
on_source_strain (numpy array) – The on-source strain data.
on_source_times (numpy array) – The on-source times.
on_source_mask (numpy array) – The on-source mask.
off_source_strain (numpy array) – The off-source strain data.
off_source_times (numpy array) – The off-source times.
off_source_mask (numpy array) – The off-source mask.
pyRing.noise.
download_data
(ifo, triggertime, kwargs)[source]¶Download data from the data server.
ifo (str) – Name of the interferometer.
triggertime (float) – GPS time of the trigger.
kwargs (dict) – Dictionary of options passed to the script.
starttime (float) – GPS start time of the data downloaded.
dt (float) – Time step of the data downloaded.
srate_dt (float) – Sampling rate of the data downloaded.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
download_data_with_gwdatafind
(ifo, starttime, endtime, channel, kwargs)[source]¶Download data from the data server using gwdatafind.
ifo (str) – Name of the interferometer.
starttime (float) – GPS start time of the data to be downloaded.
endtime (float) – GPS end time of the data to be downloaded.
channel (str) – Name of the channel to be downloaded.
kwargs (dict) – Dictionary of options passed to the script.
tseries – Time series of the data downloaded.
gwpy.timeseries.TimeSeries
pyRing.noise.
download_data_with_gwpy
(ifo, starttime, endtime, channel, kwargs)[source]¶Download data from the data server using gwpy.
ifo (str) – Name of the interferometer.
starttime (float) – GPS start time of the data to be downloaded.
endtime (float) – GPS end time of the data to be downloaded.
channel (str) – Name of the channel to be downloaded.
kwargs (dict) – Dictionary of options passed to the script.
tseries – Time series of the data downloaded.
gwpy.timeseries.TimeSeries
pyRing.noise.
downsample_data
(strain, srate, srate_dt)[source]¶Downsample the data to the requested sampling rate.
strain (numpy array) – The strain data.
srate (float) – The requested sampling rate.
srate_dt (float) – The sampling rate of the data.
strain (numpy array) – The downsampled strain data.
dt (float) – The new sampling rate.
pyRing.noise.
excise_nans_from_strain
(rawstrain, starttime, T, triggertime, signal_chunk_size, dt, ifo_datafile, download_data_flag)[source]¶If there are nans in the data, resize the strain to the longest segment which contains no nans.
rawstrain (numpy array) – The strain data (possibly containing nans).
starttime (float) – The start time of the data.
T (float) – The duration of the data.
triggertime (float) – The time of the trigger.
signal_chunk_size (float) – The duration of the on-source chunk.
dt (float) – The sampling time of the data.
ifo_datafile (string) – The path to the data file of a given ifo.
download_data_flag (boolean) – Flag to download the data from the LVK server.
rawstrain (numpy array) – The updated strain data after nans removal.
starttime (float) – The updated start time of the data after nans removal.
T (float) – The updated duration of the data after nans removal.
pyRing.noise.
fetch_data
(ifo, tstart, tend, channel=None, path=None, verbose=0)[source]¶Fetch data from the data server.
ifo (str) – Name of the interferometer.
tstart (float) – GPS start time of the data to be downloaded.
tend (float) – GPS end time of the data to be downloaded.
channel (str) – Name of the channel to be read from frame data. If ‘GWOSC’ will fetch open data.
path (str) – Path to the data file to be loaded. If the file already exists locally, it will be read from disk rather than fetched from the data server.
verbose (int) – Verbosity level.
tseries – Time series of the data downloaded.
gwpy.timeseries.TimeSeries
pyRing.noise.
generate_coloured_gaussian_noise
(ifo, srate, dt, T, kwargs)[source]¶Generate coloured gaussian noise.
ifo (str) – Name of the interferometer.
srate (float) – Sampling rate of the data.
dt (float) – Time step of the data.
T (float) – Duration of the data.
kwargs (dict) – Dictionary containing the input arguments.
noise_strain – Array of the data downloaded.
numpy.ndarray
pyRing.noise.
generate_coloured_gaussian_noise_from_acf_file
(acf_file)[source]¶Generate coloured gaussian noise from an ACF file.
acf_file (str) – Name of the file containing the ACF.
noise_strain – Array of the data downloaded.
numpy.ndarray
pyRing.noise.
generate_coloured_gaussian_noise_from_psd_file
(psd_file, srate, dt, T, kwargs)[source]¶Generate coloured gaussian noise from a PSD file.
psd_file (str) – Name of the file containing the PSD.
noise_strain – Array of the data downloaded.
numpy.ndarray
pyRing.noise.
generate_gaussian_noise
(ifo, triggertime, srate, kwargs)[source]¶Generate gaussian noise.
ifo (str) – Name of the interferometer.
triggertime (float) – GPS time of the trigger.
srate (float) – Sampling rate of the data.
kwargs (dict) – Dictionary of options passed to the script.
starttime (float) – GPS start time of the data downloaded.
dt (float) – Time step of the data downloaded.
srate_dt (float) – Sampling rate of the data downloaded.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
generate_white_gaussian_noise
(sigma, srate, T)[source]¶Generate white gaussian noise.
sigma (float) – Standard deviation of the noise.
srate (float) – Sampling rate of the data.
T (float) – Duration of the data.
noise_strain – Array of the data downloaded.
numpy.ndarray
pyRing.noise.
load_data
(ifo, fname, **kwargs)[source]¶Main function to read the data (from file or downloads it using gwpy), computing the ACF (either from the data or from given file input ACF/PSD) and inject a template if requested.
ifo (str) – Name of the interferometer.
fname (str) – Name of the file containing the data.
kwargs (dict) – Dictionary containing the input arguments.
Work in progress.
pyRing.noise.
mem_psd
(data, srate, optimisation_method='FPE')[source]¶Compute the one-sided average PSD with the MESA method. Currently not used.
data (array) – The data to be analysed.
srate (float) – The sampling rate of the data.
optimisation_method (string) – The method used to optimise the PSD. Can be “FPE” or “AIC”.
freqs (array) – The frequencies at which the PSD is evaluated.
psd (array) – The one-sided average PSD.
pyRing.noise.
non_stationarity_check
(acfs, dt)[source]¶Check if there is any trend in PSD evolution.
acfs (list of numpy arrays) – List of autocorrelation functions.
dt (float) – Time step of the autocorrelation functions.
Nothing, but it plots the PSD evolution and prints the number of non-stationary bins.
pyRing.noise.
read_data_from_GWOSC_file
(fname, ifo, kwargs)[source]¶Read data from a GWOSC file.
fname (str) – Name of the file containing the data. The file name is expected to follow GWOSC conventions ‘DET-FRAMETYPE-STARTTIME–DATALEN.txt’, e.g.: ‘H-H1_GWOSC_4_V1-1126259446-32.txt’. See https://www.gw-openscience.org for more infomation. This requirement can be relaxed by activating the ‘ignore-data-filename’ option.
ifo (str) – Name of the interferometer.
kwargs (dict) – Dictionary containing the input arguments.
starttime (float) – Start time of the data.
dt (float) – Time step of the data.
T (float) – Duration of the data.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
read_data_from_custom_file
(fname)[source]¶Read data from a custom file.
fname (str) – Name of the file containing the data.
starttime (float) – Start time of the data.
dt (float) – Time step of the data.
T (float) – Duration of the data.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
read_data_from_file
(fname, ifo, kwargs)[source]¶Read data from a file.
fname (str) – Name of the file containing the data.
ifo (str) – Name of the interferometer.
kwargs (dict) – Dictionary containing the input arguments.
starttime (float) – Start time of the data.
dt (float) – Time step of the data.
srate_dt (float) – Sampling rate of the data.
T (float) – Duration of the data.
rawstrain (numpy.ndarray) – Array of the data.
pyRing.noise.
read_data_from_gwf_file
(fname, ifo, kwargs)[source]¶Read data from a gwf file.
fname (str) – Name of the file containing the data.
ifo (str) – Name of the interferometer.
kwargs (dict) – Dictionary containing the input arguments.
starttime (float) – Start time of the data.
T (float) – Duration of the data.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
read_data_from_txt_file
(fname)[source]¶Read data from a txt file.
fname (str) – Name of the file containing the data.
starttime (float) – Start time of the data.
T (float) – Duration of the data.
rawstrain (numpy.ndarray) – Array of the data downloaded.
pyRing.noise.
resize_nan_strain
(strain, start_time, trig_time, onsource_length, dt)[source]¶Resize the strain to the longest segment which contains no nans.
strain (numpy array) – The strain data (possibly containing nans).
start_time (float) – The start time of the data.
trig_time (float) – The time of the trigger.
onsource_length (float) – The duration of the on-source chunk.
dt (float) – The sampling time of the data.
strain (numpy array) – The updated strain data after nans removal.
start_time (float) – The updated start time of the data after nans removal.
T (float) – The updated duration of the data after nans removal.
pyRing.noise.
set_random_seed
(user_seed, ifo)[source]¶Set the random seed used for generating the noise for injections in different detectors.
user_seed (int) – The user seed.
ifo (str) – The detector.
pyRing.noise.
window_onsource_strain
(on_source_strain, signal_seglen, noise_seglen, window_onsource_flag, window_flag, alpha_window, truncate)[source]¶Apply a window to the on-source strain data.
on_source_strain (numpy array) – The on-source strain data.
signal_seglen (int) – The length of the signal segment.
noise_seglen (int) – The length of the noise segment.
window_onsource_flag (bool) – Whether to apply a window to the on-source strain data.
window_flag (bool) – Whether to apply a window to the data.
alpha_window (float) – The alpha parameter of the Tukey window.
truncate (bool) – Whether to truncate the data.
on_source_strain – The on-source strain data.
numpy array
pyRing.plots.
FindHeightForLevel
(inArr, adLevels)[source]¶Function to find the height of a contour line in a 2D array.
inArr (array) – 2D array of values.
adLevels (array) – Array of levels.
adHeights – Array of heights.
array
pyRing.plots.
Kerr_Newman_intrinsic_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters of the Kerr-Newman model.
x (array) – Array containing the samples of the intrinsic parameters of the Kerr-Newman model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
Kerr_intrinsic_alpha_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters of the final Kerr black hole when including the alpha area quantisatio parameter.
x (dictionary) – Dictionary containing the samples of the intrinsic parameters of the final Kerr black hole.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
Kerr_intrinsic_braneworld_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters of the final Kerr black hole when including the braneworld parameters.
x (dictionary) – Dictionary containing the samples of the intrinsic parameters of the final Kerr black hole.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
Kerr_intrinsic_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters of the final Kerr black hole.
x (dictionary) – Dictionary containing the samples of the intrinsic parameters of the final Kerr black hole.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
MMRDNP_amplitude_parameters_corner
(x, **input_par)[source]¶Create the corner plot of the amplitude parameters for the MMRDNP model.
x (dictionary) – Dictionary containing the samples of the amplitude parameters for the MMNRDNP model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
MMRDNP_intrinsic_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters for the MMRDNP model.
x (dictionary) – Dictionary containing the samples of the amplitude parameters for the MMNRDNS model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
MMRDNS_intrinsic_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters for the MMRDNS model.
x (dictionary) – Dictionary containing the samples of the intrinsic parameters of the final Kerr black hole.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the corner plot in the output directory.
pyRing.plots.
Mf_af_plot
(samples, Mf_LAL_samples, af_LAL_samples, **input_par)[source]¶Create the plot of the final mass and spin and compare them to IMR samples.
samples (array) – Array containing the samples of final mass and spin.
Mf_LAL_samples (array) – Array containing the samples of the final mass of the IMR model.
af_LAL_samples (array) – Array containing the samples of the final spin of the IMR model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
Mf_af_plot_old
(samples, Mf_LAL_samples, af_LAL_samples, **input_par)[source]¶Create the plot of the final mass and spin and compare them to IMR samples.
samples (array) – Array containing the samples of final mass and spin.
Mf_LAL_samples (array) – Array containing the samples of the final mass of the IMR model.
af_LAL_samples (array) – Array containing the samples of the final spin of the IMR model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
SNR_plots
(get_waveform, dets, fixed_params, tgps, params=None, **kwargs)[source]¶Plot the SNR of the network and of each detector.
get_waveform (function) – Function that returns the waveform model.
dets (dict) – Dictionary of detectors.
fixed_params (dict) – Dictionary of fixed parameters.
tgps (float) – GPS time of the event.
params (dict) – Dictionary of parameters sampled on.
kwargs (dict) – Dictionary of keyword arguments.
Nothing, but creates the SNR plots.
pyRing.plots.
TEOBPM_intrinsic_corner
(x, **input_par)[source]¶Create the corner plot of the intrinsic parameters of the TEOBPM model.
x (array) – Array containing the samples of the intrinsic parameters of the TEOBPM model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
TEOBPM_masses_spins_corner
(x, **input_par)[source]¶Create the corner plot of the progenitors masses and spins of the TEOBPM model.
x (array) – Array containing the samples of the intrinsic parameters of the TEOBPM model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
UNUSED_noise_evidence_density
(t0_samples, noise_model)[source]¶Compute the noise evidence density for a given set of t0 samples.
t0_samples (array) – Array of t0 samples.
noise_model (NoiseModel object) – Noise model object.
logZnoise – Array of logZnoise values for each t0 sample.
array
pyRing.plots.
amplitudes_corner
(x, **input_par)[source]¶Create the corner plot of the amplitude parameters.
x (dictionary) – Dictionary containing the samples of the amplitude parameters.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
compare_damped_sinusoids_with_QNM_predictions
(samples_x, Mf_IMR, af_IMR, Num_mode, probs_flag=1, scatter_samples_flag=1, delta_QNM_plots=0, predictions_contour_flag=0, **kwargs)[source]¶Plot the posterior distributions of the QNM frequencies and damping times, and compare them to the GR prediction coming from an IMR analysis (if IMR posterior is available).
samples_x (dictionary) – Dictionary of samples.
Mf_IMR (array) – Array of final masses used to compute the GR predicition.
af_IMR (array) – Array of final spins used to compute the GR predicition.
Num_mode (int) – Number of free damped sinusoids considered.
probs_flag (int) – Flag to plot the probabilities of identifying a given damped-sinusoid with GR-predicted QNMs.
scatter_samples_flag (int) – Flag to plot the scatter of the samples.
delta_QNM_plots (int) – Flag to plot the difference between the QNM parameters and the GR prediction.
predictions_contour_flag (int) – Flag to plot the contours of the GR prediction.
kwargs (dictionary) – Dictionary of keyword arguments.
Nothing, but saves plots to the output directory.
pyRing.plots.
f_tau_amp_corner
(x, **input_par)[source]¶Create the corner plot of the frequency, damping time and amplitude parameters.
x (dictionary) – Dictionary containing the samples of the frequency, damping time and amplitude parameters.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
get_param_override
(fixed_params, x, name)[source]¶Returns x[name], unless it is over-ridden by value in the fixed_params dictionary.
fixed_params (dict) – Dictionary of fixed parameters.
x (dict) – Dictionary of samples.
name (str) – Name of the parameter.
Either x[name] or fixed_params[name]
pyRing.plots.
global_corner
(x, names, output, truths=None)[source]¶Create a corner plot of all parameters.
x (dictionary) – Dictionary of parameters.
names (list) – List of parameter names.
output (string) – Output directory.
Nothing, but saves a corner plot to the output directory.
pyRing.plots.
init_plotting
()[source]¶Function to set the default plotting parameters.
None –
Nothing, but sets the default plotting parameters.
pyRing.plots.
insp_par_Mf_af_plot
(x, **input_par)[source]¶Create the plot of the final mass and final spin for models that are parameterised using binary parameters.
x (dictionary) – Dictionary containing the samples of the amplitude parameters for the MMNRDNP model.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
mode_corner
(samples, filename=None, **kwargs)[source]¶Create a corner plot of the QNM parameters.
samples (array) – Array of samples.
filename (string) – Name of the file to save the plot to.
kwargs (dictionary) – Dictionary of keyword arguments.
fig – Figure object.
figure
pyRing.plots.
omega_tau_eff_plot
(x, **kwargs)[source]¶Create the plot of the effective frequency and damping time.
x (array) – Array containing the samples of the intrinsic parameters of the TEOBPM model.
kwargs (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
orientation_corner
(x, Config, **input_par)[source]¶Create the corner plot of the orientation parameters.
x (dictionary) – Dictionary containing the samples of the orientation parameters.
Config (configparser object) – Configparser object containing the configuration of the run.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.plots.
plot_ACF
(time, acf, label, output_path)[source]¶Plot the ACF of the data.
time (array) – Time array.
acf (array) – ACF array.
label (str) – Label of the plot.
output_path (str) – Path to the output file.
Nothing, but it saves the plot in the output_path.
pyRing.plots.
plot_ACF_compare
(time1, acf1, label1, time2, acf2, label2, output_path)[source]¶Plot two different ACF estimates to compare them.
time1 (array) – Time array of the first ACF.
acf1 (array) – ACF array of the first ACF.
label1 (str) – Label of the first ACF.
time2 (array) – Time array of the second ACF.
acf2 (array) – ACF array of the second ACF.
label2 (str) – Label of the second ACF.
output_path (str) – Path to the output file.
Nothing, but it saves the plot in the output_path.
pyRing.plots.
plot_NR_single_mode
(t_geom, hr_geom, hi_geom, **kwargs)[source]¶Plot the NR waveform in the time domain for a single mode.
t_geom (array) – Time array in geometric units.
hr_geom (array) – Real part of the waveform in geometric units.
hi_geom (array) – Imaginary part of the waveform in geometric units.
kwargs (dict) – Dictionary of keyword arguments.
Nothing, but saves the waveform plot to the output directory.
pyRing.plots.
plot_PSD
(freqs, psd, label, output_path)[source]¶Plot the PSD of the data.
freqs (array) – Frequency array.
psd (array) – PSD array.
label (str) – Label of the plot.
output_path (str) – Path to the output file.
Nothing, but it saves the plot in the output_path.
pyRing.plots.
plot_PSD_compare
(freqs1, psd1, label1, freqs2, psd2, label2, output_path)[source]¶Plot two different PSD estimates to compare them.
freqs1 (array) – Frequency array of the first PSD.
psd1 (array) – PSD array of the first PSD.
label1 (str) – Label of the first PSD.
freqs2 (array) – Frequency array of the second PSD.
psd2 (array) – PSD array of the second PSD.
label2 (str) – Label of the second PSD.
output_path (str) – Path to the output file.
Nothing, but it saves the plot in the output_path.
pyRing.plots.
plot_contour
(samples_stacked, level=[0.9], linest='dotted', label=None, color='k', line_w=1.2, plot_legend=1, zorder=None)[source]¶Function to plot a contour line.
samples_stacked (array) – Array of samples.
level (array) – Array of levels.
linest (str) – Linestyle.
label (str) – Label.
color (str) – Color.
line_w (float) – Line width.
plot_legend (int) – Plot legend.
zorder (int) – Zorder.
Nothing, but plots a contour line.
pyRing.plots.
plot_strain
(get_waveform, dets, fixed_params, tgps, params=None, whiten_flag=False, whiten_method='TD', strain_only=0, spectrum=0, logamp=0, **kwargs)[source]¶Function to plot the strain.
get_waveform (function) – Function to get the waveform.
dets (dict) – Dictionary of detectors.
fixed_params (dict) – Dictionary of fixed parameters.
tgps (float) – GPS time.
params (dict) – Dictionary of parameters.
whiten_flag (bool) – Whitening flag.
whiten_method (str) – Whitening method. Available options: [‘TD’, ‘FD’].
strain_only (int) – Strain only.
kwargs (dict) – Dictionary of keyword arguments.
Nothing, but plots the strain.
pyRing.plots.
read_Mf_af_IMR_posterior
(Config, **input_par)[source]¶Read the IMR posterior samples from the imr-samples entry of the Plot section of the configuration file, and return the median values of the mass and spin parameters.
Config (configparser.ConfigParser) – Configuration file parser.
input_par (dict) – Dictionary containing the input parameters.
Mf_d (float) – Median value of the final mass.
af_d (float) – Median value of the final spin.
pyRing.plots.
read_dataseries
(d, whiten_flag, detector, tevent, dt, whiten_method, mf_time_prior, timeseries_whitened_TD, duration_n, dt_dict, spectrum, **kwargs)[source]¶pyRing.plots.
read_waveforms
(params, fixed_params, get_waveform, dets, ref_det, tevent, sky_frame, whiten_method, whiten_flag, mf_time_prior, duration_n, tgps, dt, model_waveforms, dt_dict, timeseries_whitened_TD, spectrum, **kwargs)[source]¶pyRing.plots.
single_time_delay_plots
(dt_vec, **input_par)[source]¶Plot the time delay posterior distributions and chains for each detector pair.
dt_vec (dict) – Dictionary containing the time delay posterior distributions for each detector pair.
input_par (dict) – Dictionary containing the input parameters for the run.
Nothing. Plots are saved to the output directory.
pyRing.plots.
sky_location_plots
(x, Config, **input_par)[source]¶Plot the sky location posterior distributions and chains for each detector pair.
x (array) – Array containing the sky location posterior distributions for each detector pair.
Config (configparser object) – Configparser object containing the input parameters for the run.
input_par (dict) – Dictionary containing the input parameters for the run.
Nothing. Plots are saved to the output directory.
pyRing.plots.
t_start_plot
(t0_ds, Mf, **input_par)[source]¶Create the plot of the start time of the template.
t0_ds (array) – Array containing the samples of the start time of the template.
Mf (float) – Final mass of the system.
input_par (dictionary) – Dictionary containing the input parameters of the run.
Nothing, but saves the plot in the output directory.
pyRing.pyRing.
DampedSinusoids
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing a superposition of damped sinusoids as ringdown model. Frequency, damping time, amplitude and phase are sampled over for each mode.
pyRing.pyRing.
IMR_Ringdown_Model
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing a non-precessing ringdown model extracted from LAL IMR waveforms.
pyRing.pyRing.
KHS_2012Model
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing the KHS_2012 waveform as ringdown model (valid for spinning, non-precessing progenitors). Frequencies and damping times of the specified (l,m,n) modes are fixed as a function of the mass and spin of the remnant BH. Relative amplitudes and phases are fixed as a function of the symmetric mass ratio and effective spin. References: https://arxiv.org/abs/1207.0399, https://arxiv.org/abs/1406.3201
pyRing.pyRing.
KerrModel
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing a Kerr waveform as ringdown model. Frequencies and damping times of the specified (s,l,m,n) modes are fixed as a function of the mass and spin of the remnant BH. Relative amplitudes and phases of the modes are instead free to vary.
pyRing.pyRing.
LIGOVirgoModel
(**kwargs)[source]¶Bases: cpnest.model.Model
Parent class for all the models used in the package. Reads the data and sets sky position parameters common to all waveform models.
pyRing.pyRing.
MMRDNPModel
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing the MMRDNP waveform as ringdown model (valid for spinning, non-precessing progenitors). Reference: https://arxiv.org/pdf/1801.08208.pdf Technical notes: https://github.com/llondon6/kerr_public/blob/master/notes/ns/mmrd.pdf
pyRing.pyRing.
MMRDNSModel
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing the MMRDNS waveform as ringdown model (valid for non-spinning progenitors). Frequencies and damping times of the specified (l,m,n) modes are fixed as a function of the mass and spin of the remnant BH. Relative amplitudes and phases are fixed as a function of the symmetric mass ratio. Reference: https://arxiv.org/pdf/1404.3197.pdf
pyRing.pyRing.
MorletGaborWavelets
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing a superposition of Morlet-Gabor-wavelets as waveform model. Frequency, damping time, amplitude and phase are sampled over for each mode.
pyRing.pyRing.
RingDownModel
(**kwargs)[source]¶Bases: pyRing.pyRing.LIGOVirgoModel
Parent class for all ringdown models. Sets common time prior and likelihood.
pyRing.pyRing.
TEOBPMModel
(**kwargs)[source]¶Bases: pyRing.pyRing.RingDownModel
Class implementing the EOBPM waveform as post-merger model (valid for non-precessing progenitors). References: arXiv: 1406.0401, 1606.03952, 2001.09082.
pyRing.pyRing.
get_param_override
(fixed_params, x, name)[source]¶Returns x[name], unless it is over-ridden by value in the fixed_params dictionary.
pyRing.pyRing.
read_parameter_bounds
(Config, configparser, kwargs, name, default_bounds, approx_name, extra_polarisation=None)[source]¶Function reading the prior bounds for a given parameter. Either from the config file or from the default bounds.
Config (configparser.ConfigParser()) – ConfigParser object containing the config file.
configparser (configparser) – ConfigParser object.
kwargs (dict) – Dictionary containing the input arguments.
name (str) – Name of the parameter.
default_bounds (dict) – Dictionary containing the default bounds for the parameter.
approx_name (str) – Name of the waveform approximant.
extra_polarisation (tuple) – Tuple containing the polarisation and mode indices, if the parameter is a mode-dependent one.
single_bounds – List containing the prior bounds for the parameter.
list
pyRing.utils.
A_omg_mrg_TEOB
(m1, m2, a1, a2, version='spins', geom=0)[source]¶Amplitude and frequency at the peak of the 22 mode for quasicircular spin-aligned binaries.
Fits version: master/84b8f10 of bitbucket.org/eob_ihes/teobresums/commits/branch/master.
m1 (float) – Mass of the first black hole
m2 (float) – Mass of the second black hole
a1 (float) – Dimensionless spin of the first black hole
a2 (float) – Dimensionless spin of the second black hole
version (string) – Which type of fits to use.
geom (int) – Flag to activate geometrical units. Default is 0, SI units.
res – Merger frequency of the binary black hole system
float
pyRing.utils.
EsGB_corrections
(name, dim)[source]¶This function returns the coefficients of the Parspec expansion for the gravitational polar-led modes in the EdGB model.
name (str) – Name of the mode deviation.
dim (int) – Number of terms to be used in the Parspec expansion.
corr – Coefficients of the Parspec expansion for the gravitational polar-led modes in the EdGB model.
array
pyRing.utils.
EsGB_corrections_Carson_Yagi
(name)[source]¶This function returns the coefficients of the Parspec expansion for the gravitational polar-led modes in the EdGB model according to the Carson-Yagi prescription.
name (str) – Name of the mode deviation.
corr – Coefficients of the Parspec expansion for the gravitational polar-led modes in the EdGB model according to the Carson-Yagi prescription.
array
pyRing.utils.
F_mrg_Bohe
(m1, m2, a1, a2)[source]¶Computees the merger frequency fit as described in Bohe et al. arXiv:1611.03703
m1 (float) – Mass of the first black hole
m2 (float) – Mass of the second black hole
a1 (float) – Dimensionless spin of the first black hole
a2 (float) – Dimensionless spin of the second black hole
res – Merger frequency of the binary black hole system
float
pyRing.utils.
F_mrg_Healy
(m1, m2, a1, a2)[source]¶Computes the merger frequency fit as described in Healy et al. Phys. Rev. D 97, 084002(2018) This implementation uses the convention m1>m2 and thus has a sign differences in the definitions of dm and Delta comparing to the original paper.
m1 (float) – Mass of the first black hole
m2 (float) – Mass of the second black hole
a1 (float) – Dimensionless spin of the first black hole
a2 (float) – Dimensionless spin of the second black hole
res – Merger frequency of the binary black hole system
float
pyRing.utils.
F_mrg_Nagar
(m1, m2, a1, a2, geom=0)[source]¶This function returns the merger frequency of a binary black hole system, defined with respect to the peak of the 22 mode amplitude. The coefficients contained here are an update of Tab.1 of arxiv:1811.08744, generated by Gunnar Riemenschneider.
Newer versions (if existent) can be found in the TEOBResumS repository (bitbucket.org/eob_ihes/teobresums), e.g. the latest version on 27/11/2023 is here: https://bitbucket.org/eob_ihes/teobresums/src/83f260f43161fe360e08f495c8b540eec41d167b/C/src/TEOBResumSFits.c#lines-177
m1 (float) – Mass of the first black hole in solar mass units
m2 (float) – Mass of the second black hole in solar mass units
a1 (float) – Dimensionless spin of the first black hole
a2 (float) – Dimensionless spin of the second black hole
geom (int) – Flag to activate geometrical units. Default is 0, SI units.
res – Merger frequency of the binary black hole system
float
pyRing.utils.
F_mrg_Nagar_v0
(m1, m2, a1, a2)[source]¶This function returns the merger frequency of a binary black hole system. Old version of the merger frequency, defined with respect to the 22 mode of the inspiral.
m1 (float) – Mass of the first black hole
m2 (float) – Mass of the second black hole
a1 (float) – Dimensionless spin of the first black hole
a2 (float) – Dimensionless spin of the second black hole
res – Merger frequency of the binary black hole system
float
pyRing.utils.
UNUSED_NR_waveform
(**kwargs)[source]¶Bases: object
Class to generate NR waveforms.
object (object) – Object to be used.
pyRing.utils.
UNUSED_inject_NR_signal
(lenstrain, tstart, length, ifo, triggertime, **kwargs)[source]¶Inject a NR signal into the data. The NR signal is generated using the FIXME
lenstrain (int) – Length of the strain data vector
tstart (float) – Start time of the data
length (float) – Length of the data
ifo (str) – Detector name
triggertime (float) – GPS time of the trigger
**kwargs (dict) – Dictionary of keyword arguments
hplus (numpy.ndarray) – Plus polarization of the NR signal
hcross (numpy.ndarray) – Cross polarization of the NR signal
pyRing.utils.
bandpass_around_ringdown
(strain, dt, f_min, mf, alpha_window=0.1)[source]¶This function bandpasses the strain around the ringdown frequency of the BH.
strain (array) – Strain time series.
dt (float) – Time step of the strain time series.
f_min (float) – Minimum frequency of the bandpass.
mf (float) – Final mass of the BH.
alpha_window (float) – Tukey window parameter.
strain – Bandpassed strain time series.
array
pyRing.utils.
check_NR_dir
()[source]¶This function checks if the directory LVC-NR waveforms is present.
None. –
Nothing, but raises an exception if the directory is not present.
pyRing.utils.
chi_eff
(q, a1, a2)[source]¶This function returns the effective spin of a binary system as a function of the mass ratio and the spins of the components. Note: in the equal mass case, eta=0.25, implying chi_1=chi_2=0.5. Hence, in this case, chi_eff is the aritmetic mean of (a1,a2).
q (float) – Mass ratio of the binary system.
a1 (float) – Spin of the first component of the binary system.
a2 (float) – Spin of the second component of the binary system.
chi_eff – Effective spin of the binary system.
float
pyRing.utils.
cholesky_logdet_C
(covariance)[source]¶Compute the log determinant of a covariance matrix using Cholesky decomposition.
covariance (array) – Covariance matrix.
logdet – Log determinant of the covariance matrix.
float
pyRing.utils.
compute_SNR_FD
(data, template, psd, df)[source]¶This function computes the SNR between a data frequency series and a template frequency series in the frequency domain.
data (array) – Data frequency series.
template (array) – Template frequency series.
psd (array) – PSD.
df (float) – Frequency step of the frequency series.
SNR – SNR of the template in the given data.
float
pyRing.utils.
compute_SNR_TD
(data, template, weights, method='direct-inversion')[source]¶This function computes the SNR between a data time series and a template time series in the time domain, using various methods.
data (array) – Data time series.
template (array) – Template time series.
weights (array) – Weights to be used in the inner product. In the case of the time domain, this can be the inverse covariance matrix (for the ‘direct-inversion’ method) or the Cholesky decomposition of the covariance matrix (for the ‘cholesky-solve-triangular’ method) or the ACF (for the ‘toeplitz-inversion’ method).
method (str) – Method to be used to compute the inner product. Options are: ‘direct-inversion’, ‘toeplitz-inversion’, ‘cholesky-solve-triangular’.
SNR – SNR of the template in the given data.
float
pyRing.utils.
compute_remnant_parameters_from_inspiral_aligned_spins_parameters
(m1, m2, chi1, chi2)[source]¶Compute the remnant parameters from the inspiral aligned spins parameters. For documentation on final state fits, see https://lscsoft.docs.ligo.org/lalsuite/lalinference/namespacelalinference_1_1imrtgr_1_1nrutils.html#a351987f8201d32f50af2fd38a7e4190e
m1 (float) – Mass of the first BH.
m2 (float) – Mass of the second BH.
chi1 (float) – Signed aligned spin component (i.e. can be both positive/parallel and negative/antiparallel wrt angular momentum axis) of the first BH.
chi2 (float) – Signed aligned spin component (i.e. can be both positive/parallel and negative/antiparallel wrt angular momentum axis) of the second BH.
Mf (float) – Final mass.
af (float) – Final spin.
pyRing.utils.
construct_full_modes
(modes, quad_modes)[source]¶This function constructs the full list of modes (combining linear and quadratic modes) to be used in the ringdown fitting procedure.
modes (list) – List of linear modes to be used in the fitting procedure.
quad_modes (dict) – Dictionary of quadratic modes to be used in the fitting procedure.
modes_full – Combined list of linear and quadratic modes to be used in the fitting procedure.
list
pyRing.utils.
construct_interpolant
(param_name, N_bins=32, par_file='ringdown/random_parameters_interpolation.txt')[source]¶This function constructs a spline interpolant for the prior of a given parameter.
param_name (str) – Name of the parameter.
N_bins (int) – Number of bins to be used to construct the spline interpolant.
par_file (str) – File containing the simulated events.
spline_interpolant – Spline interpolant for the prior of the given parameter.
scipy.interpolate.UnivariateSpline
pyRing.utils.
eta
(m1, m2)[source]¶This function returns the symmetric mass ratio of a binary system as a function of the component masses.
m1 (float) – Mass of the first component.
m2 (float) – Mass of the second component.
eta – Symmetric mass ratio of the binary system.
float
pyRing.utils.
eta_from_q
(q)[source]¶This function returns the symmetric mass ratio of a binary system as a function of the mass ratio.
q (float) – Mass ratio of the binary system.
eta – Symmetric mass ratio of the binary system.
float
pyRing.utils.
final_state_surfinBH
(Mtot, q, chi1, chi2, f_ref)[source]¶This function computes the final mass and spin of a binary black hole system using the surfinBH package.
Mtot (float) – Total mass of the binary system in solar masses.
q (float) – Mass ratio of the binary system.
chi1 (float) – Dimensionless spin of the more massive black hole. Input should be 3-vector, e.g. chi1 = (spin_1x, spin_1y, spin_1z).
chi2 (float) – Dimensionless spin of the less massive black hole. Input should be 3-vector, e.g. chi2 = (spin_2x, spin_2y, spin_2z).
f_ref (float) – Reference frequency in Hz.
Mf (float) – Final mass of the binary system in solar masses.
af (float) – Final dimensionless spin of the binary system.
pyRing.utils.
import_datafile_path
(filename)[source]¶This function returns the path to a data file, including the pyRing relative path.
filename (str) – Name of the data file.
package_path – Path to the data file.
str
pyRing.utils.
inner_product_FD
(h1, h2, psd, df)[source]¶This function computes the inner product between two frequency series h1 and h2 using the PSD psd.
h1 (array) – First frequency series.
h2 (array) – Second frequency series.
psd (array) – PSD.
df (float) – Frequency step of the frequency series.
inner_product – Inner product between h1 and h2.
float
pyRing.utils.
inner_product_TD
(h1, h2, InvCov)[source]¶This function computes the inner product between two time series h1 and h2 using the inverse covariance matrix InvCov.
h1 (array) – First time series.
h2 (array) – Second time series.
InvCov (array) – Inverse covariance matrix.
inner_product – Inner product between h1 and h2.
float
pyRing.utils.
m1_from_m_q
(m, q)[source]¶This function returns the mass of the first component of a binary system as a function of the total mass and the mass ratio.
m (float) – Total mass of the binary system.
q (float) – Mass ratio of the binary system.
m1 – Mass of the first component of the binary system.
float
pyRing.utils.
m1_from_mc_q
(mc, q)[source]¶This function returns the mass of the first component of a binary system as a function of the chirp mass and the mass ratio.
mc (float) – Chirp mass of the binary system.
q (float) – Mass ratio of the binary system.
m1 – Mass of the first component of the binary system.
float
pyRing.utils.
m2_from_m_q
(m, q)[source]¶This function returns the mass of the second component of a binary system as a function of the total mass and the mass ratio.
m (float) – Total mass of the binary system.
q (float) – Mass ratio of the binary system.
m2 – Mass of the second component of the binary system.
float
pyRing.utils.
m2_from_mc_q
(mc, q)[source]¶This function returns the mass of the second component of a binary system as a function of the chirp mass and the mass ratio.
mc (float) – Chirp mass of the binary system.
q (float) – Mass ratio of the binary system.
m2 – Mass of the second component of the binary system.
float
pyRing.utils.
mc
(m1, m2)[source]¶This function returns the chirp mass of a binary system as a function of the component masses.
m1 (float) – Mass of the first component.
m2 (float) – Mass of the second component.
mc – Chirp mass of the binary system.
float
pyRing.utils.
mchirp_from_mtot_eta
(mtot, eta)[source]¶This function returns the chirp mass of a binary system as a function of the total mass and the symmetric mass ratio.
mtot (float) – Total mass of the binary system.
eta (float) – Symmetric mass ratio of the binary system.
mc – Chirp mass of the binary system.
float
pyRing.utils.
mchirp_from_mtot_q
(mtot, q)[source]¶This function returns the chirp mass of a binary system as a function of the total mass and the mass ratio.
mtot (float) – Total mass of the binary system.
q (float) – Mass ratio of the binary system.
mc – Chirp mass of the binary system.
float
pyRing.utils.
mtot
(m1, m2)[source]¶This function returns the total mass of a binary system as a function of the component masses.
m1 (float) – Mass of the first component.
m2 (float) – Mass of the second component.
mtot – Total mass of the binary system.
float
pyRing.utils.
print_fixed_parameters
(fixed_params)[source]¶This function prints the fixed parameters.
fixed_params (dict) – Dictionary containing the fixed parameters.
Nothing, but prints the fixed parameters.
pyRing.utils.
print_out_of_bounds_warning
(name)[source]¶This function prints a warning message when the injected values are outside the prior bounds.
name (str) – Name of the parameter.
Nothing, but prints a warning message.
pyRing.utils.
print_section
(name)[source]¶This function prints a section header.
name (str) – Name of the section.
Nothing, but prints a section header.
pyRing.utils.
print_subsection
(name)[source]¶This function prints a subsection header.
name (str) – Name of the subsection.
Nothing, but prints a subsection header.
pyRing.utils.
project_python_wrapper
(hs, hvx, hvy, hp, hc, detector, ra, dec, psi, tgps)[source]¶Compute the complex time series projected onto the given detector.
hs (array of shape (n,)) – The complex time series of the breathing mode.
hvx (array of shape (n,)) – The complex time series of the longitudinal mode in the x direction.
hvy (array of shape (n,)) – The complex time series of the longitudinal mode in the y direction.
hp (array of shape (n,)) – The complex time series of the plus polarization.
hc (array of shape (n,)) – The complex time series of the cross polarization.
detector (laldetector structure) – The detector.
ra (double) – The right ascension.
dec (double) – The declination.
psi (double) – The polarisation angle.
tgps (double) – The time (GPS seconds).
pyRing.utils.
q
(m1, m2)[source]¶This function returns the mass ratio of a binary system as a function of the component masses.
m1 (float) – Mass of the first component.
m2 (float) – Mass of the second component.
q – Mass ratio of the binary system.
float
pyRing.utils.
qnm_interpolate
(s, l, m, n)[source]¶This function interpolates the complex frequencies of the QNM modes.
s (int) – Spin-weight of the mode.
l (int) – Orbital angular momentum of the mode.
m (int) – Azimuthal angular momentum of the mode.
n (int) – Radial quantum number of the mode.
w_r (interp1d object) – Interpolant function of the real part of the complex frequency.
w_i (interp1d object) – Interpolant function of the imaginary part of the complex frequency.
pyRing.utils.
qnm_interpolate_KN
(s, l, m, n)[source]¶This function interpolates the complex frequencies of the QNM modes for the Kerr-Newman spacetime.
s (int) – Spin-weight of the mode.
l (int) – Orbital angular momentum of the mode.
m (int) – Azimuthal angular momentum of the mode.
n (int) – Radial quantum number of the mode.
w_r (interp1d object) – Interpolant function of the real part of the complex frequency.
w_i (interp1d object) – Interpolant function of the imaginary part of the complex frequency.
pyRing.utils.
qnm_interpolate_braneworld
(s, l, m, n)[source]¶This function interpolates the complex frequencies of the QNM modes for the Braneworld spacetime.
s (int) – Spin-weight of the mode.
l (int) – Orbital angular momentum of the mode.
m (int) – Azimuthal angular momentum of the mode.
n (int) – Radial quantum number of the mode.
w_r (interp1d object) – Interpolant function of the real part of the complex frequency.
w_i (interp1d object) – Interpolant function of the imaginary part of the complex frequency.
pyRing.utils.
railing_check
(samples, prior_bins, tolerance)[source]¶This function checks whether the density of samples is within the tolerance percentage for the bins at the lower and higher boundaries of the prior, i.e. if there is railing of the posterior against the prior.
samples (array) – Samples from the posterior.
prior_bins (array) – Bins of the prior.
tolerance (float) – Tolerance percentage.
low_end_railing (bool) – True if the density of samples is within the tolerance percentage for the bin at the lower boundary of the prior.
high_end_railing (bool) – True if the density of samples is within the tolerance percentage for the bin at the higher boundary of the prior.
pyRing.utils.
resize_time_series
(inarr, N, dt, starttime, desiredtc)[source]¶Zero pad inarr and align its peak to the desired tc in the segment.
inarr (array) – Input time series.
N (int) – Length of the output time series.
dt (float) – Sampling time of the output time series.
starttime (float) – Start time of the output time series.
desiredtc (float) – Desired time of coalescence of the output time series.
outarr – Output time series.
array
pyRing.utils.
review_warning
()[source]¶This function prints a warning message if the code block is not reviewed.
None. –
Nothing, but prints a warning message.
pyRing.utils.
set_prefix
(warning_message=True)[source]¶Set the prefix path for the data files.
warning_message (bool) – If True, a warning message is printed if the environment variable is not set.
prefix – Path to the data files.
str
pyRing.utils.
whiten_FD
(strain, interp_psd, dt, f_min, f_max)[source]¶This function whitens the strain time series in the frequency domain.
strain (array) – Strain time series.
interp_psd (array) – Interpolated PSD.
dt (float) – Time step of the strain time series.
f_min (float) – Minimum frequency of the bandpass.
f_max (float) – Maximum frequency of the bandpass.
white_ht – Whitened strain time series.
array
pyRing.utils.
whiten_TD
(x, cholesky_L, method='solve-triangular')[source]¶Whiten in the time domain the time series x using the Cholesky decomposition of the covariance matrix.
x (array) – Time series to be whitened.
cholesky_L (array) – Cholesky decomposition of the covariance matrix.
method (str) – Method to be used to solve the linear system.
x_whitened – Whitened time series.
array
pyRing.waveform.
Damped_sinusoids
¶Bases: object
Class implementing a superposition of Damped Sinusoids of arbitrary polarisation.
A (dict) – Dictionary of amplitudes of the damped sinusoids.
f (dict) – Dictionary of frequencies of the damped sinusoids.
tau (dict) – Dictionary of damping times of the damped sinusoids.
phi (dict) – Dictionary of phases of the damped sinusoids.
t0 (dict) – Dictionary of start times of the damped sinusoids.
A
¶Dictionary of amplitudes of the damped sinusoids.
dict
f
¶Dictionary of frequencies of the damped sinusoids.
dict
tau
¶Dictionary of damping times of the damped sinusoids.
dict
phi
¶Dictionary of phases of the damped sinusoids.
dict
t0
¶Dictionary of start times of the damped sinusoids.
dict
N
¶Dictionary of number of damped sinusoids for each polarisation.
dict
Functions
¶---------
waveform
(t)¶Returns the waveform model.
A
¶dict
A
N
¶dict
N
f
¶dict
f
phi
¶dict
phi
t0
¶dict
t0
tau
¶dict
tau
waveform
(self, ndarray t) → ndarray¶t (np.ndarray) – Time array.
h – Waveform model.
np.ndarray
pyRing.waveform.
IMR_WF
¶Bases: object
Call an IMR waveform from LAL
cosiota
¶‘double’
cosiota
dist
¶‘double’
dist
dt
¶‘double’
dt
m1
¶‘double’
m1
m2
¶‘double’
m2
phi
¶‘double’
phi
s1z
¶‘double’
s1z
s2z
¶‘double’
s2z
signal_seglen
¶‘double’
signal_seglen
starttime
¶‘double’
starttime
t0
¶‘double’
t0
waveform
(self, ndarray times) → ndarray¶pyRing.waveform.
KHS_2012
¶Bases: object
Mf
¶‘double’
Mf
TGR_params
¶dict
TGR_params
af
¶‘double’
af
chi_eff
¶‘double’
chi_eff
eta
¶‘double’
eta
iota
¶‘double’
iota
multipoles
¶list
multipoles
phi
¶‘double’
phi
r
¶‘double’
r
single_l
¶‘int’
single_l
single_m
¶‘int’
single_m
single_mode
¶‘unsigned int’
single_mode
t0
¶‘double’
t0
waveform
(self, ndarray times) → ndarray¶Returns h_+ - i* h_x
pyRing.waveform.
KerrBH
¶Bases: object
AreaQuantization
¶‘unsigned int’
AreaQuantization
Mf
¶‘double’
Mf
ParSpec
¶‘unsigned int’
ParSpec
Spheroidal
¶‘unsigned int’
Spheroidal
TGR_params
¶dict
TGR_params
af
¶‘double’
af
amp_non_prec_sym
¶‘unsigned int’
amp_non_prec_sym
amps
¶dict
amps
braneworld
¶‘unsigned int’
braneworld
charge
¶‘unsigned int’
charge
geom
¶‘unsigned int’
geom
interpolants
¶dict
interpolants
iota
¶‘double’
iota
neg_quad_freq
¶‘unsigned int’
neg_quad_freq
phi
¶‘double’
phi
qnm_cached
¶dict
qnm_cached
qnm_fit
¶‘unsigned int’
qnm_fit
qnms
¶dict
qnms
qnms_ParSpec
¶dict
qnms_ParSpec
quad_lin_prop
¶‘unsigned int’
quad_lin_prop
quadratic_modes
¶dict
quadratic_modes
r
¶‘double’
r
reference_amplitude
¶‘double’
reference_amplitude
swshs
¶dict
swshs
t0
¶‘double’
t0
tail_parameters
¶dict
tail_parameters
waveform
(self, ndarray times) → ndarray¶pyRing.waveform.
MMRDNP
¶Bases: object
h_s, h_vx, h_vy, h_p, h_c
np.array
Mf
¶‘double’
Mf
Mi
¶‘double’
Mi
TGR_params
¶dict
TGR_params
af
¶‘double’
af
chi_a
¶‘double’
chi_a
chi_s
¶‘double’
chi_s
delta
¶‘double’
delta
eta
¶‘double’
eta
geom
¶‘unsigned int’
geom
interpolants
¶dict
interpolants
iota
¶‘double’
iota
multipoles
¶dict
multipoles
phi
¶‘double’
phi
qnm_cached
¶dict
qnm_cached
qnm_fit
¶‘unsigned int’
qnm_fit
r
¶‘double’
r
single_l
¶‘int’
single_l
single_m
¶‘int’
single_m
single_mode
¶‘unsigned int’
single_mode
t0
¶‘double’
t0
waveform
(self, ndarray times) → ndarray¶We employ the convention: h_+ - i h_x = sum_{lm} Y_{lm} h_{lm} Non-precessing symmetry implies the property: h_{l,-m} = (-1)**l h^*_{l,m} (see: Blanchet, “Gravitational Radiation from Post-Newtonian Sources and Inspiralling Compact Binaries”). This model does not support extra scalar/vector polarisations, which are set to zero.
pyRing.waveform.
MMRDNS
¶Bases: object
h_s, h_vx, h_vy, h_p, h_c
5 numpy arrays containing the waveform.
Mf
¶‘double’
Mf
Spheroidal
¶‘unsigned int’
Spheroidal
TGR_params
¶dict
TGR_params
af
¶‘double’
af
eta
¶‘double’
eta
interpolants
¶dict
interpolants
iota
¶‘double’
iota
multipoles
¶list
multipoles
phi
¶‘double’
phi
qnm_fit
¶‘unsigned int’
qnm_fit
r
¶‘double’
r
single_l
¶‘int’
single_l
single_m
¶‘int’
single_m
single_mode
¶‘unsigned int’
single_mode
single_n
¶‘int’
single_n
t0
¶‘double’
t0
waveform
(self, ndarray times) → ndarray¶pyRing.waveform.
Morlet_Gabor_wavelets
¶Bases: object
Class implementing a superposition of Morlet-Gabor wavelets of arbitrary polarisation.
A (dict) – Dictionary of amplitudes of the Morlet-Gabor wavelets.
f (dict) – Dictionary of frequencies of the Morlet-Gabor wavelets.
tau (dict) – Dictionary of damping times of the Morlet-Gabor wavelets.
phi (dict) – Dictionary of phases of the Morlet-Gabor wavelets.
t0 (dict) – Dictionary of start times of the Morlet-Gabor wavelets.
A
¶Dictionary of amplitudes of the Morlet-Gabor wavelets.
dict
f
¶Dictionary of frequencies of the Morlet-Gabor wavelets.
dict
tau
¶Dictionary of damping times of the Morlet-Gabor wavelets.
dict
phi
¶Dictionary of phases of the Morlet-Gabor wavelets.
dict
t0
¶Dictionary of start times of the Morlet-Gabor wavelets.
dict
N
¶Dictionary of number of Morlet-Gabor wavelets for each polarisation.
dict
Functions
¶---------
waveform
(t)¶Returns the waveform model.
A
¶dict
A
N
¶dict
N
f
¶dict
f
phi
¶dict
phi
t0
¶dict
t0
tau
¶dict
tau
waveform
(self, ndarray t) → ndarray¶Returns five polarisations (the ones independent in a L-shaped GW detector) allowed for a metric theory of gravity: hs (scalar mode), {hvx, hvy} (vector modes), {hp, hc} (tensor modes). We employ the conventions: h_s = sum_{i} A_i * cos(omega*t+phi) * e^(-(t-t^{start}_i/tau)
h_vx - i h_vy = sum_{i} A_i * e^(i*omega*t+phi) * e^(-(t-t^{start}_i/tau) h_+ - i h_x = sum_{i} A_i * e^(i*omega*t+phi) * e^(-(t-t^{start}_i/tau)
t (np.ndarray) – Time array.
h – Waveform model.
np.ndarray
pyRing.waveform.
QNM
¶Bases: object
Class to compute the complex frequency and damping time of a QNM.
s (int) – Spin-weight of the QNM.
l (int) – Orbital angular number of the QNM.
m (int) – Azimuthal number of the QNM.
n (int) – Radial (overtone) number of the QNM.
interpolants (dict) – Dictionary of interpolants for the QNM frequencies and damping times.
geom (int, optional) – Geometric units flag. If 1, the QNM frequencies are returned in geometric units, otherwise they are returned in standard units.
s
¶Spin-weight of the QNM.
int
l
¶Orbital angular number of the QNM.
int
m
¶Azimuthal number of the QNM.
int
n
¶Radial (overtone) number of the QNM.
int
geom
¶Geometric units flag. If 1, the QNM frequencies are returned in geometric units, otherwise they are returned in standard units.
int
omegar_interp
¶Interpolant for the real part of the QNM frequency.
scipy.interpolate.interp1d
omegai_interp
¶Interpolant for the imaginary part of the QNM frequency.
scipy.interpolate.interp1d
prefactor_freq
¶Prefactor for the QNM frequency.
float
prefactor_tau
¶Prefactor for the QNM damping time.
float
Functions
¶---------
f
¶Returns the real part of the QNM frequency.
float
tau
¶Returns the imaginary part of the QNM frequency.
float
f_KN
¶Returns the real part of the QNM frequency for the Kerr-Newman metric.
float
tau_KN
¶Returns the imaginary part of the QNM frequency for the Kerr-Newman metric.
float
f_BW
¶Returns the real part of the QNM frequency for the braneworld model.
float
tau_BW
¶Returns the imaginary part of the QNM frequency for the braneworld model.
float
f
(self, double M, double a) → double¶f_BW
(self, double M, double a, double beta) → double¶f_KN
(self, double M, double a, double Q) → double¶geom
¶‘unsigned int’
geom
l
¶‘unsigned int’
l
m
¶‘int’
m
n
¶‘unsigned int’
n
omegai_interp
¶object
omegai_interp
omegar_interp
¶object
omegar_interp
prefactor_freq
¶‘double’
prefactor_freq
prefactor_tau
¶‘double’
prefactor_tau
s
¶‘unsigned int’
s
tau
(self, double M, double a) → double¶tau_BW
(self, double M, double a, double beta) → double¶tau_KN
(self, double M, double a, double Q) → double¶pyRing.waveform.
QNM_220_area_quantized
¶Bases: object
Class to compute the complex frequency and damping time of the 220 QNM coming from quantized area presciption.
l_QA (int) – Orbital angular number of the QNM.
m_QA (int) – Azimuthal number of the QNM.
n_QA (int) – Radial (overtone) number of the QNM.
l_QA
¶Orbital angular number of the QNM.
int
m_QA
¶Azimuthal number of the QNM.
int
n_QA
¶Radial (overtone) number of the QNM.
int
q_coeff_GR
¶List of coefficients for the quality factor QNM frequency.
list
Functions
¶---------
f_QA
¶Returns the real part of the QNM frequency.
float
q_QA
¶Returns the quality factor of the QNM frequency.
float
tau_QA
¶Returns the imaginary part of the QNM frequency.
float
f_QA
(self, double M, double a, double alpha) → double¶l_QA
¶‘unsigned int’
l_QA
m_QA
¶‘int’
m_QA
n_QA
¶‘unsigned int’
n_QA
q_GR
(self, double a) → double¶q_coeff_GR
¶object
q_coeff_GR
tau_QA
(self, double M, double a, double alpha) → double¶pyRing.waveform.
QNM_ParSpec
¶Bases: object
Class to compute the complex frequency and damping time of a QNM using the ParSpec fits.
l (int) – Orbital angular number of the QNM.
m (int) – Azimuthal number of the QNM.
n (int) – Radial (overtone) number of the QNM.
fit (str, optional) – Fit to use. Either ‘high_spin’ or ‘low_spin’. Default is ‘high_spin’.
geom (int, optional) – Geometric units flag. If 1, the QNM frequencies are returned in geometric units, otherwise they are returned in the International System of Units. Default is 0.
l
¶Orbital angular number of the QNM.
int
m
¶Azimuthal number of the QNM.
int
n
¶Radial (overtone) number of the QNM.
int
f_coeff
¶List of coefficients for the real part of the complex QNM frequency.
list
tau_coeff
¶List of coefficients for the imaginary part of the complex QNM frequency.
list
Functions
¶---------
f
¶Returns the real part of the QNM frequency.
float
tau
¶Returns the imaginary part of the QNM frequency.
float
f
(self, double M, double a, double gamma, ndarray dw_vec) → double¶f_coeff
¶object
f_coeff
l
¶‘unsigned int’
l
m
¶‘int’
m
n
¶‘unsigned int’
n
prefactor_freq
¶‘double’
prefactor_freq
prefactor_tau
¶‘double’
prefactor_tau
tau
(self, double M, double a, double gamma, ndarray dt_vec) → double¶tau_coeff
¶object
tau_coeff
pyRing.waveform.
QNM_braneworld_fit
¶Bases: object
Class to compute the complex frequency and damping time of the QNM coming from braneworld fit.
l_BW (int) – Orbital angular number of the QNM.
m_BW (int) – Azimuthal number of the QNM.
n_BW (int) – Radial (overtone) number of the QNM.
l_BW
¶Orbital angular number of the QNM.
int
m_BW
¶Azimuthal number of the QNM.
int
n_BW
¶Radial (overtone) number of the QNM.
int
Functions
¶---------
f_BW
¶Returns the real part of the QNM frequency.
float
q_BW
¶Returns the quality factor of the QNM frequency.
float
tau_BW
¶Returns the imaginary part of the QNM frequency.
float
f_BW
(self, double M, double a, double beta) → double¶l_BW
¶‘unsigned int’
l_BW
m_BW
¶‘int’
m_BW
n_BW
¶‘unsigned int’
n_BW
q_BW
(self, double a, double beta) → double¶tau_BW
(self, double M, double a, double beta) → double¶pyRing.waveform.
QNM_fit
¶Bases: object
Class to compute the complex frequency and damping time of a QNM using fits to the Berti et al. (2015) fits.
l (int) – Orbital angular number of the QNM.
m (int) – Azimuthal number of the QNM.
n (int) – Radial (overtone) number of the QNM.
charge (int, optional) – Charge flag. If not 0, compute the QNM for a charged BH.
geom (int, optional) – Geometric units flag. If 1, the QNM frequencies are returned in geometric units, otherwise they are returned in the International System of Units. Default is 0.
l
¶Orbital angular number of the QNM.
int
m
¶Azimuthal number of the QNM.
int
n
¶Radial (overtone) number of the QNM.
int
charge
¶Charge flag. If not 0, compute the QNM for a charged BH.
int
f_coeff
¶List of coefficients for the real part of the complex QNM frequency.
list
q_coeff
¶List of coefficients for the quality factor of the complex QNM frequency.
list
Functions
¶---------
f
¶Returns the real part of the QNM frequency.
float
q
¶Returns the quality factor of the QNM frequency.
float
tau
¶Returns the imaginary part of the QNM frequency.
float
f_KN
¶Returns the real part of the QNM frequency for the Kerr-Newman metric.
float
tau_KN
¶Returns the imaginary part of the QNM frequency for the Kerr-Newman metric.
float
q_KN
¶Returns the quality factor of the QNM frequency for the Kerr-Newman metric.
float
charge
¶‘unsigned int’
charge
f
(self, double M, double a) → double¶f_KN
(self, double M, double a, double Q) → double¶f_coeff
¶object
f_coeff
l
¶‘unsigned int’
l
m
¶‘int’
m
n
¶‘unsigned int’
n
prefactor_freq
¶‘double’
prefactor_freq
q
(self, double a) → double¶q_KN
(self, double a, double Q) → double¶q_coeff
¶object
q_coeff
tau
(self, double M, double a) → double¶tau_KN
(self, double M, double a, double Q) → double¶pyRing.waveform.
SWSH
(int s, int l, int m)¶Bases: object
Spin weighted spherical harmonics -s_Y_{lm} Defined in Kidder (https://arxiv.org/pdf/0710.0614.pdf) Eq.s (4, 5). Note that this function returns -s_Y_{l,m} as defined by Kidder. Thus, for gravitational perturbation s=2 must be passed.
s (int) – Spin of the spherical harmonic.
l (int) – Orbital angular number of the spherical harmonic.
m (int) – Azimuthal angular number of the spherical harmonic.
s
¶Spin of the spherical harmonic.
int
l
¶Orbital angular number of the spherical harmonic.
int
m
¶Azimuthal angular number of the spherical harmonic.
int
swsh_prefactor
¶Prefactor of the spherical harmonic.
double
Functions
¶---------
evaluate
(theta, phi)¶Returns the value of the spherical harmonic for the given angles.
evaluate
(self, double theta, double phi) → double complex¶SWSH for angles theta [0,pi] and phi [0,2pi].
theta (double) – Polar angle.
phi (double) – Azimuthal angle.
result – Value of the SWSH for the given angles.
complex
l
¶‘int’
l
m
¶‘int’
m
s
¶‘int’
s
swsh_prefactor
¶‘double’
swsh_prefactor
pyRing.waveform.
TEOBPM
¶Bases: object
DeltaPhi
(self, int l, int m)¶DeltaT
(self, int l, int m)¶EOBPM_SetupFitCoefficients
(self, int l, int m, dict NR_fit_coeffs)¶JimenezFortezaRemnantMass
(self)¶JimenezFortezaRemnantSpin
(self)¶M
¶‘double’
M
Mf
¶‘double’
Mf
NR_fit_coeffs
¶dict
NR_fit_coeffs
S_bar
(self)¶S_hat
(self)¶Sbar
¶‘double’
Sbar
Shat
¶‘double’
Shat
TEOBPM_Amplitude
(self, double tau, double sigma_real, double a1, double a2, double a3, double a4)¶TEOBPM_Phase
(self, double tau, double sigma_imag, double phi_0, double p1, double p2, double p3, double p4)¶TGR_params
¶dict
TGR_params
X1
¶‘double’
X1
X12
¶‘double’
X12
X2
¶‘double’
X2
X_1
(self)¶X_12
(self)¶X_2
(self)¶a0
¶‘double’
a0
a12
¶‘double’
a12
a_0
(self)¶a_12
(self)¶af
¶‘double’
af
alpha1
(self, int l, int m)¶alpha21
(self, int l, int m)¶amplitude_peak
(self, double omega_peak, int l, int m)¶c3_A
(self, int l, int m)¶c3_phi
(self, int l, int m)¶c4_phi
(self, int l, int m)¶chi1
¶‘double’
chi1
chi2
¶‘double’
chi2
dOmega
(self, double omega1, double omega_peak)¶fit_coefficients
¶dict
fit_coefficients
full_modes
¶‘unsigned int’
full_modes
geom
¶‘unsigned int’
geom
iota
¶‘double’
iota
m1
¶‘double’
m1
m2
¶‘double’
m2
modes
¶list
modes
multipoles
¶list
multipoles
nu
¶‘double’
nu
omega1
(self, int l, int m)¶omega_peak
(self, int l, int m)¶phases
¶dict
phases
phi
¶‘double’
phi
r
¶‘double’
r
sym_mass_ratio
(self)¶t0
¶‘double’
t0
waveform
(self, ndarray times)¶pyRing.waveform.
damped_sinusoid
(double A, double f, double tau, double phi, double t0, ndarray t) → ndarray¶Function to compute a damped sinusoid waveform model.
A (float) – Amplitude of the damped sinusoid.
f (float) – Frequency of the damped sinusoid.
tau (float) – Damping time of the damped sinusoid.
phi (float) – Phase of the damped sinusoid.
t0 (float) – Start time of the damped sinusoid.
t (np.ndarray) – Time array.
h – Damped sinusoid waveform model.
np.ndarray
pyRing.waveform.
tail_factor
(double A, double phi, double p, double t0, ndarray t) → ndarray¶Function to compute the tail factor of the damped sinusoid waveform model.
A (float) – Amplitude of the damped sinusoid.
phi (float) – Phase of the damped sinusoid.
p (float) – Power-law exponent of the damped sinusoid.
t0 (float) – Start time of the damped sinusoid.
t (np.ndarray) – Time array.
h – Tail factor of the damped sinusoid waveform model.
np.ndarray