ASmoothMapEstimator

class gammapy.estimators.ASmoothMapEstimator(scales, kernel=<class 'astropy.convolution.kernels.Gaussian2DKernel'>, method='lima', threshold=5)[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 to estimate the significance of a feature in the image.

Parameters
scalesQuantity

Smoothing scales.

kernelastropy.convolution.Kernel

Smoothing kernel.

method{‘asmooth’, ‘lima’}

Significance estimation method.

thresholdfloat

Significance threshold.

Methods Summary

estimate_maps(self, counts, background[, …])

Run adaptive smoothing on input Maps.

get_scales(n_scales[, factor, kernel])

Create list of Gaussian widths.

kernels(self, pixel_scale)

Ring kernels according to the specified method.

run(self, dataset)

Run adaptive smoothing on input MapDataset.

Methods Documentation

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

Run adaptive smoothing on input Maps.

Parameters
countsMap

counts map

backgroundMap

estimated background counts map

exposureMap

exposure map. If set, it will produce a flux smoothed map.

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

  • ‘background’

  • ‘flux’ (optional)

  • ‘scales’

  • ‘significance’.

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

Create list of Gaussian widths.

kernels(self, pixel_scale)[source]

Ring kernels according to the specified method.

Parameters
pixel_scaleAngle

Sky image pixel scale

Returns
kernelslist

List of Kernel

run(self, dataset)[source]

Run adaptive smoothing on input MapDataset. The latter should have

Parameters
datasetMapDataset or MapDatasetOnOff

the input dataset (with one bin in energy at most)

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

  • ‘background’

  • ‘flux’ (optional)

  • ‘scales’

  • ‘significance’.