XAS standard deviation
The derivation of the standard deviation of the transmission, in XAS, is not consistent with the derivation of the mean transmission. The transmission is a weighted average with weights = Io, therefore the standard deviation should be the standard deviation of the weighted average.
See https://en.wikipedia.org/wiki/Weighted_arithmetic_mean#Weighted_sample_variance
We usually deal with large number of points, therefore the standard deviation is derived from the biased weighted sample variance.
The derivation of unbiased estimate of sample variance (reliablility weights) is also possibile but commented out, since it is more computationally demanding.
I checked in a few cases that both derivations give very similar results.
Edited by Laurent Mercadier