corrct.physics.materials

Materials support functions and classes.

@author: Nicola VIGANÒ, ESRF - The European Synchrotron, Grenoble, France, and CEA-IRIG, Grenoble, France

Module Contents

Classes

VolumeMaterial

VolumeMaterial class, that can be used for predicting fluorescence and Compton productions, attenuation, etc.

API

class corrct.physics.materials.VolumeMaterial(materials_fractions: collections.abc.Sequence[numpy.typing.NDArray], materials_composition: collections.abc.Sequence, voxel_size_cm: float, dtype: numpy.typing.DTypeLike = None, verbose: bool = False)[source]

VolumeMaterial class, that can be used for predicting fluorescence and Compton productions, attenuation, etc.

Parameters

material_fractions : Sequence Concentration fractions of each material for each voxel. material_compounds : Sequence Compound description of each material. voxel_size_cm : float Voxel size in cm. dtype : DTypeLike, optional Data type of the produced data. The default is None.

Raises

ValueError Raised in case of incorrect parameters.

Initialization

get_attenuation(energy_keV: float) numpy.typing.NDArray[source]

Compute the local attenuation for each voxel.

Parameters

energy_keV : float The X-ray energy.

Returns

NDArray The computed local attenuation volume.

get_element_mass_fraction(element: Union[str, int]) numpy.typing.NDArray[source]

Compute the local element mass fraction through out all the materials.

Parameters

element : str | int The element to look for.

Returns

mass_fraction : NDArray The local mass fraction in each voxel.

_check_parallax_detector(detector: corrct.physics.xrf.DetectorXRF, tolerance: float = 0.01) bool[source]
get_compton_scattering(energy_in_keV: float, angle_rad: Union[float, None] = None, detector: Union[corrct.physics.xrf.DetectorXRF, None] = None) tuple[float, numpy.typing.NDArray][source]

Compute the local Compton scattering.

Parameters

energy_in_keV : float Incoming beam energy. angle_rad : float, optional The detector angle, with respect to incoming beam direction. The default is None. detector : DetectorXRF, optional The detector object. The default is None.

Raises

ValueError In case neither of angle_rad nor detector have been passed.

Returns

energy_out_keV : float The energy of the Compton radiation received by the detector. cmptn_prod : NDArray Local production of Compton radiation.

Either angle_rad or detector need to be supplied.

get_fluo_production(element: Union[str, int], energy_in_keV: float, fluo_lines: Union[str, corrct.physics.xrf.FluoLine, collections.abc.Sequence[corrct.physics.xrf.FluoLine]], detector: Union[corrct.physics.xrf.DetectorXRF, None] = None) tuple[float, numpy.typing.NDArray][source]

Compute the local fluorescence production, for the given line of the given element.

Using Eq. (1) from:

  • T. Schoonjans et al., “The xraylib library for X-ray-matter interactions. Recent developments,” Spectrochim. Acta Part B At. Spectrosc., vol. 66, no. 11-12, pp. 776-784, Nov. 2011, doi: 10.1016/j.sab.2011.09.011.

Parameters

element : str | int The element to consider. energy_in_keV : float The incoming X-ray beam energy. fluo_lines : str | FluoLine | Sequence[FluoLine] The fluorescence line to consider. detector : DetectorXRF, optional The detector geometry. The default is None.

Returns

energy_out_keV : float The emitted fluorescence energy. el_prod : NDArray The local fluorescence production in each voxel.