exspy.material
#
|
Convert atomic percent to weight percent. |
|
Calculate the density of a mixture of elements. |
Database of element properties. |
|
|
Mass absorption coefficient (mu/rho) of a X-ray absorbed in a pure material. |
|
Calculate the mass absorption coefficient for X-ray absorbed in a mixture of 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:
- Returns:
weight_percent – Composition in weight percent.
- Return type:
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])
See also
- 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:
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 Chantler2005
- Parameters:
- Returns:
mass_absorption_coefficients – Mass absorption coefficient(s) in cm^2/g
- Return type:
Examples
>>> exspy.material.mass_absorption_coefficient( >>> element='Al', energies=['C_Ka','Al_Ka']) array([ 26330.38933818, 372.02616732])
Note
See https://dx.doi.org/10.18434/T4HS32 Chantler, C.T., Olsen, K., Dragoset, R.A., Kishore, A.R., Kotochigova, S.A., and Zucker, D.S. (2005), X-Ray Form Factor, Attenuation and Scattering Tables (version 2.1).
- 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 Chantler2005.
- 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:
Note
See https://dx.doi.org/10.18434/T4HS32 Chantler, C.T., Olsen, K., Dragoset, R.A., Kishore, A.R., Kotochigova, S.A., and Zucker, D.S. (2005), X-Ray Form Factor, Attenuation and Scattering Tables (version 2.1).
- exspy.material.weight_to_atomic(weight_percent, elements='auto')#
Convert weight percent (wt%) to atomic percent (at.%).
- Parameters:
- Returns:
atomic_percent – Composition in atomic percent.
- Return type:
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])
See also
- 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
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