find_peaks_in_flux_map#

gammapy.estimators.utils.find_peaks_in_flux_map(maps, threshold, min_distance=1)[source]#

Find local test statistic peaks for a given Map.

Utilises the find_peaks function to find various parameters from FluxMaps.

Parameters:
mapsFluxMaps

Input flux map object.

thresholdfloat or array-like

The test statistic data value or pixel-wise test statistic data values to be used for the detection threshold. A 2D threshold must have the same. shape as the map data.

min_distanceint or Quantity

Minimum distance between peaks. An integer value is interpreted as pixels. Default is 1.

Returns:
outputTable

Table with parameters of detected peaks.

Examples

>>> import astropy.units as u
>>> from gammapy.datasets import MapDataset
>>> from gammapy.estimators import ExcessMapEstimator
>>> from gammapy.estimators.utils import find_peaks_in_flux_map
>>>
>>> dataset = MapDataset.read("$GAMMAPY_DATA/cta-1dc-gc/cta-1dc-gc.fits.gz")
>>> estimator = ExcessMapEstimator(
...     correlation_radius="0.1 deg", energy_edges=[0.1, 10]*u.TeV
... )
>>> maps = estimator.run(dataset)
>>> # Find the peaks which are above 5 sigma
>>> sources = find_peaks_in_flux_map(maps, threshold=5, min_distance=0.1*u.deg)