popsynth.selection_probability.selection_probability module

class popsynth.selection_probability.selection_probability.SelectionParameter(default: Optional[float] = None, vmin: Optional[float] = None, vmax: Optional[float] = None, free: bool = True, is_normalization: bool = False)[source]

Bases: Parameter

class popsynth.selection_probability.selection_probability.SelectionProbability(name: str = 'name', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

Bases: object

__init__(name: str = 'name', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False) None[source]

Base class for selections on a population.

Parameters
  • name (str) – Name of the selection

  • use_obs_value (bool) – If True, make selection on observed_value. False by default.

  • use_distance (bool) – If True make selection on distance. False by default.

  • use_luminosity (bool) – If True make selection on luminosity. False by default.

  • use_flux (bool) – If True make selection on flux. False by default.

set_luminosity(luminosity: ndarray) None[source]

Set the luminosity of the selection.

set_distance(distance: ndarray) None[source]

Set the distance of the selection.

set_observed_flux(observed_flux: ndarray) None[source]

Set the observed flux of the selection.

set_observed_value(observed_value: ndarray) None[source]

Set the observed value of the selection.

abstract classmethod draw(size: int) None[source]
reset()[source]

Reset the selector.

select(size: int)[source]
property parameters: Dict[str, float]
property selection: ndarray
property n_selected: int
property n_non_selected: int
property n_objects: int
property selection_index: ndarray
property non_selection_index: ndarray
property name: str
class popsynth.selection_probability.selection_probability.DummySelection[source]

Bases: SelectionProbability

__init__()[source]

A Dummy selection for testing.

draw(size=1)[source]