evaluate_binned_cut_by_index

pyirf.cuts.evaluate_binned_cut_by_index(values, bin_index, valid, cut_table, op)[source]

Evaluate a binned cut as defined in cut_table with pre-computed bin index.

This is an optimization over evaluating evaluate_binned_cut multiple times with the same values to prevent re-computation of the index.

Parameters:
values: ``~numpy.ndarray`` or ``~astropy.units.Quantity``

The values on which the cut should be evaluated

bin_index: ``~numpy.ndarray``

The index into cut_table corresponding to the entries in values.

cut_table: ``~astropy.table.Table``

A table describing the binned cuts, e.g. as created by ~pyirf.cuts.calculate_percentile_cut. Required columns: - low: lower edges of the bins - high: upper edges of the bins, - cut: cut value

op: callable(a, b) -> bool

A function taking two arguments, comparing element-wise and returning an array of booleans. Must support vectorized application.