phenomxpy.gwsignal_wrapper

Define generators to interface with gwsignal.

class phenomxpy.gwsignal_wrapper.PyIMRPhenomT(*args: Any, **kwargs: Any)[source]

Bases: CompactBinaryCoalescenceGenerator

gwsignal generator wrapper for the IMRPhenomT model.

This is the parent class from which all the other IMRPhenomT* models subclass.

Example usage:

from lalsimulation import gwsignal as gws

gen = PyIMRPhenomT()
hp, hc = gws.core.waveform.GenerateTDWaveform(params, gen)
generate_fd_waveform(**parameters)[source]

Compute Fourier domain polarizations.

generate_td_waveform(**parameters)[source]

Compute time domain polarizations.

property metadata
class phenomxpy.gwsignal_wrapper.PyIMRPhenomTFamily(*args: Any, **kwargs: Any)[source]

Bases: PyIMRPhenomT

gwsignal generator wrapper for the IMRPhenomTFamily.

This class permits to use all the models in the IMRPhenomT family with the same generator. One needs to specify the approximant name in the input parameters.

Example usage:

gen = PyIMRPhenomTFamily()

params["approximant"] = "IMRPhenomTHM"
hp, hc = gws.core.waveform.GenerateTDWaveform(params, gen)

params["approximant"] = "IMRPhenomTPHM"
hp, hc = gws.core.waveform.GenerateTDWaveform(params, gen)
property metadata
class phenomxpy.gwsignal_wrapper.PyIMRPhenomTHM(*args: Any, **kwargs: Any)[source]

Bases: PyIMRPhenomT

gwsignal generator wrapper for the IMRPhenomTHM model.

class phenomxpy.gwsignal_wrapper.PyIMRPhenomTP(*args: Any, **kwargs: Any)[source]

Bases: PyIMRPhenomT

gwsignal generator wrapper for the IMRPhenomTP model.

class phenomxpy.gwsignal_wrapper.PyIMRPhenomTPHM(*args: Any, **kwargs: Any)[source]

Bases: PyIMRPhenomT

gwsignal generator wrapper for the IMRPhenomTPHM model.

phenomxpy.gwsignal_wrapper.convert_params_from_gwsignal(input_params)[source]

Convert gwsignal (astropy dictionary) to phenomxpy.

Parameters are transformed to the units in the default_dict of gwsignal.

Units are removed.

Parameters:

input_params (gwsiganl dictionary) – parameters with astropy units.

Returns:

Parameters in phenomxpy format without units.

Return type:

dict

phenomxpy.gwsignal_wrapper.strip_units(waveform_dict)[source]

Remove units from astropy dictionary.

phenomxpy.common

Utility functions to interface with external softwares

phenomxpy.common.GeneratePolarizations(parameters={}, approximant='IMRPhenomT', domain='TD', return_generator=False)[source]

Wrapper function to generate hp, hc in time or frequency domain from different interfaces:

  • LALSuite C interface: use swiglal python wrappers

  • LALSuite gwsignal interface: the lalsuite python interface. Can call phenomxpy, FIXME pyseobnr

  • phenomxpy: use phenomxpy directly.

Parameters:
  • parameters (astropy dict) – Waveform parameters with astropy units and extra options

  • approximant (str) – Approximant name

  • domain ({"TD", "FD"}) – Polarizations in time or frequency domain. Will perform an FFT if using a time domain approximant.

  • return_generator (bool) – Return the class object for the python generator.

Returns:

  • Tuple with 2 gwpy Time(Frequency)Series. – hp, hc: polarizations in time or frequency domain.

  • Optionally also return the python generator object.

phenomxpy.common.bilby_frequency_phenomxpy(frequency_array, mass_1, mass_2, luminosity_distance, a_1, a_2, tilt_1, tilt_2, phi_12, phi_jl, theta_jn, phase, eccentricity=0.0, mean_anomaly=0.0, **kwargs)[source]

frequency_domain_model for bilby waveform generator. Same interface as bilby.gw.source.lal_binary_black_hole.

Parameters:
  • frequency_array (array_like) – The frequencies at which we want to calculate the strain

  • mass_1 (float) – The mass of the heavier object in solar masses

  • mass_2 (float) – The mass of the lighter object in solar masses

  • luminosity_distance (float) – The luminosity distance in megaparsec

  • a_1 (float) – Dimensionless primary spin magnitude

  • tilt_1 (float) – Primary tilt angle

  • phi_12 (float) – Azimuthal angle between the two component spins

  • a_2 (float) – Dimensionless secondary spin magnitude

  • tilt_2 (float) – Secondary tilt angle

  • phi_jl (float) – Azimuthal angle between the total binary angular momentum and the orbital angular momentum

  • theta_jn (float) – Angle between the total binary angular momentum and the line of sight

  • phase (float) – The phase at reference frequency or peak amplitude (depends on waveform)

  • kwargs (dict) – Include parameters like reference_frequency, minimum_frequency and waveform_approximant and any extra option accepted by phenomxpy.

Returns:

{“plus”: hplus, “cross”: hcross} the two polarizations in Fourier domain in an equispaced frequency grid.

Return type:

dictionary