resample_histogram1d

pyirf.binning.resample_histogram1d(data, old_edges, new_edges, axis=0)[source]

Rebinning of a histogram by interpolation along a given axis.

Parameters:
datanumpy.ndarray or astropy.units.Quantity

Histogram.

old_edgesnumpy.array or astropy.units.Quantity

Binning used to calculate data. len(old_edges) - 1 needs to equal the length of data along interpolation axis (axis). If quantity, needs to be compatible to new_edges.

new_edgesnumpy.array or astropy.units.Quantity

Binning of new histogram. If quantity, needs to be compatible to old_edges.

axisint

Interpolation axis.

Returns:
numpy.ndarray or astropy.units.Quantity

Interpolated histogram with dimension according to data and new_edges. If data is a quantity, this has the same unit.