Normalization (I0 + deadtime) not correct
The tutorial workflow generates XRF spectra with flux decay, deadtime and poisson noise. The theoretical Ca-K signal is 40000 counts in all points of the scan (i.e. before flux decay, deadtime and poisson noise). After fitting and normalization we have a Ca-K signal between ~32000 and ~33000 counts with an error of 5 to 6 counts.