bilby.gw.conversion

A collection of functions to convert between parameters describing gravitational-wave sources.

Functions

bilby_to_lalsimulation_spins(theta_jn, ...)

Convert from Bilby spin parameters to lalsimulation ones.

binary_love_fit_lambda_symmetric_mass_ratio_to_lambda_antisymmetric(...)

Convert from symmetric tidal terms and mass ratio to antisymmetric tidal terms using BinaryLove relations.

binary_love_lambda_symmetric_to_lambda_1_lambda_2_automatic_marginalisation(...)

Convert from symmetric tidal terms to lambda_1 and lambda_2 using BinaryLove relations

binary_love_lambda_symmetric_to_lambda_1_lambda_2_manual_marginalisation(...)

Convert from symmetric tidal terms to lambda_1 and lambda_2 using BinaryLove relations

chirp_mass_and_mass_ratio_to_component_masses(...)

Convert total mass and mass ratio of a binary to its component masses.

chirp_mass_and_mass_ratio_to_total_mass(...)

Convert chirp mass and mass ratio of a binary to its total mass.

chirp_mass_and_primary_mass_to_mass_ratio(...)

Convert chirp mass and mass ratio of a binary to its total mass.

chirp_mass_and_total_mass_to_symmetric_mass_ratio(...)

Convert chirp mass and total mass of a binary to its symmetric mass ratio.

comoving_distance_to_luminosity_distance(...)

Convert from comoving_distance to luminosity_distance

comoving_distance_to_redshift(distance[, ...])

Convert from comoving_distance to redshift

component_masses_to_chirp_mass(mass_1, mass_2)

Convert the component masses of a binary to its chirp mass.

component_masses_to_mass_ratio(mass_1, mass_2)

Convert the component masses of a binary to its chirp mass.

component_masses_to_symmetric_mass_ratio(...)

Convert the component masses of a binary to its symmetric mass ratio.

component_masses_to_total_mass(mass_1, mass_2)

Convert the component masses of a binary to its total mass.

compute_per_detector_log_likelihoods(...[, ...])

Calculate the log likelihoods in each detector.

compute_snrs(sample, likelihood[, npool])

Compute the optimal and matched filter snrs of all posterior samples and print it out.

convert_to_lal_binary_black_hole_parameters(...)

Convert parameters we have into parameters we need.

convert_to_lal_binary_neutron_star_parameters(...)

Convert parameters we have into parameters we need.

eos_family_physical_check(eos)

Function that determines if the EoS family contains sufficient number of points before maximum mass is reached.

fill_from_fixed_priors(sample, priors)

Add parameters with delta function prior to the data frame/dictionary.

fill_sample(args)

generate_all_bbh_parameters(sample[, ...])

From either a single sample or a set of samples fill in all missing BBH parameters, in place.

generate_all_bns_parameters(sample[, ...])

From either a single sample or a set of samples fill in all missing BNS parameters, in place.

generate_component_masses(sample[, ...])

generate_component_spins(sample)

Add the component spins to the data frame/dictionary.

generate_mass_parameters(sample[, source])

Add the known mass parameters to the data frame/dictionary.

generate_posterior_samples_from_marginalized_likelihood(...)

Reconstruct the distance posterior from a run which used a likelihood which explicitly marginalised over time/distance/phase.

generate_sky_frame_parameters(samples, ...)

generate_source_frame_parameters(sample)

Generate source frame masses along with redshifts and comoving distance.

generate_specific_parameters(sample, parameters)

Generate a specific subset of parameters that can be generated.

generate_spin_parameters(sample)

Add all spin parameters to the data frame/dictionary.

generate_tidal_parameters(sample)

Generate all tidal parameters

identity_map_conversion(parameters)

An identity map conversion function that makes no changes to the parameters, but returns the correct signature expected by other conversion functions (e.g. convert_to_lal_binary_black_hole_parameters).

identity_map_generation(sample[, ...])

An identity map generation function that handles marginalizations, SNRs, etc.

lambda_1_lambda_2_to_delta_lambda_tilde(...)

Convert from individual tidal parameters to second domainant tidal term.

lambda_1_lambda_2_to_lambda_antisymmetric(...)

Convert from individual tidal parameters to antisymmetric tidal term.

lambda_1_lambda_2_to_lambda_symmetric(...)

Convert from individual tidal parameters to symmetric tidal term.

lambda_1_lambda_2_to_lambda_tilde(lambda_1, ...)

Convert from individual tidal parameters to domainant tidal term.

lambda_from_mass_and_family(mass_i, family)

Convert from equation of state model parameters to component tidal parameters.

lambda_symmetric_lambda_antisymmetric_to_lambda_1(...)

Convert from symmetric and antisymmetric tidal terms to lambda_1

lambda_symmetric_lambda_antisymmetric_to_lambda_1_lambda_2(...)

Convert from symmetric and antisymmetric tidal terms to lambda_1 and lambda_2

lambda_symmetric_lambda_antisymmetric_to_lambda_2(...)

Convert from symmetric and antisymmetric tidal terms to lambda_2

lambda_tilde_delta_lambda_tilde_to_lambda_1_lambda_2(...)

Convert from dominant tidal terms to individual tidal parameters.

lambda_tilde_to_lambda_1_lambda_2(...)

Convert from dominant tidal term to individual tidal parameters assuming lambda_1 * mass_1**5 = lambda_2 * mass_2**5.

log_pressure_reparameterization_conversion(...)

Converts the reparameterization joining pressures from

luminosity_distance_to_comoving_distance(...)

Convert from luminosity_distance to comoving_distance

luminosity_distance_to_redshift(distance[, ...])

Convert from luminosity_distance to redshift

mass_1_and_chirp_mass_to_mass_ratio(mass_1, ...)

Calculate mass ratio from mass_1 and chirp_mass.

mass_2_and_chirp_mass_to_mass_ratio(mass_2, ...)

Calculate mass ratio from mass_1 and chirp_mass.

neutron_star_family_physical_check(eos, ...)

Takes in a lalsim eos object.

polytrope_or_causal_params_to_lambda_1_lambda_2(...)

Converts parameters from sampled dynamic piecewise polytrope parameters

redshift_to_comoving_distance(redshift[, ...])

Convert from redshift to comoving_distance

redshift_to_luminosity_distance(redshift[, ...])

Convert from redshift to luminosity_distance

spectral_params_to_lambda_1_lambda_2(...)

Converts from the 4 spectral decomposition parameters and the source masses to the tidal deformability parameters.

spectral_pca_to_spectral(gamma_pca_0, ...)

Change of basis on parameter space

symmetric_mass_ratio_to_mass_ratio(...)

Convert the symmetric mass ratio to the normal mass ratio.

total_mass_and_mass_ratio_to_component_masses(...)

Convert total mass and mass ratio of a binary to its component masses.