Reference / binference.selection.as_selection

binference.selection.as_selection

binference.selection.as_selection(selection, mode, bins)[source]

Normalise user input: None, a Selection, a callable or an array plus mode.

A raw array is checked for steep changes between neighbouring bins; a Selection or a callable is taken as already averaged within bins. With a Basis, arrays and selections given per bin are mapped to the components (\(\phi_k\)-weighted averages) and callables are averaged on the basis’s quadrature cells.

Parameters:
selectionNone, Selection, callable or array_like

The selection as the user gave it.

modestr or None

selection_mode, required with a callable or an array.

binsBins or Basis

Bins of the model.