find_peaks¶
-
gammapy.detect.find_peaks(image, threshold, min_distance=1)[source]¶ Find local peaks in an image.
This is a very simple peak finder, that finds local peaks (i.e. maxima) in images above a given
thresholdwithin a givenmin_distancearound each given pixel.If you get multiple spurious detections near a peak, usually it’s best to smooth the image a bit, or to compute it using a different method in the first place to result in a smooth image. You can also increase the
min_distanceparameter.The output table contains one row per peak and the following columns:
xandyare the pixel coordinates (first pixel at zero)raanddecare the RA / DEC sky coordinates (ICRS frame)valueis the pixel value
It is sorted by peak value, starting with the highest value.
If there are no pixel values above the threshold, an empty table is returned.
There are more featureful peak finding and source detection methods e.g. in the
photutilsorscikit-imagePython packages.Parameters: - image :
WcsNDMap 2D map
- threshold : float or array-like
The data value or pixel-wise data values to be used for the detection threshold. A 2D
thresholdmust have the same shape as tha mapdata.- min_distance : int
Minimum pixel distance between peaks. Smallest possible value and default is 1 pixel.
Returns: - output :
Table Table with parameters of detected peaks