corrct.physics.xraylib_helper

xraylib handling functions.

@author: Nicola VIGANÒ, CEA-IRIG, Grenoble, France

Module Contents

Functions

get_element_number

Return the element number from the symbol.

get_element_number_and_symbol

Return both the element symbol and number from either the symbol or the number.

get_compound

Build a compound from the compound composition string.

get_compound_cross_section

Compute a compound cross section for the given incoming photon energy.

API

corrct.physics.xraylib_helper.get_element_number(element: Union[str, int]) int[source]

Return the element number from the symbol.

Parameters

element : str | int The element symbol (or number, which won’t be converted).

Returns

int The corresponding element number.

corrct.physics.xraylib_helper.get_element_number_and_symbol(element: Union[str, int]) tuple[str, int][source]

Return both the element symbol and number from either the symbol or the number.

Parameters

element : str | int The element symbol (or number, which won’t be converted).

Returns

tuple[str, int] The element symbol and number.

corrct.physics.xraylib_helper.get_compound(cmp_name: str, density: Union[float, None] = None) dict[source]

Build a compound from the compound composition string.

Parameters

cmp_name : str Compund name / composition. density : float, optional The density of the compound. If not provided it will be approximated from the composing elements. The default is None.

Returns

cmp : dict The compound structure.

corrct.physics.xraylib_helper.get_compound_cross_section(compound: dict, mean_energy_keV: float) float[source]

Compute a compound cross section for the given incoming photon energy.

Parameters

compound : dict The compound structure (as returned by get_compound) mean_energy_keV : float The average photon energy

Returns

float The computed cross-section