From e62282226ed88bee61c32cf7632f3c5c4ce106bb Mon Sep 17 00:00:00 2001 From: Matthew Newville Date: Sat, 12 Oct 2024 13:23:19 -0500 Subject: [PATCH] some doc improvements --- doc/examples.rst | 257 +++++++++++++++++++++++++---------------------- 1 file changed, 139 insertions(+), 118 deletions(-) diff --git a/doc/examples.rst b/doc/examples.rst index 36564ef..138f9e0 100644 --- a/doc/examples.rst +++ b/doc/examples.rst @@ -155,69 +155,34 @@ X-ray flux calculations for ionization chambers and photodiodes --------------------------------------------------------------------- Gas-filled ionization chambers are widely used as X-ray detectors. They are -simple to use, inexpensive, and can be highly linear in estimating the -photon flux over many orders of magnitude. X-rays entering a chamber -filled with an inert gas (typically He, N2, or one of the noble gases, or a -mixture of these) will be partially absorbed by the gas, with the strong -energy dependence shown above. By adjusting the composition of the gas, -nearly any fraction of the incident X-ray beam can be absorbed at a -particular X-ray energy, making these ideal detectors to sample the -intensity of an X-ray beam incident on a sample, while attenuating only a -fraction of the beam. +simple to use, inexpensive, and can give highly linear measures of photon flux +over many orders of magnitude. X-rays entering a chamber filled with an inert +gas (typically He, N2, or one of the noble gases, or a mixture of these) will +be partially absorbed by the gas, with the strong energy dependence shown +above. By adjusting the composition of the gas, nearly any fraction of the +incident X-ray beam can be absorbed at a particular X-ray energy, making these +ideal detectors to sample the intensity of an X-ray beam incident on a sample, +while attenuating only a fraction of the beam. Some of the X-rays in the gas will be absorbed by the photo-electric effect -which will *ionize* the gas, generating free electrons and energetic ions. Te +which will *ionize* the gas, generating free electrons and energetic ions. The first ionization event will generate an electron-ion pair with the energy of the X-ray minus the binding energy of the core electron. The high-energy electron and ion pair will further ionize other gas molecules. With an electric potential (typically on the order of 1 kV /cm) across the plates of -the chamber, a current can be measured that is proportional to the X-ray -energy and fluence of the X-rays. +the chamber, a current is generated that is proportional to the X-ray energy +and fluence of the X-rays. -In addition to the photo-electric absorption, X-rays can be attenuated by gas -molecules in an ion chamber by incoherent (Compton) or coherent (Rayleigh) -scattering processes. The coherent scattering will not generate any electrons -in the gas, but will elastically scatter X-rays out of the main beam. -Incoherent scattering will generate some current, though not all (and -typically only a small portion) of the incident X-ray energy is given to an -electron to generate a current. Compton scattering gives a distribution of -energies to the scattered electron depending on the angle of scattering. The -median energy of electrons generated by Compton scattering X-rays of energy -:math:`E` at 90 degrees will be - -.. math:: - E_{median} = E / (1 + m_ec^2 / E) - -For X-rays of 10 keV, :math:`E_{median}` is about 192 eV. For 20 keV X-rays, -it will be 750 eV, and for 50 keV X-rays, it will be 4.5 keV. Because the -angular distribution of Compton scattering is not uniform, these median values -over-estimate the amount of energy transferred to the scattered electron by a -small amount that increases with energy. The mean energy of the -Compton-scattered electron can be found by integrating the Klein-Nishina -distribution. Since these values depend only on the incident X-ray energy, -these calculations have been done and the values tabulated in the -`Compton_energies` table in the XrayDB sqlite database. - -Although the energy transferred to the electron by Compton scattering is much -less than by the photo-electric process the contribution can be important. -This is especially true for low-Z gas molecules such as He and N2 at -relatively high energies (10 keV and above) for which incoherent scattering -becomes much more important than photo-electric absorption, as shown above -for C. That is, for accurate estimates of fluxes from ion chamber currents at -energies about 20 keV or so, the contribution from Compton scattering should -be included. For photo-diodes (typically made of Si), the Compton scattering -cross-section exceeds the photo-electric cross-section about 56 keV. Effective Ionization Potentials of gases and semiconductors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The process of converting the X-ray generated current into X-ray fluence -involves several steps. The energy from a single X-ray-generated -electron is converted into a number of electron-ion pairs given by the -*effective ionization potential* of the gas. These are reasonably -well-known values (see :cite:`Knoll2010`) that are all between 20 and 40 -eV, given in the :ref:`Table of Effective Ionization Potentials -`. +involves several steps. The energy from a single X-ray-generated electron is +converted into a number of electron-ion pairs given by the *effective +ionization potential* of the gas. These values are available from a few +sources and range between 20 and 40 eV, given in the :ref:`Table of Effective +Ionization Potentials `. .. index:: Table of Effective Ionization Potentials .. _xray_ionpot_table: @@ -228,63 +193,118 @@ eV, given in the :ref:`Table of Effective Ionization Potentials those supported by the functions :func:`ionization_potential` and :func:`ionchamber_fluxes`. - +----------------------+----------------+ - | gas/materia name(s) | potential (eV) | - +======================+================+ - | hydrogen, H | 36.5 | - +----------------------+----------------+ - | helium, He | 41.3 | - +----------------------+----------------+ - | nitrogen, N, N2 | 34.8 | - +----------------------+----------------+ - | oxygen, O, O2 | 30.8 | - +----------------------+----------------+ - | neon, Ne | 35.4 | - +----------------------+----------------+ - | argon, Ar | 26.4 | - +----------------------+----------------+ - | krypton, Kr | 24.4 | - +----------------------+----------------+ - | xenon, Xe | 22.1 | - +----------------------+----------------+ - | air | 33.8 | - +----------------------+----------------+ - | methane, CH4 | 27.3 | - +----------------------+----------------+ - | carbondioxide, CO2 | 33.0 | - +----------------------+----------------+ - | silicon, Si | 3.68 | - +----------------------+----------------+ - | germanium, Ge | 2.97 | - +----------------------+----------------+ + +-----------------------+----------------+ + | gas/material name(s) | potential (eV) | + +=======================+================+ + | hydrogen, H | 36.5 | + +-----------------------+----------------+ + | helium, He | 41.3 | + +-----------------------+----------------+ + | nitrogen, N, N2 | 34.8 | + +-----------------------+----------------+ + | oxygen, O, O2 | 30.8 | + +-----------------------+----------------+ + | neon, Ne | 35.4 | + +-----------------------+----------------+ + | argon, Ar | 26.4 | + +-----------------------+----------------+ + | krypton, Kr | 24.4 | + +-----------------------+----------------+ + | xenon, Xe | 22.1 | + +-----------------------+----------------+ + | air | 33.8 | + +-----------------------+----------------+ + | methane, CH4 | 27.3 | + +-----------------------+----------------+ + | carbondioxide, CO2 | 33.0 | + +-----------------------+----------------+ + | silicon, Si | 3.68 | + +-----------------------+----------------+ + | germanium, Ge | 2.97 | + +-----------------------+----------------+ From this table, we can see that the absorption (by photo-electric effect) of 1 -X-ray of energy 10 keV will eventually generate about 300 electron-ion pairs. -That is not much current, but if :math:`10^8 \,\rm Hz` X-rays are absorbed per -second, then the current generated will be around 5 nA. Of course, the -thickness of the gas or more precisely the length of gas under ionizing -potential will have an impact on how much current is generated. The -photo-current will then be amplified and converted to a voltage using a current -amplifier, and that voltage will then recorded by a number of possible means. -Note that while the ion chamber itself will be linear over many orders of -magnitude of X-ray flux (provided the potential between the plates is high -enough - typically in the 1 kV/cm range to efficiently collect all the charged -particles before the recombine), a current amplifier at a particular setting of -sensitivity will be linear only over a couple orders of magnitude (typically -between output voltage of 0.05 to 5 V). Because of this, the sensitivity of -the current amplifier used with an ion chamber needs careful attention. +X-ray with energy 10 keV will generate about 300 electron-ion pairs. That is +not much current, but if :math:`10^8 \,\rm Hz` X-rays are absorbed per second, +then the current generated will be around 5 nA. Of course, the length of the +gas or more precisely the length of gas under ionizing potential will have an +impact on how much current is generated. The photo-current generated can be +amplified and converted to a voltage using a current amplifier, and that +voltage will then recorded by a number of possible mean: a voltage-to-frequency +generator and a digital counter is a common method for integrated current for a +specific amount of time, but other sampling methods can also be used. + +An ion chamber can be linear over many orders of magnitude of X-ray flux, +provided the potential between the plates is high enough - typically in the 1 +kV/cm range to efficiently collect all the charged particles before the +recombine. As an important practical note, a typical current amplifier at a +particular setting of sensitivity will be linear only over a limited range +(often over an output voltage of 0.02 to 5 V). Because of this, the +sensitivity of the current amplifier used with an ion chamber needs careful +attention to avoid saturation and maintain sensitivity. A photo-diode works in much the same way as an ionization chamber. X-rays incident on the diode (typically Si or Ge) will be absorbed and generate a -photo-current that can be collected. Typically PIN diodes are used, and -with a small reverse bias voltage. Because the electrons do not need to -escape the material but generate a current transported in the -semiconductor, the effective ionization potential is much lower - a few -times the semiconductor band gap instead of a few time the lowest -core-level ionization potential. The current generated per X-ray will be -larger than for an ion chamber, but still amplified with a current -amplifier in the same way as is used for an ion chamber. Generally, diodes -are thick enough that they absorb all incident X-rays. +photo-current that can be collected. Typically PIN diodes are used, and a +small reverse bias voltage is often applied. Because the electrons do not need +to escape the material but generate a current transported in the semiconductor, +the effective ionization potential is much lower - a few times the +semiconductor band gap instead of a few time the lowest core-level ionization +potential. The current generated per X-ray will therefore be larger than for +an ion chamber, and will also generally have a much faster response time. The +generated current will still measured in the same manner as a gas-filled +ionization typically using a current amplifier and integrating counter. Of +course, the thickness of the diode is difficult to adjust. The active length of +diodes are typically a few hundred microns, which is often thick enough to +absorb nearly all the incident X-rays. + + +Compton scattering and Ion Chamber Current +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In addition to photo-electric absorption, X-rays can be attenuated by gas +molecules in an ion chamber by incoherent (Compton) or coherent (Rayleigh) +scattering processes. The coherent scattering will not generate any electrons +in the gas, but will elastically scatter X-rays out of the main beam. On the +other hand, incoherent scattering will generate some current, though typically +only a small portion of the incident X-ray energy is given to a scattered +electron. In fact, Compton scattering has a distribution of energies given to +the scattered electron depending on the angle of scattering, so that the energy +of the scattered electron is + +.. math:: + E_{e} = E_{\gamma} - E_{\gamma} / [1 + E_{\gamma}/(m_ec^2) (1- \cos\theta)] + + +where :math:`E_{\gamma}` is the incident X-ray energy, and :math:`\theta` is the +scattering angle. From this, it easy to estimate the median energy of +electrons generated by Compton scattering X-rays of energy :math:`E` at 90 +degrees will be + +.. math:: + E_{\rm median} = E_{\gamma} / (1 + m_ec^2 / E_{\gamma}) + +(recall that :math:`1 - 1/(1+x) = 1 / (1+1/x)`). For X-rays of 10 keV, +:math:`E_{\rm median}` is about 192 eV. For 20 keV X-rays, it will be 750 eV, +and for 50 keV X-rays, it will be 4.5 keV. Because of the angular distribution +of Compton scattering is not uniform, these median values over-estimate the +amount of energy transferred to the scattered electron by a small amount that +increases with energy. The mean energy of the Compton-scattered electron can +be found by integrating the Klein-Nishina distribution. Since these values +depend only on the incident X-ray energy, these calculations have been done and +the values tabulated in the `Compton_energies` table in the XrayDB sqlite +database. + +Although the energy transferred to the electron by Compton scattering is much +less than by the photo-electric process the contribution can be important. +This is especially true for low-Z gas molecules such as He and N2 at +relatively high energies (10 keV and above) for which incoherent scattering +becomes much more important than photo-electric absorption, as shown above +for C. That is, for accurate estimates of fluxes from ion chamber currents at +energies about 20 keV or so, the contribution from Compton scattering should +be included. For photo-diodes (typically made of Si), the Compton scattering +cross-section exceeds the photo-electric cross-section about 56 keV, and so +should also be included for high-energy X-ray measurements. Ion Chamber Flux calculations @@ -332,20 +352,22 @@ both electrons and ions using the effective ionization potential above: .. math:: C_{\rm photo} = 2 q_e E I_{\rm photo} / V_{\rm eff} -where :math:`q_{e}` is the electron charge (1.6e-19 C), :math:`E` is the incident -X-ray energy (in eV), :math:`I_{\rm photo}` is the flux (in Hz), and -:math:`V_{\rm eff}` is the effective ionization potential for the gas. The -leading 2 comes because both electrons and ions are typically counted for the -current from an ion chamber. It is sometimes useful to add a Frisch mesh grid -to collect the slower ions and shunt them so as to not count that portion of -the current, and thereby give the ion chamber a faster time response. In that -case, the current will be half of the value given above. - -The coherent (Rayleigh) scattering produces no electrons, but the incoherent -(Compton) scattering does. The energy of the Compton-scattered electron varies -with both X-ray energy and scattering angle, as does the probability of -scattering. Integrating over all angles gives the mean electron energy, which -we use to obtain the current from the incoherent scattering: +where :math:`q_{e}` is the electron charge (:math:`1.6\times10^{-19} \rm{C}`), +:math:`E` is the incident X-ray energy (in eV), :math:`I_{\rm photo}` is the +flux (in Hz), and :math:`V_{\rm eff}` is the effective ionization potential for +the gas. The leading 2 comes because both electrons and ions are typically +counted for the current from an ion chamber. It is sometimes useful to add a +Frisch mesh grid to collect the slower ions and shunt them so as to not count +that portion of the current, and thereby give the ion chamber a faster time +response. In that case, the current will be half of the value given above. + +As discussed above, the coherent (Rayleigh) scattering produces no electrons, +but the incoherent (Compton) scattering does, and the energy of the the +Compton-scattered electron varies with both X-ray energy and scattering angle, +as does the probability of scattering. Integrating over all angles (and +assuming the ion chamber is large enough to stop the scattered electrons) gives +the mean electron energy, which we use to obtain the current from the +incoherent scattering: .. math:: C_{\rm incoh} = 2 q_e E_{\rm mean} I_{\rm incoh} / V_{\rm eff} @@ -354,7 +376,6 @@ where :math:`E_{\rm mean}` is the mean energy of Compton-scattered electron (approximately, but slightly less than the :math:`E_{\rm median}` value above. - The current from an ion_chamber is typically measured as a voltage generated by a current-to-voltage amplifier. The measured voltage will have a gain or sensitivity in units of `A/V`. The goal is typically to calculate the flux