Material¶
- class roentgen.absorption.Material(material_input, thickness: Unit('m'), density=None)[source]¶
Bases:
object
An object which enables the calculation of the x-ray transmission and absorption of a material (e.g. an element or a compound/mixture).
A material may be composed of a single atomic element such as Aluminum (‘Al’), or composed of number of elements and/or compounds.
- Parameters:
material_str (str or dict) – A string representation of the material which includes an element symbol (e.g. Si), an element name (e.g. Silicon), or the name of a compound (e.g. cdte, mylar). For all supported elements see
elements.csv
and for compounds seecompounds_mixtures.csv
. Can also be a dictionary of element and compounds with fractional masses (ex. {“Cu”:0.70, “Zn”:0.30})thickness (
astropy.units.Quantity
) – The thickness of the materialdensity (
astropy.units.Quantity
, optional) – The density of the material. If not provided, uses default values which can be found inelements.csv
for elements or incompounds_mixtures.csv
for compounds. If many materials are present, calculates the weighted density.
- fractional_masses¶
A normalized array of fractional masses
- Type:
np.ndarray
- mass_attenuation_coefficients¶
A list of
MassAttenuationCoefficient
- Type:
- mass_attenuation_coefficient(energy)[source]¶
The mass attenuation coefficient for the material at energy
Examples
>>> from roentgen.absorption.material import Material >>> import astropy.units as u >>> detector = Material('cdte', 500 * u.um) >>> thermal_blankets = Material('mylar', 0.5 * u.mm) >>> bronze = Material({"Cu": 0.88, "Sn": 0.12}, 1 * u.mm)
Methods Summary
absorption
(energy)Provides the absorption fraction (0 to 1).
linear_attenuation_coefficient
(energy)Provides the linear attenuation coefficient as a function of energy.
mass_attenuation_coefficient
(energy)transmission
(energy)Provide the transmission fraction (0 to 1).
Methods Documentation
- absorption(energy)[source]¶
Provides the absorption fraction (0 to 1).
- Parameters:
energy (
astropy.units.Quantity
) – An array of energies in keV.- Raises:
ValueError – If energy is outside of the interpolation range of 1 keV to 20 MeV.
- linear_attenuation_coefficient(energy: Unit('keV'))[source]¶
Provides the linear attenuation coefficient as a function of energy.
linear coeff = mass coeff * density.
- Parameters:
energy (
astropy.units.Quantity
) – An array of energies in keV.- Raises:
ValueError – If energy is outside of the interpolation range of 1 keV to 20 MeV.
- transmission(energy)[source]¶
Provide the transmission fraction (0 to 1).
- Parameters:
energy (
astropy.units.Quantity
) – An array of energies in keV- Raises:
ValueError – If energy is outside of the interpolation range of 1 keV to 20 MeV.