# PeakFinder — Peak finding with derivatives.¶

This module defines a peak finding utility using the derivative of the spectral line profile.

class admit.util.peakfinder.PeakFinder.PeakFinder(spec, x=None, **kwarg)[source]

PeakFinder searches for spectral peaks by taking the first derivative of the spectrum and looks for zero crossings. Noise spikes are eliminated by a noise cutoff, minimum separation of points, and minimum width of lines.

Parameters: spec : List or numpy array The spectrum to be analyzed. x : List or numpy array, optional The x co-ordinates for the spectrum. Default: None. kwarg : Dict Any additional arguments, see the Attributes list for a complete listing.

Attributes

 spec (numpy array) The spectrum to be analyzed. x (numpy array) The x co-ordinates of the spectrum. thresh (float, optional) The cutoff used to determine if a peak is above the noise. The absolute value of the spectrum is compared to this so that absorption lines are also detected. Default: 0.0. min_sep (int) The minimum separation between peaks in channels. Default: 5. min_width (int) The minimum width of a line to consider, in channels. Default: 5.

Methods

 find() Method to locate peaks in an input spectrum wideenough(pk[, mult]) Method to determine whether a line is wide enough, based on the given parameters.
find()[source]

Method to locate peaks in an input spectrum

Parameters: None Numpy array containing the located peaks
min_sep = 5
min_width = 5
thresh = 0.0
wideenough(pk, mult=1)[source]

Method to determine whether a line is wide enough, based on the given parameters.

Parameters: pk : int The peak to examine (in channel units) mult : int A mulitpiler to use for the noise level cutoff Default: 1 True of the line meets the minimum width criteria in self.min_width, False otherwise