Background estimation and modeling (gammapy.background)


gammapy.background contains methods to estimate and model background for specral, image based and cube analyses.

Most of the methods implemented are described in [Berge2007]. Section 7.3 “Background subtraction” and Section 7.4 “Acceptance determination and predicted background” in [Naurois2012] describe mostly the same methods as [Berge2007], except for the “2D acceptance model” described in Section 7.4.3.

The background models implemented in Gammapy are documented in Background models.

Getting Started

  • TODO: example how to read and use a 2D and A 3D background model

Using gammapy.background

If you’d like to learn more about using gammapy.background, read the following sub-pages:


gammapy.background Package

Background estimation and modeling methods.


fill_acceptance_image(header, center, ...[, ...]) Generate a 2D image of a radial acceptance curve.
ring_alpha(theta, r_in, r_out) Compute ring alpha, the inverse area factor.
ring_area_factor(theta, r_in, r_out) Compute ring area factor.
ring_background_estimate(pos, on_radius, ...) Simple ring background estimate.
ring_r_out(theta, r_in, area_factor) Compute ring outer radius.


AdaptiveRingBackgroundEstimator(r_in, ...[, ...]) Adaptive ring background algorithm.
BackgroundEstimate(on_region, on_events, ...) Container class for background estimate.
EnergyOffsetArray(energy, offset[, data, ...]) Energy offset dependent array.
EnergyOffsetBackgroundModel(energy, offset) EnergyOffsetArray background model.
FOVCube([coordx_edges, coordy_edges, ...]) Field of view cube.
FOVCubeBackgroundModel([counts_cube, ...]) Field of view (FOV) cube background model.
GaussianBand2D(table[, spline_kwargs]) Gaussian band model.
OffDataBackgroundMaker(data_store[, outdir, ...]) OffDataBackgroundMaker class.
ReflectedRegionsBackgroundEstimator(...) Reflected Regions background estimator.
ReflectedRegionsFinder(region, center[, ...]) Find reflected regions.
RingBackgroundEstimator(r_in, width) Ring background method for cartesian coordinates.