binny.binning.assignments module#

Selection functions for generic tomographic binning.

binny.binning.assignments.deterministic_assignment(z: NDArray[float64], edges: NDArray[float64], *, completeness: Sequence[float] | float = 1.0, response_matrix: NDArray[float64] | None = None) → NDArray[float64]#

Return deterministic bin selections with optional mixing.

Parameters:
  • z – Grid of the binning coordinate.

  • edges – Bin edges in the same coordinate.

  • completeness – Scalar or per-bin completeness.

  • response_matrix – Optional response matrix mapping true bins to observed bins.

Returns:

Selection array with shape (n_bins, n_z).

binny.binning.assignments.specz_selection_in_bin(z: NDArray[float64], bin_min: float, bin_max: float, completeness: float = 1.0, *, inclusive_right: bool = False) → NDArray[float64]#

Evaluate a deterministic selection window.

Parameters:
  • z – Redshift or other selection-coordinate grid.

  • bin_min – Lower bin edge.

  • bin_max – Upper bin edge.

  • completeness – Selection completeness in [0, 1].

  • inclusive_right – Whether to include the upper edge.

Returns:

Selection weights evaluated on the input grid.

Raises:

ValueError – If completeness is outside [0, 1].