exspy.material#

atomic_to_weight(atomic_percent[, elements])

Convert atomic percent to weight percent.

density_of_mixture(weight_percent[, ...])

Calculate the density of a mixture of elements.

elements

Database of element properties.

mass_absorption_coefficient(element, energies)

Mass absorption coefficient (mu/rho) of a X-ray absorbed in a pure material.

mass_absorption_mixture(weight_percent[, ...])

Calculate the mass absorption coefficient for X-ray absorbed in a mixture of elements.

weight_to_atomic(weight_percent[, elements])

Convert weight percent (wt%) to atomic percent (at.%).

exspy.material.atomic_to_weight(atomic_percent, elements='auto')#

Convert atomic percent to weight percent.

Parameters:
  • atomic_percent (list of float or list of signals) – The atomic fractions (composition) of the sample.

  • elements (list of str) – A list of element abbreviations, e.g. [‘Al’,’Zn’]. If elements is ‘auto’, take the elements in en each signal metadata of the atomic_percent list.

Returns:

weight_percent – Composition in weight percent.

Return type:

numpy.ndarray of float

Examples

Calculate the weight percent of modern bronze given its atomic percent:

>>> exspy.material.atomic_to_weight([93.2, 6.8], ("Cu", "Sn"))
array([ 88.00501989,  11.99498011])
exspy.material.density_of_mixture(weight_percent, elements='auto', mean='harmonic')#

Calculate the density of a mixture of elements.

The density of the elements is retrieved from an internal database. The calculation is only valid if there is no interaction between the components.

Parameters:
  • weight_percent (list of float or list of signals) – A list of weight percent for the different elements. If the total is not equal to 100, each weight percent is divided by the sum of the list (normalization).

  • elements (list of str) – A list of element symbols, e.g. [‘Al’, ‘Zn’]. If elements is ‘auto’, take the elements in en each signal metadata of the weight_percent list.

  • mean ('harmonic' or 'weighted') – The type of mean use to estimate the density. Default is 'harmonic'.

Returns:

density – The density in g/cm3.

Return type:

numpy.ndarray of float or hyperspy.api.signals.BaseSignal

Examples

Calculate the density of modern bronze given its weight percent:

>>> exspy.material.density_of_mixture([88, 12],['Cu', 'Sn'])
8.6903187973131466
exspy.material.mass_absorption_coefficient(element, energies)#

Mass absorption coefficient (mu/rho) of a X-ray absorbed in a pure material.

The mass absorption is retrieved from the database of Chantler et al. [*].

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

  • energies (float or list of float or str or list of str) – The energy or energies of the X-ray in keV, or the name of the X-rays, e.g. ‘Al_Ka’.

Returns:

mass_absorption_coefficients – Mass absorption coefficient(s) in cm^2/g

Return type:

numpy.ndarray of float

Examples

>>> exspy.material.mass_absorption_coefficient(
>>>     element='Al', energies=['C_Ka','Al_Ka'])
array([ 26330.38933818,    372.02616732])

References

exspy.material.mass_absorption_mixture(weight_percent, elements='auto', energies='auto')#

Calculate the mass absorption coefficient for X-ray absorbed in a mixture of elements.

The mass absorption coefficient is calculated as a weighted mean of the weight percent and is retrieved from the database of Chantler et al. [].

Parameters:
  • weight_percent (list of float or list of signals) – The composition of the absorber(s) in weight percent. The first dimension of the matrix corresponds to the elements.

  • elements (list of str or 'auto') – The list of element symbol of the absorber, e.g. [‘Al’,’Zn’]. If elements is ‘auto’, take the elements in each signal metadata of the weight_percent list.

  • energies (list of float or list of str or 'auto') – The energy or energies of the X-ray in keV, or the name of the X-rays, e.g. ‘Al_Ka’. If ‘auto’, take the lines in each signal metadata of the weight_percent list.

Examples

>>> exspy.material.mass_absorption_mixture(
>>>     elements=['Al','Zn'], weight_percent=[50,50], energies='Al_Ka')
2587.41616439
Returns:

mass_absorption_coefficient – The Mass absorption coefficient(s) of the mixture in cm^2/g

Return type:

numpy.ndarray of float or hyperspy.api.signals.BaseSignal

References

exspy.material.weight_to_atomic(weight_percent, elements='auto')#

Convert weight percent (wt%) to atomic percent (at.%).

Parameters:
  • weight_percent (list of float or list of signals) – The weight fractions (composition) of the sample.

  • elements (list of str) – A list of element abbreviations, e.g. [‘Al’,’Zn’]. If elements is ‘auto’, take the elements in en each signal metadata of th weight_percent list.

Returns:

atomic_percent – Composition in atomic percent.

Return type:

numpy.ndarray of float

Examples

Calculate the atomic percent of modern bronze given its weight percent:

>>> exspy.material.weight_to_atomic((88, 12), ("Cu", "Sn"))
array([ 93.19698614,   6.80301386])
material.elements#

Database of element properties.

The following properties are included:

├── Atomic_properties
│   ├── Binding_energies
│   └── Xray_lines
├── General_properties
│   ├── Z
│   ├── atomic_weight
│   └── name
└── Physical_properties
    └── density_gcm3

The X-ray lines energies are taken from Chantler et al. [1].

The line weight, more precisely the approximate line weight for K, L, M shells are taken from the Electron Probe Quantification (EPQ) library [2].

The field threshold and edge are taken from the Gatan EELS atlas https://eels.info/atlas, as retrieved in June 2020.

Examples

>>> exspy.material.elements.Fe.General_properties
├── Z = 26
├── atomic_weight = 55.845
└── name = iron
>>> exspy.material.elements.Fe.Physical_properties
└── density (g/cm^3) = 7.874
>>> exspy.material.elements.Fe.Atomic_properties.Xray_lines
├── Ka
│   ├── energy (keV) = 6.404
│   └── weight = 1.0
├── Kb
│   ├── energy (keV) = 7.0568
│   └── weight = 0.1272
├── La
│   ├── energy (keV) = 0.705
│   └── weight = 1.0
├── Lb3
│   ├── energy (keV) = 0.792
│   └── weight = 0.02448
├── Ll
│   ├── energy (keV) = 0.615
│   └── weight = 0.3086
└── Ln
    ├── energy (keV) = 0.62799
    └── weight = 0.12525

References