exspy.utils.eds#

cross_section_to_zeta(cross_sections, elements)

Convert a list of cross_sections in barns (b) to zeta-factors (kg/m^2).

electron_range(element, beam_energy[, ...])

Returns the maximum electron range for a pure bulk material according to the Kanaya-Okayama parameterziation.

get_xray_lines_near_energy(energy[, width, ...])

Find xray lines near a specific energy, more specifically all xray lines that satisfy only_lines and are within the given energy window width around the passed energy.

take_off_angle(tilt_stage, azimuth_angle, ...)

Calculate the take-off-angle (TOA).

xray_range(xray_line, beam_energy[, density])

Return the maximum range of X-ray generation according to the Anderson-Hasler parameterization.

zeta_to_cross_section(zfactors, elements)

Convert a list of zeta-factors (kg/m^2) to cross_sections in barns (b).

exspy.utils.eds.cross_section_to_zeta(cross_sections, elements)#

Convert a list of cross_sections in barns (b) to zeta-factors (kg/m^2).

Parameters:
  • cross_section (list of float) – A list of cross sections in barns.

  • elements (list of str) – A list of element chemical symbols in the same order as the cross sections e.g. [‘Al’,’Zn’]

Returns:

zeta_factors – The zeta factors with units kg/m^2.

Return type:

list of float

exspy.utils.eds.electron_range(element, beam_energy, density='auto', tilt=0)#

Returns the maximum electron range for a pure bulk material according to the Kanaya-Okayama parameterziation.

Parameters:
  • element (str) – The element symbol, e.g. ‘Al’.

  • beam_energy (float) – The energy of the beam in keV.

  • density (float or str ('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:

electron_range – Electron range in micrometers.

Return type:

float

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.

exspy.utils.eds.get_xray_lines_near_energy(energy, width=0.2, only_lines=None)#

Find xray lines near a specific energy, more specifically all xray lines that satisfy only_lines and are within the given energy window width around the passed energy.

Parameters:
  • energy (float) – Energy to search near in keV

  • width (float) – Window width in keV around energy in which to find nearby energies, i.e. a value of 0.2 keV (the default) means to search +/- 0.1 keV.

  • only_lines (str or None) – If not None, only the given lines will be added (eg. (‘a’,’Kb’)).

Returns:

xray_lines – List of xray-lines sorted by energy difference to the given energy.

Return type:

numpy.ndarray

exspy.utils.eds.take_off_angle(tilt_stage, azimuth_angle, elevation_angle, beta_tilt=0.0)#

Calculate the take-off-angle (TOA).

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

Parameters:
  • alpha_tilt (float) – The alpha-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 alpha tilt axis.

  • elevation_angle (float) – The elevation of the detector in degrees.

  • beta_tilt (float) – The beta-tilt of the stage in degrees. The sample is facing positive 90 in the azimuthal direction when positively tilted.

Returns:

take_off_angle – The take off angle in degrees.

Return type:

float

Examples

>>> hs.eds.take_off_angle(alpha_tilt=10., beta_tilt=0.
>>>                          azimuth_angle=45., elevation_angle=22.)
28.865971201155283
exspy.utils.eds.xray_range(xray_line, beam_energy, density='auto')#

Return the maximum range of X-ray generation according to the Anderson-Hasler parameterization.

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:

xray_range – The X-ray range in micrometer.

Return type:

float

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

exspy.utils.eds.zeta_to_cross_section(zfactors, elements)#

Convert a list of zeta-factors (kg/m^2) to cross_sections in barns (b).

Parameters:
  • zfactors (list of float) – A list of zeta-factors.

  • elements (list of str) – A list of element chemical symbols in the same order as the cross sections e.g. [‘Al’,’Zn’]

Returns:

cross_sections – The cross sections with units in barns.

Return type:

list of float