diff --git a/doc/user_guide/eds.rst b/doc/user_guide/eds.rst index 7e8b522d83..93b8bf756b 100644 --- a/doc/user_guide/eds.rst +++ b/doc/user_guide/eds.rst @@ -811,13 +811,13 @@ composition maps for each element. >>> factors=factors, absorption_correction=True >>> thickness = 100.) -At this stage absorption correction is only applicable for parallel-sided, -thin-film samples. Absorption correction is calculated on a pixel by pixel +At this stage absorption correction is only applicable for parallel-sided, +thin-film samples. Absorption correction is calculated on a pixel by pixel basis after having determined a sample mass-thickness map. It therefore may be a source of error in particularly inhomogeneous specimens. - + Absorption correction can also only be applied to spectra from a single EDS -detector. For systems that consist of multiple detectors, such as the Thermo +detector. For systems that consist of multiple detectors, such as the Thermo Fisher Super-X, it is therefore necessary to load the spectra from each detector separately. @@ -847,13 +847,13 @@ is available: Electron and X-ray range ^^^^^^^^^^^^^^^^^^^^^^^^ -The electron and X-ray range in a bulk material can be estimated with +The electron and X-ray range in a bulk material can be estimated with :py:meth:`hs.eds.electron_range` and :py:meth:`hs.eds.xray_range` To calculate the X-ray range of Cu Ka in pure Copper at 30 kV in micron: .. code-block:: python - + >>> hs.eds.xray_range('Cu_Ka', 30.) 1.9361716759499248 @@ -871,4 +871,3 @@ To calculate the electron range in pure Copper at 30 kV in micron >>> hs.eds.electron_range('Cu', 30.) 2.8766744984001607 - diff --git a/hyperspy/misc/eds/utils.py b/hyperspy/misc/eds/utils.py index 0f8bdb09d0..69626baeb3 100644 --- a/hyperspy/misc/eds/utils.py +++ b/hyperspy/misc/eds/utils.py @@ -498,8 +498,9 @@ def _quantification_cliff_lorimer(intensities, other_index = list(range(len(kfactors))) other_index.pop(ref_index) for i in other_index: - ab[i] = intensities[ref_index] * kfactors[ref_index] \ - / (intensities[i] * absorption_correction[i]) / kfactors[i] + ab[i] = (intensities[ref_index] * absorption_correction[ref_index]) \ + / (intensities[i] * absorption_correction[i]) \ + *( kfactors[ref_index] / kfactors[i]) # Ca = ab /(1 + ab + ab/ac + ab/ad + ...) ab = ab for i in other_index: diff --git a/hyperspy/tests/signal/test_eds_tem.py b/hyperspy/tests/signal/test_eds_tem.py index 9d451554ef..09e190ac6a 100644 --- a/hyperspy/tests/signal/test_eds_tem.py +++ b/hyperspy/tests/signal/test_eds_tem.py @@ -250,9 +250,16 @@ def test_quant_lorimer_ac(self): composition_units, absorption_correction=True, thickness=0.0001) - np.testing.assert_allclose(res2[0][0].data, np.ones((2, 2)) * 22.70779, + list.reverse(intensities) + list.reverse(kfactors) + res5 = s.quantification(intensities, method, kfactors, + composition_units, + absorption_correction=True, + thickness=300.) + np.testing.assert_allclose(res5[0][0].data, res3[0][1].data, atol=1e-5) + np.testing.assert_allclose(res2[0][0].data, np.ones((2, 2)) * 22.743013, atol=1e-3) - np.testing.assert_allclose(res3[0][0].data, np.ones((2, 2)) * 22.587251, + np.testing.assert_allclose(res3[0][0].data, np.ones((2, 2)) * 31.816908, atol=1e-3) np.testing.assert_allclose(res[0].data, res4[0][0].data, atol=1e-5)