lucabaldini / hexsample

Solid-state hybrid detectors with hexagonal sampling.
https://lucabaldini.github.io/hexsample/
GNU General Public License v3.0
2 stars 0 forks source link

Handling indexes of fitted parameters in DoubleGaussian fit #44

Closed chiaratomaiuolo closed 7 months ago

chiaratomaiuolo commented 7 months ago

Sometimes fits with DoubleGaussian() flips the indexes of mean and sigma for alpha and beta peak, that in default are 0 and 1. It is not enough to assign the lowest one to alpha because if fit do not converge for one of the two peaks, could give a random value (see plot below).

If it is not possible to fix the indexes, it is needed to find some conditions to assign the mean values to the right peak. For now, in analyze_grid.py, the condition of failure for fitting consists of the following check: if 0 - FitStatus.parameter_error('mean0') >= 0) is True then fit has failed for at least one of the two Gaussians. fig.pdf

lucabaldini commented 7 months ago

Shipped in 0.8.1