ewoksfluo.tasks.sum_detectors.sum_utils.compute_summed_xrf_results#

ewoksfluo.tasks.sum_detectors.sum_utils.compute_summed_xrf_results(xrf_results_uris, detector_weights)[source]#

Compute the weighted sum of the peak areas, associated uncertainties and mass fractions for several detectors.

For elemental peak areas

\[A(\mathrm{Fe}) = \sum_i{\left[ W_i A_i(\mathrm{Fe}) \right] }\]

For their uncertainties

\[\sigma_{A}(\mathrm{Fe}) = \sqrt{ \sum_i\left[ W_i^2 \sigma_{A_i}^2(\mathrm{Fe}) \right] }\]

For elemental mass fractions, in addition to the detector weight we also weight for the peak area

\[M(\mathrm{Fe}) = \sum_i{\left[ W_i M_i(\mathrm{Fe}) \frac{W_i A_i(\mathrm{Fe})}{A(\mathrm{Fe})} \right] }\]

The variable \(W_i\) is the weight for detector \(i\) which is typically the inverse of the live time.

Parameters:
  • xrf_results_uris (Sequence[str]) – HDF5 group for each detector that contains the “parameters”, “uncertainties” and “massfractions” groups.

  • detector_weights (Iterator[ndarray]) – Weights for each detector.

Return type:

Tuple[Dict[str, ndarray], Dict[str, ndarray], Dict[str, ndarray]]

Returns:

summed peak areas, associated uncertainties, averaged weight fractions