popsynth.selection_probability.generic_selectors module

class popsynth.selection_probability.generic_selectors.UnitySelection(name='unity')[source]

Bases: SelectionProbability

__init__(name='unity')[source]

A selection that returns all selected.

Parameters

name – Name of the selection

draw(size: int) None[source]
class popsynth.selection_probability.generic_selectors.BernoulliSelection[source]

Bases: SelectionProbability

probability
__init__() None[source]

A Bernoulli selection with probability as a parameter.

Parameters

probability (SelectionParameter) – Probability for each Bernoulli trial

draw(size: int) None[source]
class popsynth.selection_probability.generic_selectors.BoxSelection(name: str = 'box selection', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

Bases: SelectionProbability

vmin
vmax
__init__(name: str = 'box selection', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

A box selection on observed_value, distance, luminosity or flux.

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.

  • vmin (SelectionParameter) – Minimum value of selection

  • vmax (SelectionParameter) – Maximum value of selection

draw(size: int) ndarray[source]
class popsynth.selection_probability.generic_selectors.LowerBound(name: str = 'Hard selection', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

Bases: SelectionProbability

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

A hard, lower bound selection on obs_value, distance, luminosity or flux.

Selects values >= boundary.

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.

  • boundary (SelectionParameter) – Value of the selection boundary

draw(size: int) None[source]
class popsynth.selection_probability.generic_selectors.UpperBound(name: str = 'Hard selection', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

Bases: SelectionProbability

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

A hard, upper bound selection on obs_value, distance, luminosity or flux.

Selects values <= boundary.

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.

  • boundary (SelectionParameter) – Value of the selection boundary

draw(size: int) None[source]
class popsynth.selection_probability.generic_selectors.SoftSelection(name: str = 'Soft Selection', use_obs_value: bool = False, use_distance: bool = False, use_luminosity: bool = False, use_flux: bool = False)[source]

Bases: SelectionProbability

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

A soft selection using an inverse logit function either on the log or linear value of the observed_value, distance, luminosity or flux.

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.

  • boundary (SelectionParameter) – Center of the inverse logit

  • strength (SelectionParameter) – Width of the logit

draw(size: int, use_log=True) None[source]