class gammapy.cube.AdaptiveRingBackgroundEstimator(r_in, r_out_max, width, stepsize='0.02 deg', threshold_alpha=0.1, theta='0.22 deg', method='fixed_width')[source]

Bases: object

Adaptive ring background algorithm.

This algorithm extends the RingBackgroundEstimator method by adapting the size of the ring to achieve a minimum on / off exposure ratio (alpha) in regions where the area to estimate the background from is limited.

r_in : Quantity

Inner radius of the ring.

r_out_max : Quantity

Maximal outer radius of the ring.

width : Quantity

Width of the ring.

stepsize : Quantity

Stepsize used for increasing the radius.

threshold_alpha : float

Threshold on alpha above which the adaptive ring takes action.

theta : Quantity

Integration radius used for alpha computation.

method : {‘fixed_width’, ‘fixed_r_in’}

Adaptive ring method.


Example using AdaptiveRingBackgroundEstimator:

from gammapy.maps import Map
from gammapy.cube import AdaptiveRingBackgroundEstimator

filename = '$GAMMAPY_DATA/tests/unbundled/poisson_stats_image/input_all.fits.gz'
images = {
    'counts':, hdu='counts'),
    'exposure_on':, hdu='exposure'),
    'exclusion':, hdu='exclusion'),

adaptive_ring_bkg = AdaptiveRingBackgroundEstimator(
    r_in='0.22 deg',
    r_out_max='0.8 deg',
    width='0.1 deg',
results =

Attributes Summary

parameters Parameter dict.

Methods Summary

kernels(self, image) Ring kernels according to the specified method.
run(self, images) Run adaptive ring background algorithm.

Attributes Documentation


Parameter dict.

Methods Documentation

kernels(self, image)[source]

Ring kernels according to the specified method.

image : WcsNDMap

Map specifying the WCS information.

kernels : list

List of Ring2DKernel

run(self, images)[source]

Run adaptive ring background algorithm.

images : dict of WcsNDMap

Input sky maps.

result : dict of WcsNDMap

Result sky maps.