hexrd.imageutil module
- hexrd.imageutil.snip1d(y, w=4, numiter=2, threshold=None)[source]
Return SNIP-estimated baseline-background for given spectrum y.
!!!: threshold values get marked as NaN in convolution !!!: mask in astropy’s convolve is True for masked; set to NaN
- hexrd.imageutil.snip1d_quad(y, w=4, numiter=2)[source]
Return SNIP-estimated baseline-background for given spectrum y.
Adds a quadratic kernel convolution in parallel with the linear kernel.
- hexrd.imageutil.snip2d(y, w=4, numiter=2, order=1)[source]
Return estimate of 2D-array background by “clipping” peak-like structures.
2D adaptation of the peak-clipping component of the SNIP algorithm.
Parameters
y : 2-D input array w : integer (default 4)
kernel size (maximum kernel extent actually = 2 * w * order + 1)
- numiterinteger (default 2)
number of iterations
- orderinteger (default 1)
maximum order of filter kernel, either 1 (linear) or 2 (quadratic)
Returns
out : 2-D array with SNIP-estimated background of y
References!!!
- [1] C.G. Ryan et al, “SNIP, A statistics-sensitive background treatment
for the quantitative analysis of PIXE spectra in geoscience applications,” Nucl. Instr. and Meth. B 34, 396 (1988).
- [2] M. Morhac et al., “Background elimination methods for multidimensional
coincidence gamma-ray spectra,” Nucl. Instr. and Meth. A 401, 113 (1997).