ASmoothMapEstimator

class gammapy.estimators.ASmoothMapEstimator(scales=None, kernel=<class 'astropy.convolution.kernels.Gaussian2DKernel'>, spectrum=None, method='lima', threshold=5, energy_edges=None)[source]

Bases: gammapy.estimators.Estimator

Adaptively smooth counts image.

Achieves a roughly constant sqrt_ts 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 sqrt_ts of a feature in the image.

Parameters
scalesQuantity

Smoothing scales.

kernelastropy.convolution.Kernel

Smoothing kernel.

spectrumSpectralModel

Spectral model assumption

method{‘asmooth’, ‘lima’}

Significance estimation method.

thresholdfloat

Significance threshold.

Attributes Summary

config_parameters

Config parameters

selection_optional

tag

Methods Summary

copy()

Copy estimator

estimate_maps(dataset)

Run adaptive smoothing on input Maps.

get_kernels(pixel_scale)

Get kernels according to the specified method.

get_scales(n_scales[, factor, kernel])

Create list of Gaussian widths.

get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

run(dataset)

Run adaptive smoothing on input MapDataset.

selection_all()

Which quantities are computed

Attributes Documentation

config_parameters

Config parameters

selection_optional
tag = 'ASmoothMapEstimator'

Methods Documentation

copy()

Copy estimator

estimate_maps(dataset)[source]

Run adaptive smoothing on input Maps.

Parameters
datasetMapDataset

Dataset

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

  • ‘background’

  • ‘flux’ (optional)

  • ‘scales’

  • ‘sqrt_ts’.

get_kernels(pixel_scale)[source]

Get kernels according to the specified method.

Parameters
pixel_scaleAngle

Sky image pixel scale

Returns
kernelslist

List of Kernel

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

Create list of Gaussian widths.

Parameters
n_scalesint

Number of scales

factorfloat

Incremental factor

Returns
scalesndarray

Scale array

static get_sqrt_ts(ts, norm)

Compute sqrt(TS) value.

Compute sqrt(TS) as defined by:

\[\begin{split}\sqrt{TS} = \left \{ \begin{array}{ll} -\sqrt{TS} & : \text{if} \ norm < 0 \\ \sqrt{TS} & : \text{else} \end{array} \right.\end{split}\]
Parameters
tsndarray

TS value.

normndarray

norm value

Returns
——-
sqrt_tsndarray

Sqrt(TS) value.

run(dataset)[source]

Run adaptive smoothing on input MapDataset.

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’

  • ‘sqrt_ts’.

selection_all()[source]

Which quantities are computed