From 392918b08773a34fddb6c40c2ebc638304202299 Mon Sep 17 00:00:00 2001 From: AntoniRamosBuades Date: Mon, 18 Nov 2024 10:18:44 +0100 Subject: [PATCH] Support for eccentricity and mean_per_ano parameters * add the new parameters * set new parameters to zero if not specified --- bilby/gw/conversion.py | 2 +- bilby/gw/source.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bilby/gw/conversion.py b/bilby/gw/conversion.py index 2a50d7b5a..98f8ac00d 100644 --- a/bilby/gw/conversion.py +++ b/bilby/gw/conversion.py @@ -259,7 +259,7 @@ def convert_to_lal_binary_black_hole_parameters(parameters): ) converted_parameters[f"cos_tilt_{idx}"] = 1.0 - for key in ["phi_jl", "phi_12"]: + for key in ["phi_jl", "phi_12","eccentricity","mean_per_ano"]: if key not in converted_parameters: converted_parameters[key] = 0.0 diff --git a/bilby/gw/source.py b/bilby/gw/source.py index bd2cd1b64..c2ff09dec 100644 --- a/bilby/gw/source.py +++ b/bilby/gw/source.py @@ -17,7 +17,7 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_distance, a_1, tilt_1, - phi_12, a_2, tilt_2, phi_jl, theta_jn, phase, **kwargs): + phi_12, a_2, tilt_2, phi_jl, theta_jn, phase, eccentricity, mean_per_ano, **kwargs): """ A binary black hole waveform model using GWsignal @@ -48,6 +48,10 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista Angle between the total binary angular momentum and the line of sight phase: float The phase at coalescence + eccentricity: float + Orbital eccentricity + mean_per_ano: float + Mean anomaly kwargs: dict Optional keyword arguments Supported arguments: @@ -83,8 +87,8 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista ===== This function is a temporary wrapper to the interface that will likely be significantly changed or removed in a future release. - This version is only intended to be used with `SEOBNRv5HM` and `SEOBNRv5PHM` and - does not have full functionality for other waveform models. + This version is only intended to be used with ``SEOBNRv5HM``, ``SEOBNRv5EHM`` + and ``SEOBNRv5PHM`` and does not have full functionality for other waveform models. """ from lalsimulation.gwsignal import GenerateFDWaveform @@ -103,7 +107,7 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista waveform_kwargs.update(kwargs) waveform_approximant = waveform_kwargs['waveform_approximant'] - if waveform_approximant not in ["SEOBNRv5HM", "SEOBNRv5PHM"]: + if waveform_approximant not in ["SEOBNRv5HM", "SEOBNRv5EHM", "SEOBNRv5PHM"]: if waveform_approximant == "IMRPhenomXPHM": logger.warning("The new waveform interface is unreviewed for this model" + "and it is only intended for testing.") @@ -141,9 +145,7 @@ def gwsignal_binary_black_hole(frequency_array, mass_1, mass_2, luminosity_dista phi_12=phi_12, a_1=a_1, a_2=a_2, mass_1=mass_1 * utils.solar_mass, mass_2=mass_2 * utils.solar_mass, reference_frequency=reference_frequency, phase=phase) - eccentricity = 0.0 longitude_ascending_nodes = 0.0 - mean_per_ano = 0.0 # Check if conditioning is needed condition = 0