Skip to content
Snippets Groups Projects

XAS standard deviation

Merged Laurent Mercadier requested to merge xas_error into master
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
+ 3
3
@@ -66,11 +66,11 @@ def absorption(T, Io, fluorescence=False):
muA = muT/muIo
#Derivation of standard deviation
#1. using biased weighted sample variance:
sigmaA = np.sqrt(np.average((T/Io - muA)**2, weights=Io))
#sigmaA = np.sqrt(np.average((T/Io - muA)**2, weights=Io))
#2. using unbiased weighted sample variance (reliablility wieghts):
#V2 = np.sum(Io**2)
#sigmaA = np.sqrt(np.sum(Io*(T/Io - muA)**2) / (weights - V2/weights))
V2 = np.sum(Io**2)
sigmaA = np.sqrt(np.sum(Io*(T/Io - muA)**2) / (weights - V2/weights))
#3. using error propagation for correlated data:
#sigmaA = np.abs(muA)*(np.sqrt((sigmaT/muT)**2 +
Loading