RingBackgroundEstimator

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

Bases: object

Ring background method for cartesian coordinates.

Step 1: apply exclusion mask Step 2: ring-correlate Step 3: apply psi cut

TODO: add method to apply the psi cut

Parameters:

r_in : Quantity

Inner ring radius

width : Quantity

Ring width.

use_fft_convolution : bool

Use fft convolution.

Examples

Here’s an example how to use the RingBackgroundEstimator:

from astropy import units as u
from gammapy.background import RingBackgroundEstimator
from gammapy.image import SkyImageList

filename = '$GAMMAPY_EXTRA/test_datasets/unbundled/poisson_stats_image/input_all.fits.gz'
images = SkyImageList.read(filename)
images['exposure'].name = 'exposure_on'
ring_bkg = RingBackgroundEstimator(r_in=0.35 * u.deg, width=0.3 * u.deg)
results = ring_bkg.run(images)
results['background'].show()

Methods Summary

info() Print summary info about the parameters.
kernel(image) Ring kernel.
run(images) Run ring background algorithm.

Methods Documentation

info()[source]

Print summary info about the parameters.

kernel(image)[source]

Ring kernel.

Parameters:

image : gammapy.image.SkyImage

Image

Returns:

ring : Ring2DKernel

Ring kernel.

run(images)[source]

Run ring background algorithm.

Required sky images: {required}

Parameters:

images : SkyImageList

Input sky images.

Returns:

result : SkyImageList

Result sky images