ASmooth

class gammapy.detect.ASmooth(kernel=<class 'astropy.convolution.kernels.Gaussian2DKernel'>, method='simple', threshold=5, scales=None)[source]

Bases: object

Adaptively smooth counts image.

Achieves a roughly constant significance of features across the whole image.

Algorithm based on https://ui.adsabs.harvard.edu/abs/2006MNRAS.368…65E

The algorithm was slightly adapted to also allow Li & Ma and TS to estimate the significance of a feature in the image.

Parameters
kernelastropy.convolution.Kernel

Smoothing kernel.

method{‘simple’, ‘asmooth’, ‘lima’}

Significance estimation method.

thresholdfloat

Significance threshold.

scalesQuantity

Smoothing scales.

Methods Summary

kernels(self, pixel_scale)

Ring kernels according to the specified method.

make_scales(n_scales[, factor, kernel])

Create list of Gaussian widths.

run(self, counts[, background, exposure])

Run image smoothing.

Methods Documentation

kernels(self, pixel_scale)[source]

Ring kernels according to the specified method.

Parameters
pixel_scaleAngle

Sky image pixel scale

Returns
kernelslist

List of Kernel

static make_scales(n_scales, factor=1.4142135623730951, kernel=<class 'astropy.convolution.kernels.Gaussian2DKernel'>)[source]

Create list of Gaussian widths.

run(self, counts, background=None, exposure=None)[source]

Run image smoothing.

Parameters
countsWcsNDMap

Counts map

backgroundWcsNDMap

Background map

exposureWcsNDMap

Exposure map

Returns
imagesdict of WcsNDMap
Smoothed images; keys are:
  • ‘counts’

  • ‘background’

  • ‘flux’ (optional)

  • ‘scales’

  • ‘significance’.