popsynth.distributions.cosmological_distribution module

class popsynth.distributions.cosmological_distribution.CosmologicalDistribution(seed: int = 1234, name: str = 'cosmo', form: Optional[str] = None, truth: Dict[str, Any] = {}, is_rate: bool = True)[source]

Bases: SpatialDistribution

__init__(seed: int = 1234, name: str = 'cosmo', form: Optional[str] = None, truth: Dict[str, Any] = {}, is_rate: bool = True)[source]

Base class for cosmological spatial distributions.

Parameters
  • seed (int) – Random seed

  • name (str) – Name of the distribution

  • form (str) – Mathematical description of distribution

  • truth (dict[str, Any]) – True values of parameters

  • is_rate (bool) – True if modelling a population of transient events, False if modelling a population of steady-state objects. Affects the time_adjustment method used in cosmo calculations. Default is True.

differential_volume(z)[source]

Differential comoving volume in Gpc^3 sr^-1.

dV/dzdOmega

Parameters

z – Redshift

Returns

The differential comoving volume in Gpc^-3 sr^-1.

transform(L, z)[source]

Transformation from luminosity to energy flux.

L / 4 pi dL^2

dL is in cm. Therefore for L in erg s^-1 returns flux in erg cm^-2 s^-1.

Parameters
  • L – Luminosity

  • z – Redshift

Returns

Flux

time_adjustment(z)[source]

Time adjustment factor to handle both transient and steady-state populations.

Parameters

z – Redshift

Returns

Appropriate factor depending on is_rate

class popsynth.distributions.cosmological_distribution.SFRDistribution(seed: int = 1234, name: str = 'sfr', is_rate: bool = True)[source]

Bases: CosmologicalDistribution

r0
a
rise
decay
peak
__init__(seed: int = 1234, name: str = 'sfr', is_rate: bool = True)[source]

A star-formation like distribution of the form presented in Cole et al. 2001.

r0``(``a``+``rise``z)/(1 + (z/``peak)^``decay``)

Parameters
  • seed (int) – Random seed

  • name (str) – Name of the distribution

  • is_rate (bool) – True if modelling a population of transient events, False if modelling a population of steady-state objects. Affects the time_adjustment method used in cosmo calculations. Default is True.

  • r0 (DistributionParameter) – The local density in units of Gpc^-3

  • a (DistributionParameter) – Offset at z=0

  • rise (DistributionParameter) – Rise at low z

  • decay (DistributionParameter) – Decay at high z

  • peak (DistributionParameter) – Peak of z distribution

dNdV(z)[source]

The differential number of objects per volume element

Parameters

distance

Returns

class popsynth.distributions.cosmological_distribution.ZPowerCosmoDistribution(seed: int = 1234, name: str = 'zpow_cosmo', is_rate: bool = True)[source]

Bases: CosmologicalDistribution

Lambda
delta
__init__(seed: int = 1234, name: str = 'zpow_cosmo', is_rate: bool = True)[source]

A cosmological distribution where the density evolves as a power law.

Lambda (1+z)^``delta``

Parameters
  • seed (int) – Random seed

  • name (str) – Name of the distribution

  • is_rate (bool) – True if modelling a population of transient events, False if modelling a population of steady-state objects. Affects the time_adjustment method used in cosmo calculations. Default is True.

  • Lambda (DistributionParameter) – The local density in units of Gpc^-3

  • delta (DistributionParameter) – The index of the power law

dNdV(distance)[source]

The differential number of objects per volume element

Parameters

distance

Returns