RingBackgroundEstimator

class gammapy.background.RingBackgroundEstimator(r_in, width)[source]

Bases: object

Ring background method for cartesian coordinates.

  • Step 1: apply exclusion mask
  • Step 2: ring-correlate
Parameters:
r_in : Quantity

Inner ring radius

width : Quantity

Ring width.

use_fft_convolution : bool

Use FFT convolution?

Examples

Example using RingBackgroundEstimator:

from gammapy.maps import Map
from gammapy.background import RingBackgroundEstimator

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

ring_bkg = RingBackgroundEstimator(r_in='0.35 deg', width='0.3 deg')
results = ring_bkg.run(images)
results['background'].plot()

Attributes Summary

parameters dict of parameters

Methods Summary

kernel(image) Ring kernel.
run(images) Run ring background algorithm.

Attributes Documentation

parameters

dict of parameters

Methods Documentation

kernel(image)[source]

Ring kernel.

Parameters:
image : WcsNDMap

Input Map

Returns:
ring : Ring2DKernel

Ring kernel.

run(images)[source]

Run ring background algorithm.

Required Maps: {required}

Parameters:
images : dict of WcsNDMap

Input sky maps.

Returns:
result : dict of WcsNDMap

Result sky maps