Binning and Histogram Utilities

Reference/API

pyirf.binning Module

Utility functions for binning

Functions

add_overflow_bins(bins[, positive])

Add under and overflow bins to a bin array.

bin_center(edges)

calculate_bin_indices(data, bins)

Calculate bin indices of inidividula entries of the given data array using the supplied binning.

create_bins_per_decade(e_min, e_max[, ...])

Create a bin array with bins equally spaced in logarithmic energy with bins_per_decade bins per decade.

create_histogram_table(events, bins[, key])

Histogram a variable from events data into an astropy table.

join_bin_lo_hi(bin_lo, bin_hi)

Function joins bins into lo and hi part, e.g. [0, 1, 2] and [1, 2, 4] into [0, 1, 2, 4] It works on multidimentional arrays as long as the binning is in the last axis.

resample_histogram1d(data, old_edges, new_edges)

Rebinning of a histogram by interpolation along a given axis.

split_bin_lo_hi(bins)

Inverted function to join_bin_hi_lo, e.g. it splits [0, 1, 2, 4] into [0, 1, 2] and [1, 2, 4].