background Module

skbeam.core.fitting.background.snip_method(spectrum, e_off, e_lin, e_quad, xmin=0, xmax=4096, epsilon=2.96, width=0.5, decrease_factor=1.4142135623730951, spectral_binning=None, con_val=None, iter_num=None, width_threshold=0.5)

use snip algorithm to obtain background

Parameters
spectrumarray

intensity spectrum

e_offfloat

energy calibration, such as e_off + e_lin * energy + e_quad * energy^2

e_linfloat

energy calibration, such as e_off + e_lin * energy + e_quad * energy^2

e_quadfloat

energy calibration, such as e_off + e_lin * energy + e_quad * energy^2

xminfloat, optional

smallest index to define the range

xmaxfloat, optional

largest index to define the range

epsilonfloat, optional

energy to create a hole-electron pair for Ge 2.96, for Si 3.61 at 300K needs to double check this value

widthint, optional

window size to adjust how much to shift background

decrease_factorfloat, optional

gradually decrease of window size, default as sqrt(2)

spectral_binningfloat, optional

bin the data into different size

con_valint, optional

size of scipy.signal.boxcar to convolve the spectrum.

Default value is controlled by the keys con_val_no_bin and con_val_bin in the defaults dictionary, depending on if spectral_binning is used or not

iter_numint, optional

Number of iterations.

Default value is controlled by the keys iter_num_no_bin and iter_num_bin in the defaults dictionary, depending on if spectral_binning is used or not

width_thresholdfloat, optional

stop point of the algorithm

Returns
backgroundarray

output results with peak removed

References

1

C.G. Ryan etc, “SNIP, a statistics-sensitive background treatment for the quantitative analysis of PIXE spectra in geoscience applications”, Nuclear Instruments and Methods in Physics Research Section B, vol. 34, 1998.