popsynth.distribution module¶
-
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
-
form¶ The latex form of the distribution
Returns:
-
name¶ The name of the distribution
Returns:
-
params¶ The parameters of the distribution
-
truth¶ value of the parameters used to simulate
-
-
class
popsynth.distribution.DistributionParameter(default: Optional[float] = None, vmin: Optional[float] = None, vmax: Optional[float] = None, free: bool = True)[source]¶
-
class
popsynth.distribution.LuminosityDistribution(name: str, seed: int, form: Optional[str] = None)[source]¶ Bases:
popsynth.distribution.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
-
-
class
popsynth.distribution.SpatialContainer(distance: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]], theta: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]], phi: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]])[source]¶ Bases:
objectContainer for 3D spatial values.
-
__init__(distance: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]], theta: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]], phi: Union[Sequence[Sequence[Sequence[Sequence[Sequence[Any]]]]], numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype], Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]], Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]], Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]], Sequence[Sequence[Sequence[Sequence[numpy.typing._array_like._SupportsArray[numpy.dtype][numpy.dtype]]]]], bool, int, float, complex, str, bytes, Sequence[Union[bool, int, float, complex, str, bytes]], Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]], Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]], Sequence[Sequence[Sequence[Sequence[Union[bool, int, float, complex, str, bytes]]]]]]) → None¶
-
dec¶
-
ra¶
-
-
class
popsynth.distribution.SpatialDistribution(name: str, seed: int, form: Optional[str] = None)[source]¶ Bases:
popsynth.distribution.Distribution-
__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
-
dNdV(distance)[source]¶ The differential number of objects per volume element
Parameters: distance – Returns:
-
dec¶ The declination of the objects
Returns:
-
distances¶ the distances to the objects
Returns:
-
draw_distance(size: int) → None[source]¶ Draw the distances from the specified dN/dr model.
Parameters: size (int) – Number of distances to sample
-
draw_sky_positions(size: int) → None[source]¶ Draw teh sky positions of the objects
Parameters: size (int) – Returns:
-
phi¶ the longitudinal coordinate fo the objects
Returns:
-
r_max¶
-
ra¶ the right acension of the objects
Returns:
-
spatial_values¶ All the spatial values of the objects :returns:
-
theta¶ the polar coordinate of the objects
Returns:
-