Utility Functions
- xrayphysics.xrayPhysics.effectiveZ(self, chemicalFormula, min_energy=10.0, max_energy=100.0, arealDensity=0.0)
Calculate the effective atomic number of a material
- Parameters:
chemicalFormula (string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
min_energy (scalar) – the minimum of the energy in which to perform the calculation
max_energy (scalar) – the maximum of the energy in which to perform the calculation
arealDensity (scalar) – the areal density (g/cm^2) to use for the calculation
- Returns:
The effective atomic number
- xrayphysics.xrayPhysics.effectiveLAC(self, Z, density, thickness, spectralResponse, gammas)
Calculates the effective Linear Attenuation Coefficient (LAC) of a polychromatic x-ray beam through of a material of specified thickness
The model is given by
\[\begin{split}\begin{eqnarray*} \mu_{eff}(L) &:=& \frac{-\log\left(\int \widehat{s}(\gamma) e^{-\mu(\gamma)L} \, d\gamma\right)}{L} \\ \widehat{s}(\gamma) &:=& \frac{s(\gamma)}{\int s(\gamma') \, d\gamma'} \end{eqnarray*}\end{split}\]where \(\mu\) is the LAC of the material, \(\gamma\) is the x-ray energy (keV), \(L\) is the material thickness, and \(s\) is the x-ray spectra. The limit of \(L \rightarrow 0\) is given by
\[\begin{eqnarray*} \mu_{eff}(0) &:=& \int \widehat{s}(\gamma) \mu(\gamma) \, d\gamma \end{eqnarray*}\]- Parameters:
Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
density (scalar) – mass density (g/cm^3) of the material
thickness (scalar) – the thickness (cm) of the material
spectralResponse (numpy array) – spectra model
gammas (numpy array) – energies at which the spectra model is defined
- Returns:
The effective Linear Attenuation Coefficient (LAC, (length units)^-1)
- xrayphysics.xrayPhysics.effectiveEnergy(self, Z, density, thickness, spectralResponse, gammas)
Calculate the effective energy of a polychromatic beam passing through a material of a given thickness
The model is given by
\[\begin{eqnarray*} \mu(\gamma_{eff}) &:=& \mu_{eff}(L) \end{eqnarray*}\]i.e., the effective energy is the energy at which the LAC of the material at this energy is equal to the effective LAC of the material. See the description of the effectiveLAC function
- Parameters:
Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
density (scalar) – mass density (g/cm^3) of the material
thickness (scalar) – the thickness (cm) of the material
spectralResponse (numpy array) – spectra model
gammas (numpy array) – energies at which the spectra model is defined
- Returns:
The monochromatic energy (keV) that would provide the same attenuation as the given polychromatic spectra
- xrayphysics.xrayPhysics.transmission(self, Z, density, thickness, spectralResponse, gammas)
Calculate the transmission through a given material
This model is given by
\[\begin{eqnarray*} \frac{\int s(\gamma) e^{-\mu(\gamma)L} \, d\gamma}{\int s(\gamma') \, d\gamma'} \end{eqnarray*}\]where \(\mu\) is the LAC of the material, \(\gamma\) is the x-ray energy (keV), \(L\) is the material thickness, and \(s\) is the x-ray spectra.
- Parameters:
Z (scalar or string) – atomic number, chemical formula, mixture of compounds with mass fractions, or member of the material library
density (scalar) – mass density (g/cm^3) of the material
thickness (scalar) – the thickness (cm) of the material
spectralResponse (numpy array) – spectra model
gammas (numpy array) – energies at which the spectra model is defined
- Returns:
The transmission (unitless) through the given filter