holodeck.gravwaves

Gravitational Wave (GW) calculations module.

This module provides tools for calculating GW signals from MBH binaries. Currently the components here are used with the ‘discrete’ / ‘illustris’ population of binaries, and not the semi-analytic or observational population models.

holodeck.gravwaves.gws_from_sampled_strains(fobs_gw_edges, fo, hs, weights)[source]

Calculate GW background/foreground from sampled GW strains.

Parameters:
  • fobs_gw_edges ((F,) array_like of scalar) – Observer-frame GW-frequency bin edges.

  • fo ((S,) array_like of scalar) – Observer-frame GW-frequency of each binary sample. Units of [1/sec]

  • hs ((S,) array_like of scalar) – GW source strain (not characteristic strain) of each binary sample.

  • weights ((S,) array_like of int) – Weighting factor for each binary. NOTE: the GW calculation is ill-defined if weights have fractional values (i.e. float values, instead of integral values; but the type itself doesn’t matter)

Returns:

  • gwf_freqs ((F,) ndarray of scalar) – Observer-frame GW frequency of foreground sources in each frequency bin. Units of [1/sec].

  • gwfore ((F,) ndarray of scalar) – Strain amplitude of foreground sources in each frequency bin.

  • gwback ((F,) ndarray of scalar) – Strain amplitude of the background in each frequency bin.

holodeck.gravwaves.poisson_as_needed(values, thresh=10000000000.0)[source]

Calculate Poisson distribution when values are below threshold, otherwise approximate with normal distribution.

Parameters:
  • values (ndarray) – Expectation values for poisson distribution.

  • thresh (float) – Expectation value above which to use Normal distribution approximation.

Returns:

output – (Approximately) Poisson distributed values. Same shape as input values.

Return type:

ndarray

holodeck.gravwaves.sam_calc_gwb_single_eccen_discrete(gwfobs, sam, sepa_evo, eccen_evo, nharms=100, nreals=None)[source]
Parameters:
  • gwfobs ((F,) array_like) – Observer-frame frequencies at which to calculate GWB.

  • sam (Semi_Analytic_Model instance) – Binary population to sample. See holodeck.simple_sam or ‘holodeck.sam`

  • sepa_evo – Separation at each evolution step.

  • eccen_evo ((E,) array_like) – Eccentricities at each evolution step. The same for all binaries, corresponding to fixed binary separations for all binaries.

  • nharms (int, optional) – Number of harmonics to use in calculating GWB.

  • nreals (int or None, optional) – Number of realizations to calculate in Poisson sampling.

Returns:

gwb – GW Background: the characteristic strain of the GWB in each frequency bin. Does not include the strain from the loudest binary in each bin (gwf).

Return type:

(F,) ndarray,

holodeck.gravwaves.sampled_gws_from_sam(sam, fobs_gw, hard=<class 'holodeck.hardening.Hard_GW'>, **kwargs)[source]

Sample the given binary population between the target frequencies, and calculate GW signals.

NOTE: the input fobs are interpretted as bin edges, and GW signals are calculate within the corresponding bins.

Parameters:
  • sam (Semi_Analytic_Model instance,) – Binary population to sample.

  • fobs_gw ((F+1,) array_like,) – Target observer-frame GW-frequencies of interest in units of [1/sec]

  • hard (holodeck.evolution._Hardening instance,) – Binary hardening model used to calculate binary residence time at each frequency.

  • kwargs (dict,) – Additional keyword-arguments passed to sample_sam_with_hardening()

Returns:

  • gff ((F,) ndarry,) – Observer-frame GW-frequencies of the loudest binary in each bin [1/sec].

  • gwf ((F,) ndarry,) – GW Foreground: the characteristic strain of the loudest binary in each frequency bin.

  • gwb ((F,) ndarry,) – GW Background: the characteristic strain of the GWB in each frequency bin. Does not include the strain from the loudest binary in each bin (gwf).