Re: [PyMca] Documentation for FastXRFLinearFit
Brought to you by:
vasole
|
From: PyMca g. p. m. list. <pym...@li...> - 2019-12-06 16:58:16
|
Dear Marc,
What follows is a copy-paste of the text from the slides I use for training:
"""
As you may have found out with the standard fit, maximum speeds can be
achieved when you can afford a linear fit:
- Non linear parameters have been previously determined and kept fixed
- No pile up is considered (remember: pile up is not the same on each
pixel and average pile up has no meaning
On a linear fit, the signal can be written as a matrix product:
Measured Signal B = Design Matrix * A
In other words, the measured spectrum B is obtained as a linear
combination of the columns of the Design Matrix and we have to find the
coefficients A on that basis.
The uncertainties on the measured data enter as weights in the Design
Matrix that has n_channels rows and m_model_parameters columns.
Therefore, in the linear fit we need the "equivalent of a matrix
inversion and a matrix multiplication" to obtain the A parameters.
If we assume that the uncertainty associated to the counts in a channel
is the same on all the measured spectra, the Design Matrix will be the
same in every point and only one matrix inversion equivalent is needed.
That corresponds to:
- Using No Weight (assume uncertainty is 1 everywhere) or
- Use an average Weight (derive channel uncertainty from the sum spectrum)
All that is achievable from the GUI or from the command line (no GUI)
in source installation of PyMca:
python -m PyMca5.PyMcaPhysics.xrf.FastXRFLinearFit
--cfg=configuration_file --weight=0 --tif=1 --concentrations=0 --refit=0
hdf5_file_name::dataset_path
"""
Concerning your specific question: The background is accounted for or
not following what you requested via the fit configuration file.
Remember that all the non-linear parameters will be fixed to their
values in the fit configuration file. If they are wrong they will remain
wrong. To help on that, the fit configuration window allows you to load
the parameters of the last fit into the configuration ("Load from Fit").
Best regards,
Armando
|