gammapy.spectrum.integrate_spectrum(func, xmin, xmax, ndecade=100, intervals=False)[source]

Integrate 1d function using the log-log trapezoidal rule. If scalar values

for xmin and xmax are passed an oversampled grid is generated using the ndecade keyword argument. If xmin and xmax arrays are passed, no oversampling is performed and the integral is computed in the provided grid.

func : callable

Function to integrate.

xmin : Quantity or array-like

Integration range minimum

xmax : Quantity or array-like

Integration range minimum

ndecade : int, optional

Number of grid points per decade used for the integration. Default : 100.

intervals : bool, optional

Return integrals in the grid not the sum, default: False