calculate_percentile_cut
- pyirf.cuts.calculate_percentile_cut(values, bin_values, bins, fill_value, percentile=68, min_value=None, max_value=None, smoothing=None, min_events=10)[source]
Calculate cuts as the percentile of a given quantity in bins of another quantity.
- Parameters:
- values: ``~numpy.ndarray`` or ``~astropy.units.Quantity``
The values for which the cut should be calculated
- bin_values: ``~numpy.ndarray`` or ``~astropy.units.Quantity``
The values used to sort the
values
into bins- edges: ``~numpy.ndarray`` or ``~astropy.units.Quantity``
Bin edges
- fill_value: float or quantity
Value for bins with less than
min_events
, must have same unit as values- percentile: float
The percentile to calculate in each bin as a percentage, i.e. 0 <= percentile <= 100.
- min_value: float or quantity or None
If given, cuts smaller than this value are replaced with
min_value
- max_value: float or quantity or None
If given, cuts larger than this value are replaced with
max_value
- smoothing: float or None
If given, apply a gaussian filter of width
sigma
in terms of bins.- min_events: int
Bins with less events than this number are replaced with
fill_value