popsynth.distributions package
Submodules
popsynth.distributions.bpl_distribution module
- class popsynth.distributions.bpl_distribution.BPLDistribution(seed: int = 1234, name: str = 'bpl')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- Lbreak
- beta
- Lmax
- __init__(seed: int = 1234, name: str = 'bpl')[source]
A broken power law luminosity distribution.
L ~ L^``alpha`` for L <=
Lbreak
L ~ L^``beta`` for L >Lbreak
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the lower power lawLbreak (
DistributionParameter
) – Luminosity of the power law breakbeta (
DistributionParameter
) – Index of the upper power lawLmax (
DistributionParameter
) – Maximum value of the luminosity
- popsynth.distributions.bpl_distribution.integrate_pl(x0, x1, x2, a1, a2)[source]
Integrate a broken power law between bounds.
- Parameters
x0 – Lower bound
x1 – Break point
x2 – Upper bound
a1 – Lower power law index
a2 – Upper power low index
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.
- 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^-3a (
DistributionParameter
) – Offset at z=0rise (
DistributionParameter
) – Rise at low zdecay (
DistributionParameter
) – Decay at high zpeak (
DistributionParameter
) – Peak of z distribution
- 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^-3delta (
DistributionParameter
) – The index of the power law
popsynth.distributions.delta_distribution module
- class popsynth.distributions.delta_distribution.DeltaDistribution(seed: int = 1234, name: str = 'delta')[source]
Bases:
LuminosityDistribution
- Lp
- __init__(seed: int = 1234, name: str = 'delta')[source]
A delta function luminosity distribution, centred on
Lp
.- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lp (
DistributionParameter
) – The central value
popsynth.distributions.flatland_distribution module
- class popsynth.distributions.flatland_distribution.FlatlandDistribution(seed: int = 1234, name: str = 'flatland', form: Optional[str] = None)[source]
Bases:
SpatialDistribution
- Lambda
- __init__(seed: int = 1234, name: str = 'flatland', form: Optional[str] = None)[source]
A flat spatial distribution with only length.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
Lambda (
DistributionParameter
) – Length
popsynth.distributions.log10_normal_distribution module
- class popsynth.distributions.log10_normal_distribution.Log10NormalDistribution(seed: int = 1234, name: str = 'log10norm')[source]
Bases:
LuminosityDistribution
- mu
- tau
- __init__(seed: int = 1234, name: str = 'log10norm')[source]
A log10-normal luminosity function
Log10Normal(
mu
,tau
)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
mu (
DistributionParameter
) – Mean of the log10 normaltau (
DistributionParameter
) – Standard deviation of the log10 normal
popsynth.distributions.log_normal_distribution module
- class popsynth.distributions.log_normal_distribution.LogNormalDistribution(seed: int = 1234, name: str = 'lognorm')[source]
Bases:
LuminosityDistribution
- mu
- tau
- __init__(seed: int = 1234, name: str = 'lognorm')[source]
A log-normal luminosity distribution.
LogNormal(
mu
,tau
)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
mu (
DistributionParameter
) – Mean of the log normaltau (
DistributionParameter
) – Standard deviation of the log normal
popsynth.distributions.pareto_distribution module
- class popsynth.distributions.pareto_distribution.ParetoDistribution(seed: int = 1234, name: str = 'pareto')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- __init__(seed: int = 1234, name: str = 'pareto')[source]
A Pareto luminosity function.
alpha``*``Lmin``^``alpha
/ L^(``alpha``+1)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the pareto distribution
popsynth.distributions.schechter_distribution module
- class popsynth.distributions.schechter_distribution.SchechterDistribution(seed: int = 1234, name: str = 'schechter')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- __init__(seed: int = 1234, name: str = 'schechter')[source]
A Schechter luminosity function as in Schechter, Astrophysical Journal, Vol. 203, p. 297-306 (1976).
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the distribution
popsynth.distributions.spherical_distribution module
- class popsynth.distributions.spherical_distribution.SphericalDistribution(seed: int = 1234, name: str = 'sphere', form: Optional[str] = None)[source]
Bases:
SpatialDistribution
- __init__(seed: int = 1234, name: str = 'sphere', form: Optional[str] = None)[source]
A generic spherical distribution. Can be inherited to form more complex spherical distributions
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
- class popsynth.distributions.spherical_distribution.ConstantSphericalDistribution(seed: int = 1234, name: str = 'cons_sphere', form: Optional[str] = None)[source]
Bases:
SphericalDistribution
- Lambda
- __init__(seed: int = 1234, name: str = 'cons_sphere', form: Optional[str] = None)[source]
A spherical distribution with constant density.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
Lambda (
DistributionParameter
) – Density per unit volume
- class popsynth.distributions.spherical_distribution.ZPowerSphericalDistribution(seed: int = 1234, name: str = 'zpow_sphere')[source]
Bases:
ConstantSphericalDistribution
- delta
- __init__(seed: int = 1234, name: str = 'zpow_sphere')[source]
A spherical distribution with a power law density profile.
Lambda
(1+r)^``delta``- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
delta (
DistributionParameter
) – Index of power law distribution
popsynth.distributions.spiral_galaxy_distribution module
- class popsynth.distributions.spiral_galaxy_distribution.SpiralGalaxyDistribution(seed: int = 1234, name: str = 'spiral_galaxy', form: Optional[str] = None)[source]
Bases:
SphericalDistribution
- rho
- a
- b
- R1
- R0
- __init__(seed: int = 1234, name: str = 'spiral_galaxy', form: Optional[str] = None)[source]
A spiral galaxy spatial distribution.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
rho (
DistributionParameter
) – Local densitya (
DistributionParameter
) – Shape parameterb (
DistributionParameter
) – Shape parameterR1 (
DistributionParameter
) – Scale parameterR0 (
DistributionParameter
) – Scale parameter
popsynth.distributions.uniform_distribution module
- class popsynth.distributions.uniform_distribution.LogUniLuminiosityDistribution(seed: int = 1234, name: str = 'logunilum')[source]
Bases:
LuminosityDistribution
- Lmin
- Lmax
- __init__(seed: int = 1234, name: str = 'logunilum')[source]
A broken power law luminosity distribution.
L ~ L^``alpha`` for L <=
Lbreak
L ~ L^``beta`` for L >Lbreak
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityLmax (
DistributionParameter
) – Maximum value of the luminosity
- class popsynth.distributions.uniform_distribution.UniformCosmoDistribution(seed: int = 1234, name: str = 'uniform_cosmo', is_rate: bool = True)[source]
Bases:
CosmologicalDistribution
- r0
- zmin
- zmax
- __init__(seed: int = 1234, name: str = 'uniform_cosmo', is_rate: bool = True)[source]
A cosmological distribution where the density evolves uniformly.
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^-3delta (
DistributionParameter
) – The index of the power law
Module contents
- class popsynth.distributions.SphericalDistribution(seed: int = 1234, name: str = 'sphere', form: Optional[str] = None)[source]
Bases:
SpatialDistribution
- __init__(seed: int = 1234, name: str = 'sphere', form: Optional[str] = None)[source]
A generic spherical distribution. Can be inherited to form more complex spherical distributions
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
- class popsynth.distributions.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.
- class popsynth.distributions.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^-3a (
DistributionParameter
) – Offset at z=0rise (
DistributionParameter
) – Rise at low zdecay (
DistributionParameter
) – Decay at high zpeak (
DistributionParameter
) – Peak of z distribution
- class popsynth.distributions.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^-3delta (
DistributionParameter
) – The index of the power law
- class popsynth.distributions.ParetoDistribution(seed: int = 1234, name: str = 'pareto')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- __init__(seed: int = 1234, name: str = 'pareto')[source]
A Pareto luminosity function.
alpha``*``Lmin``^``alpha
/ L^(``alpha``+1)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the pareto distribution
- class popsynth.distributions.Log10NormalDistribution(seed: int = 1234, name: str = 'log10norm')[source]
Bases:
LuminosityDistribution
- mu
- tau
- __init__(seed: int = 1234, name: str = 'log10norm')[source]
A log10-normal luminosity function
Log10Normal(
mu
,tau
)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
mu (
DistributionParameter
) – Mean of the log10 normaltau (
DistributionParameter
) – Standard deviation of the log10 normal
- class popsynth.distributions.LogNormalDistribution(seed: int = 1234, name: str = 'lognorm')[source]
Bases:
LuminosityDistribution
- mu
- tau
- __init__(seed: int = 1234, name: str = 'lognorm')[source]
A log-normal luminosity distribution.
LogNormal(
mu
,tau
)- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
mu (
DistributionParameter
) – Mean of the log normaltau (
DistributionParameter
) – Standard deviation of the log normal
- class popsynth.distributions.SchechterDistribution(seed: int = 1234, name: str = 'schechter')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- __init__(seed: int = 1234, name: str = 'schechter')[source]
A Schechter luminosity function as in Schechter, Astrophysical Journal, Vol. 203, p. 297-306 (1976).
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the distribution
- class popsynth.distributions.BPLDistribution(seed: int = 1234, name: str = 'bpl')[source]
Bases:
LuminosityDistribution
- Lmin
- alpha
- Lbreak
- beta
- Lmax
- __init__(seed: int = 1234, name: str = 'bpl')[source]
A broken power law luminosity distribution.
L ~ L^``alpha`` for L <=
Lbreak
L ~ L^``beta`` for L >Lbreak
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityalpha (
DistributionParameter
) – Index of the lower power lawLbreak (
DistributionParameter
) – Luminosity of the power law breakbeta (
DistributionParameter
) – Index of the upper power lawLmax (
DistributionParameter
) – Maximum value of the luminosity
- class popsynth.distributions.ConstantSphericalDistribution(seed: int = 1234, name: str = 'cons_sphere', form: Optional[str] = None)[source]
Bases:
SphericalDistribution
- Lambda
- __init__(seed: int = 1234, name: str = 'cons_sphere', form: Optional[str] = None)[source]
A spherical distribution with constant density.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
Lambda (
DistributionParameter
) – Density per unit volume
- class popsynth.distributions.ZPowerSphericalDistribution(seed: int = 1234, name: str = 'zpow_sphere')[source]
Bases:
ConstantSphericalDistribution
- delta
- __init__(seed: int = 1234, name: str = 'zpow_sphere')[source]
A spherical distribution with a power law density profile.
Lambda
(1+r)^``delta``- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
delta (
DistributionParameter
) – Index of power law distribution
- class popsynth.distributions.DeltaDistribution(seed: int = 1234, name: str = 'delta')[source]
Bases:
LuminosityDistribution
- Lp
- __init__(seed: int = 1234, name: str = 'delta')[source]
A delta function luminosity distribution, centred on
Lp
.- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lp (
DistributionParameter
) – The central value
- class popsynth.distributions.FlatlandDistribution(seed: int = 1234, name: str = 'flatland', form: Optional[str] = None)[source]
Bases:
SpatialDistribution
- Lambda
- __init__(seed: int = 1234, name: str = 'flatland', form: Optional[str] = None)[source]
A flat spatial distribution with only length.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
Lambda (
DistributionParameter
) – Length
- class popsynth.distributions.SpiralGalaxyDistribution(seed: int = 1234, name: str = 'spiral_galaxy', form: Optional[str] = None)[source]
Bases:
SphericalDistribution
- rho
- a
- b
- R1
- R0
- __init__(seed: int = 1234, name: str = 'spiral_galaxy', form: Optional[str] = None)[source]
A spiral galaxy spatial distribution.
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
form (str) – Mathematical description of distribution
rho (
DistributionParameter
) – Local densitya (
DistributionParameter
) – Shape parameterb (
DistributionParameter
) – Shape parameterR1 (
DistributionParameter
) – Scale parameterR0 (
DistributionParameter
) – Scale parameter
- class popsynth.distributions.LogUniLuminiosityDistribution(seed: int = 1234, name: str = 'logunilum')[source]
Bases:
LuminosityDistribution
- Lmin
- Lmax
- __init__(seed: int = 1234, name: str = 'logunilum')[source]
A broken power law luminosity distribution.
L ~ L^``alpha`` for L <=
Lbreak
L ~ L^``beta`` for L >Lbreak
- Parameters
seed (int) – Random seed
name (str) – Name of the distribution
Lmin (
DistributionParameter
) – Minimum value of the luminosityLmax (
DistributionParameter
) – Maximum value of the luminosity
- class popsynth.distributions.UniformCosmoDistribution(seed: int = 1234, name: str = 'uniform_cosmo', is_rate: bool = True)[source]
Bases:
CosmologicalDistribution
- r0
- zmin
- zmax
- __init__(seed: int = 1234, name: str = 'uniform_cosmo', is_rate: bool = True)[source]
A cosmological distribution where the density evolves uniformly.
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^-3delta (
DistributionParameter
) – The index of the power law