popsynth.distribution module
- class popsynth.distribution.DistributionParameter(default: Optional[float] = None, vmin: Optional[float] = None, vmax: Optional[float] = None, free: bool = True, is_normalization: bool = False)[source]
Bases:
Parameter
- class popsynth.distribution.Distribution(name: str, seed: int, form: str)[source]
Bases:
object
- __init__(name: str, seed: int, form: str) None [source]
A distribution base class.
- Parameters
name (str) – Name of the distribution
seed (int) – Random seed
form (str) – the LaTeX form
- property normalization_parameter: Optional[float]
- property name: str
The name of the distribution
- Returns
- property form: str
The latex form of the distribution
- Returns
- property params: Dict[str, float]
The parameters of the distribution
- property truth: Dict[str, float]
value of the parameters used to simulate
- property probability: ndarray
- class popsynth.distribution.SpatialContainer(distance: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], theta: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], phi: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]])[source]
Bases:
object
Container for 3D spatial values.
- distance: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]
- theta: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]
- phi: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]
- property dec: ndarray
- property ra: ndarray
- __init__(distance: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], theta: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], phi: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]]) None
- class popsynth.distribution.SpatialDistribution(name: str, seed: int, form: Optional[str] = None)[source]
Bases:
Distribution
- r_max
- __init__(name: str, seed: int, form: Optional[str] = None)[source]
A base class for spatial distributions, such as redshift distributions.
- Parameters
name (str) – Name of the distribution
seed (int) – Random seed
form (Union[str, None]) – the LaTeX form
- abstract differential_volume(distance)[source]
The differential volume
- Parameters
distance – Distance
- abstract dNdV(distance)[source]
The differential number of objects per volume element
- Parameters
distance –
- Returns
- abstract transform(flux, distance)[source]
The transform from luminosity to flux for the
- Parameters
flux –
distance –
- Returns
- property theta: ndarray
the polar coordinate of the objects
- Returns
- property phi: ndarray
the longitudinal coordinate fo the objects
- Returns
- property dec: ndarray
The declination of the objects
- Returns
- property ra: ndarray
the right acension of the objects
- Returns
- property distances: ndarray
the distances to the objects
- Returns
- property spatial_values
All the spatial values of the objects :returns:
- class popsynth.distribution.LuminosityDistribution(name: str, seed: int, form: Optional[str] = None)[source]
Bases:
Distribution
- __init__(name: str, seed: int, form: Optional[str] = None)[source]
A base class for luminosity distributions.
- Parameters
name (str) – Name of the distribution
seed (int) – Random seed
form (Union[str, None]) – the LaTeX form
- abstract phi(luminosity)[source]
The functional form of the distribution. not required for sampling :param luminosity: Luminosity