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:
- data
numpy.ndarray
orastropy.units.Quantity
Histogram.
- old_edges
numpy.array
orastropy.units.Quantity
Binning used to calculate
data
.len(old_edges) - 1
needs to equal the length ofdata
along interpolation axis (axis
). If quantity, needs to be compatible tonew_edges
.- new_edges
numpy.array
orastropy.units.Quantity
Binning of new histogram. If quantity, needs to be compatible to
old_edges
.- axisint
Interpolation axis.
- data
- Returns:
numpy.ndarray
orastropy.units.Quantity
Interpolated histogram with dimension according to
data
andnew_edges
. Ifdata
is a quantity, this has the same unit.