grapa.datatypes.curveMCA.FitHandlerXRF

class grapa.datatypes.curveMCA.FitHandlerXRF(filename)

Bases: FitHandlerBasicFunc

Added on base class - fit fucntions - several overrides to handle peak amplitude - added text interpreters for input database file

__init__(filename)

Methods

__init__(filename)

compute_amplitude(curve)

compute_amplitude_actual(func, popt, ...)

Returns peak amplitude, based on the fitfunc, popt sum_amp_gaussian.

fit_explicit(curve, *args[, sum_amp_gaussian])

Override, intercept variable sum_amp_gaussian and compute amplitude

funcListGUI_ifnewline(counter, lbl, func)

by dfault, new line every 4 parameters

funcListGUI_notafit_preset(curve, preset, ...)

Fit using preset settings

func_gaussa(x, a, x0, sigma)

Gaussian peak

func_interp(x, interp, mult, cst, dx)

Interpolates on an existing dataset, multiplication, add constant, x shift.

func_interp_2gaussaratiodeltadx(x, interp, ...)

Background interpolated from dataset, and 2 gaussianpeaks, the second parametrized as area ratio and x shift from the first one.

func_interp_gaussa(x, interp, mult, cst, dx, ...)

Background interpolated from dataset (multiplier, offset, x shift), and a gaussian peak

func_linbg(x, valueatx0, slope, x0)

Linear function, with slope scaling with cst multiplying value.

func_linbg_2gaussa(x, bgvalueatx0, bgslope, ...)

Linear background (value at x0 and slope) and 2 gaussian peaks

func_linbg_2gaussaratiodelta(x, bgvalueatx0, ...)

Linear background (value at x0 and slope) and two gaussian peaks, the second parametrized as area ratio and x shift from the first one.

func_linbg_2gaussaratiodelta_3gaussaratiodelta(x, ...)

Linear background (value at x0 and slope) and 3 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

func_linbg_3gaussaratiodelta(x, bgvalueatx0, ...)

Linear background (value at x0 and slope) and 3 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

func_linbg_4gaussaratiodelta(x, bgvalueatx0, ...)

Linear background (value at x0 and slope) and 4 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

func_linbg_gaussa(x, bgvalueatx0, bgslope, ...)

Linear background (value at x0 and slope) and 1 gaussian peak

updateFitParam_after(curve, revert)

Small bit of code performed after updateFitParam

compute_amplitude_actual(func, popt, sum_amp_gaussian)

Returns peak amplitude, based on the fitfunc, popt sum_amp_gaussian. e.g. sum of one or several gaussian peaks sum_amp_gaussian: e.g [0, 1], aka first 2 gaussians must be considered

fit_explicit(curve, *args, sum_amp_gaussian=None, **kwargs)

Override, intercept variable sum_amp_gaussian and compute amplitude

Parameters:
  • curve – a grapa Curve object containing the data to fit

  • sum_amp_gaussian – e.g. [0, 1], indicate output “amplitude” as sum of gaussian peaks 0 and 1

funcListGUI_ifnewline(counter, lbl, func)

by dfault, new line every 4 parameters

funcListGUI_notafit_preset(curve, preset, **kwargs)

Fit using preset settings

classmethod func_gaussa(x, a, x0, sigma)

Gaussian peak

classmethod func_interp(x, interp, mult, cst, dx)

Interpolates on an existing dataset, multiplication, add constant, x shift. The fit parameter corresponding to interp must be fixed.

classmethod func_interp_2gaussaratiodeltadx(x, interp, mult, cst, dx, g1a, g1x0, g1sigma, g2ratio, g2deltax)

Background interpolated from dataset, and 2 gaussianpeaks, the second parametrized as area ratio and x shift from the first one.

classmethod func_interp_gaussa(x, interp, mult, cst, dx, ga, gx0, gsigma)

Background interpolated from dataset (multiplier, offset, x shift), and a gaussian peak

classmethod func_linbg(x, valueatx0, slope, x0)

Linear function, with slope scaling with cst multiplying value. e.g. background signal proportional to time

classmethod func_linbg_2gaussa(x, bgvalueatx0, bgslope, bgx0, g1a, g1x0, g1sigma, g2a, g2x0, g2sigma)

Linear background (value at x0 and slope) and 2 gaussian peaks

classmethod func_linbg_2gaussaratiodelta(x, bgvalueatx0, bgslope, bgx0, g1a, g1x0, g1sigma, g2ratio, g2deltax)

Linear background (value at x0 and slope) and two gaussian peaks, the second parametrized as area ratio and x shift from the first one.

classmethod func_linbg_2gaussaratiodelta_3gaussaratiodelta(x, bgvalueatx0, bgslope, bgx0, g1a, g1x0, g1sigma, g2ratio, g2deltax, g3a, g3x0, g3sigma, g4ratio, g4deltax, g5ratio, g5deltax)

Linear background (value at x0 and slope) and 3 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

classmethod func_linbg_3gaussaratiodelta(x, bgvalueatx0, bgslope, bgx0, g1a, g1x0, g1sigma, g2ratio, g2deltax, g3ratio, g3deltax)

Linear background (value at x0 and slope) and 3 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

classmethod func_linbg_4gaussaratiodelta(x, bgvalueatx0, bgslope, bgx0, g1a, g1x0, g1sigma, g2ratio, g2deltax, g3ratio, g3deltax, g4ratio, g4deltax)

Linear background (value at x0 and slope) and 4 gaussian peaks, the latter parametrized as area ratios and x shifts from the first one.

classmethod func_linbg_gaussa(x, bgvalueatx0, bgslope, bgx0, ga, gx0, gsigma)

Linear background (value at x0 and slope) and 1 gaussian peak

updateFitParam_after(curve, revert)

Small bit of code performed after updateFitParam