Peak picking routines, lineshape parameter guessing, and related functions.
This modules is imported as nmrglue.peakpick and can be called as such.
These are the functions most users will use from the peakpick module.
Pick (find) peaks in a spectrum using a given algorithm.
Parameters:
data N-dimensional array.
thres Threshold value for minimum peak height.
Must be defined if algorithm is ‘thresh’ or ‘thresh-fast’
or short cut values ‘p’,’n’,’b’.
‘thres-fast’, ‘downward’, or ‘connected’
amplitude for all peaks picked. False returns only the peak locations (centers)
dimension. If not specified Gaussian type lineshapes with a FWHM linewidth parameter is assumed in each dimension. This parameter if only used if est_params is True.
Returns: centers,[linewidths,amplitudes]
These functions are typically not used directly by users. They are called by high level functions. Developers and user who want fine control over peak picking will be interested in these functions.
Find regions in spectra containing peaks.
Parameters:
Returns: regions
spectra. Each region dictionary has the following keys:
The ‘linewidths’ and ‘amplitude’ keys are only created if linewidths and amplitudes are passed to the function.
Add a pad to each region in regions list
Parameters:
Returns: regions
Resolve overlapping regions
Parameters:
Returns: regions
Find all limit tuples in lms_list which are overlapping with limits, lms.
Returns a list of indicies of lms_list which overlap.
Convert a region dictionary to linesh input
Parameters:
Returns: (rslice,min,guesses,amp_guesses)
Convert linesh.fit_NDregion output to a region dictionary
Parameters:
Returns: region dictionary
Filter peaks which are nearby, keeping those with the largest intesity.
Parameters:
- data N-dimensional array.
- centers Array of estimated peak locations.
- msep N-tuple of minimum peak seperations along each axis.
- linewidths Array of estimated peak linewidths, optional.
- amplitudes Array of estimated peak amplitude, optional.
Returns: centers,[linewidths,amplitudes]
Find all points in pts that are within a box defined by limits lms
Returns a list of indicies of pts which are within the box limits.
Guess the parameter of a peak centered at center.
Parameters:
Return: centers,linewidths,amplitudes
Guess the parameter of a peak in a provided segment.
Parameters:
Return: centers,linewidths,amplitudes
Peak pick a spectrum using the connected path algorithm.
Find peaks (local maxima/minima) in an arbitrary dimensional NMR spectra above/below a given threshold and not part of an already defined connected segment.
Parameters:
data N-dimensional array.
thres Threshold value for minimum peak height.
or short cut values ‘p’,’n’,’b’.
return only peak centers.
Return: centers,[segments]
centers array of peak locations with shape (n_peaks,ndim).
seg_flag.
Peak pick a spectrum using a downward/upward path algorithm.
Find peaks (local maxima/minima) in an arbitrary dimensional NMR spectra above/below a given threshold and not part of an already defined downward/upward segment.
Parameters:
data N-dimensional array.
thres Threshold value for minimum peak height.
or short cut values ‘p’,’n’,’b’.
return only peak centers.
Return: centers,[segments]
centers array of peak locations with shape (n_peaks,ndim).
seg_flag.
Peak pick a spectrum using a threshhold-minimum distance algorithm.
Find peaks (local maxima/minima) in a arbitrary dimensional NMR spectra above/below a set threshold with a minimal distance between peaks. When the spectrum is small and multiple copies can fit into RAM use the _fast version of this function.
Parameters:
data N-dimensional array.
thres Threshold value for minimum peak height
msep N-tuple of minimum peak seperations along each axis
or short cut values ‘p’,’n’,’b’.
Returns: array of peak locations with shape (n_peaks,ndim)
Fast version of pick_thres functions
See peak_thres for call details