GWForge.population.mass

Attributes

Classes

Functions

notch_filter(val, parameters)

low_pass_filter(val, parameters)

primary_mass_grid_nodes(parameters, minimum_mass, ...)

Number of primary-mass grid nodes needed to resolve the narrowest peak.

sample_mass_ratio_given_primary(model, ...[, random_state])

Draw mass_ratio conditionally on mass_1, by inverse CDF.

Module Contents

GWForge.population.mass.notch_filter(val, parameters)[source]
GWForge.population.mass.low_pass_filter(val, parameters)[source]
GWForge.population.mass.choices = ['PowerLaw+Peak', 'MultiPeak', 'BrokenPowerLaw', 'BGP', 'UniformSecondary', 'DoubleGaussian',...[source]
GWForge.population.mass.sampler_choices = ['importance_m1_m2', 'importance_m1_q', 'lint'][source]
GWForge.population.mass.BGP_PARAMETERS[source]
GWForge.population.mass.POWER_LAW_PEAK_PARAMETERS[source]
GWForge.population.mass.DEFAULT_PARAMETERS[source]
GWForge.population.mass.CONDITIONAL_SAMPLING_CHUNK = 4096[source]
GWForge.population.mass.NODES_PER_PEAK_WIDTH = 40[source]
GWForge.population.mass.MINIMUM_MASS_GRID_NODES = 1000[source]
GWForge.population.mass.MAXIMUM_MASS_GRID_NODES = 40000[source]
GWForge.population.mass.primary_mass_grid_nodes(parameters, minimum_mass, maximum_mass)[source]

Number of primary-mass grid nodes needed to resolve the narrowest peak.

The smoothed mass models are sampled by wrapping the density in a bilby.core.prior.Interped, which builds a linear interpolant on this grid and inverse-CDF samples from that. The interpolant, not the density, is what the catalogue is drawn from, so the grid has to resolve every feature the density has.

Parameters:
  • parameters (dict) – Mass-model parameters. Any key beginning with sigpp is treated as a peak width; models without peaks keep the floor.

  • minimum_mass (float) – Range the grid spans.

  • maximum_mass (float) – Range the grid spans.

Returns:

Clipped to [MINIMUM_MASS_GRID_NODES, MAXIMUM_MASS_GRID_NODES].

Return type:

int

GWForge.population.mass.sample_mass_ratio_given_primary(model, primary_samples, mass_ratio_parameters, random_state=None)[source]

Draw mass_ratio conditionally on mass_1, by inverse CDF.

Parameters:
  • model (BaseSmoothedMassDistribution) – Supplies the m1s/qs grids and p_q.

  • primary_samples (array_like) – Sampled mass_1_source.

  • mass_ratio_parameters (dict) – beta, mmin and delta_m, and optionally mmin_2 and delta_m_2 for models whose secondary has its own taper.

  • random_state (numpy.random.Generator or None) – Defaults to numpy’s global RNG, so a single seed governs it.

Returns:

Mass-ratio samples, the same length as primary_samples.

Return type:

numpy.ndarray

class GWForge.population.mass.Mass(mass_model='BGP', number_of_samples=1, parameters=None, full_pop_sampler='importance_m1_m2')[source]
mass_model = ''[source]
number_of_samples = 1[source]
parameters[source]
full_pop_sampler = 'importance_m1_m2'[source]
sample(**sampler_kwargs)[source]

Generate mass distribution samples based on the chosen parameterised model and its parameters.

Returns:

dict

Return type:

A dictionary containing source frame mass distribution samples.