hyperspy.misc.eds package

Submodules

hyperspy.misc.eds.utils module

hyperspy.misc.eds.utils.electron_range(element, beam_energy, density='auto', tilt=0)

Return the Kanaya-Okayama electron range.

Return the maximum electron range in a pure bulk material.

Parameters:
  • element (str) – The element symbol, e.g. ‘Al’.
  • beam_energy (float) – The energy of the beam in keV.
  • density ({float, 'auto'}) – The density of the material in g/cm3. If ‘auto’, the density of the pure element is used.
  • tilt (float.) – The tilt of the sample in degrees.
Returns:

Return type:

Electron range in micrometers.

Examples

>>> # Electron range in pure Copper at 30 kV in micron
>>> hs.eds.electron_range('Cu', 30.)
2.8766744984001607

Notes

From Kanaya, K. and S. Okayama (1972). J. Phys. D. Appl. Phys. 5, p43

See also the textbook of Goldstein et al., Plenum publisher, third edition p 72.

hyperspy.misc.eds.utils.get_FWHM_at_Energy(energy_resolution_MnKa, E)

Calculates the FWHM of a peak at energy E.

Parameters:
  • energy_resolution_MnKa (float) – Energy resolution of Mn Ka in eV
  • E (float) – Energy of the peak in keV
Returns:

float

Return type:

FWHM of the peak in keV

Notes

From the textbook of Goldstein et al., Plenum publisher, third edition p 315

hyperspy.misc.eds.utils.quantification_cliff_lorimer(intensities, kfactors, mask=None)

Quantification using Cliff-Lorimer

Parameters:
  • intensities (numpy.array) – the intensities for each X-ray lines. The first axis should be the elements axis.
  • kfactors (list of float) – The list of kfactor in same order as intensities eg. kfactors = [1, 1.47, 1.72] for [‘Al_Ka’,’Cr_Ka’, ‘Ni_Ka’]
  • mask (array of bool) – The mask with the dimension of intensities[0]. If a pixel is True, the composition is set to zero.
Returns:

  • numpy.array containing the weight fraction with the same
  • shape as intensities.

hyperspy.misc.eds.utils.take_off_angle(tilt_stage, azimuth_angle, elevation_angle)

Calculate the take-off-angle (TOA).

TOA is the angle with which the X-rays leave the surface towards the detector.

Parameters:
  • tilt_stage (float) – The tilt of the stage in degrees. The sample is facing the detector when positively tilted.
  • azimuth_angle (float) – The azimuth of the detector in degrees. 0 is perpendicular to the tilt axis.
  • elevation_angle (float) – The elevation of the detector in degrees.
Returns:

take_off_angle – In degrees.

Return type:

float.

Examples

>>> hs.eds.take_off_angle(tilt_stage=10.,
>>>                          azimuth_angle=45., elevation_angle=22.)
28.865971201155283

Notes

Defined by M. Schaffer et al., Ultramicroscopy 107(8), pp 587-597 (2007)

hyperspy.misc.eds.utils.xray_range(xray_line, beam_energy, density='auto')

Return the Anderson-Hasler X-ray range.

Return the maximum range of X-ray generation in a pure bulk material.

Parameters:
  • xray_line (str) – The X-ray line, e.g. ‘Al_Ka’
  • beam_energy (float) – The energy of the beam in kV.
  • density ({float, 'auto'}) – The density of the material in g/cm3. If ‘auto’, the density of the pure element is used.
Returns:

Return type:

X-ray range in micrometer.

Examples

>>> # X-ray range of Cu Ka in pure Copper at 30 kV in micron
>>> hs.eds.xray_range('Cu_Ka', 30.)
1.9361716759499248
>>> # X-ray range of Cu Ka in pure Carbon at 30kV in micron
>>> hs.eds.xray_range('Cu_Ka', 30., hs.material.elements.C.
>>>                      Physical_properties.density_gcm3)
7.6418811280855454

Notes

From Anderson, C.A. and M.F. Hasler (1966). In proceedings of the 4th international conference on X-ray optics and microanalysis.

See also the textbook of Goldstein et al., Plenum publisher, third edition p 286

Module contents