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

differential_volume(r)[source]

The differential volume

Parameters

distance – Distance

transform(L, r)[source]

The transform from luminosity to flux for the

Parameters
  • flux

  • distance

Returns

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

dNdV(distance)[source]

The differential number of objects per volume element

Parameters

distance

Returns

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

dNdV(distance)[source]

The differential number of objects per volume element

Parameters

distance

Returns