roentgen.absorption.material#

Classes

Material(material_input, thickness[, density])

An object which enables the calculation of the x-ray transmission and absorption of a material (e.g. an element or a compound/mixture).

MassAttenuationCoefficient(material)

The mass attenuation coefficient.

Stack(materials)

An object which enables the calculation of the x-ray transmission and absorption of a stack of materaials.

Response(optical_path, detector)

An object to handle the response of a detector material which includes an optical path or filter through which x-rays must first traverse before reaching the detector.

class roentgen.absorption.material.MassAttenuationCoefficient(material)[source]#

The mass attenuation coefficient.

Parameters:

material_str (str) – 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).

data#

The mass attenuation data values.

Type:

astropy.units.Quantity array

energy#

The energy values of the mass attenuation values.

Type:

astropy.units.Quantity

symbol#

The material symbol

Type:

str

name#

The material name

Type:

str

func#

A function which returns the interpolated mass attenuation value at any given energy. Energies must be given by an astropy.units.Quantity. The interpolation range is 1 keV to 20 MeV. Going outside that range will result in a ValueError.

Type:

lambda func

Examples

>>> from roentgen.absorption.material import MassAttenuationCoefficient
>>> mass_atten = MassAttenuationCoefficient('air')
_remove_double_vals_from_data()[source]#

Remove double-values energy values. Edges are represented with the same energy index and at the bottom and top value of the edge. This must be removed to enable correct interpolation.

class roentgen.absorption.material.Material(material_input, thickness: Unit('m'), density=None)[source]#

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 supported elements see elements.csv and for compounds see compounds_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 material

  • density (astropy.units.Quantity, optional) – The density of the material. If not provided, uses default values which can be found in elements.csv for elements or in compounds_mixtures.csv for compounds. If many materials are present, calculates the weighted density.

  • warning:: (..) – Elements beyond z = 92 are not supported by this class.

symbols#

A list of material symbol

Type:

list

material_names#

A list of material names

Type:

list

name#

A name for the material

Type:

str

fractional_masses#

A normalized array of fractional masses

Type:

np.ndarray

mass_attenuation_coefficients#

A list of MassAttenuationCoefficient

Type:

list

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)
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.

mass_attenuation_coefficient(energy)[source]#
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.

class roentgen.absorption.material.Response(optical_path, detector)[source]#

An object to handle the response of a detector material which includes an optical path or filter through which x-rays must first traverse before reaching the detector.

Parameters:
  • optical_path (Stack) – A list of Material objects which make up the optical path.

  • detector (Material or None) – A Material which represents the detector material where the x-rays are absorbed. If provided with None, than assume a perfectly absorbing detector material.

Examples

>>> from roentgen.absorption.material import Material, Response, Stack
>>> import astropy.units as u
>>> optical_path = Stack([Material('air', 1 * u.m), Material('Al', 500 * u.mm)])
>>> resp = Response(optical_path, detector=Material('cdte', 500 * u.um))
response(energy)[source]#

Returns the response as a function of energy which corresponds to the transmission through the optical path multiplied by the absorption in the detector.

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.

class roentgen.absorption.material.Stack(materials)[source]#

An object which enables the calculation of the x-ray transmission and absorption of a stack of materaials. This object is created automatically when Material objects are added together.

Parameters:

materials (list) – A list of Material objects

Examples

>>> from roentgen.absorption.material import Material, Stack
>>> import astropy.units as u
>>> detector = Stack([Material('Pt', 5 * u.um), Material('cdte', 500 * u.um)])
>>> optical_path = Material('mylar', 50 * u.micron) + Material('Al', 1 * u.mm)
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.

transmission(energy)[source]#

Provides 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.