polycap 1.2
Calculate X-ray transmission through polycapillaries
|
Polycap is a library for C with Python bindings that allows for the simulation of X-ray photons in poly- and monocapillary optics with multi-core processing abilities. This code allows for the study of the influence of the capillary shape, its deviations, surface roughness, reflector material, X-ray energy, source size, distance and divergence on the optic's efficiency, working distance and focal spot size.
For each simulated photon, characterized by a three dimensional position, direction and electric field vector, the transmission efficiency through the optic is calculated as a result of a series of reflections within the capillary optic. Additionally, each transmitted photon is characterized by its exit coordinate, direction and electric field vector as well as traveled photon path length within the polycapillary optic. These parameters are saved in an HDF5 output file.
The polycapillary optic's profile is considered to be of hexagonal shape, due to a hexagonal packing of the single capillaries.
At each photon - capillary wall interaction the reflectivity is determined by the Fresnel equations for s and p polarized light:
\[ R_{s}(\theta,E) = \left| \frac{n_{1} \cos{\theta} - n_{2} \sqrt{1 - \left( \frac{n_{1}}{n_{2}} \sin{\theta} \right)^{2} }}{n_{1} \cos{\theta} + n_{2} \sqrt{1 - \left( \frac{n_{1}}{n_{2}} \sin{\theta} \right)^{2} }} \right|^{2} \\ R_{p}(\theta,E) = \left| \frac{n_{1} \sqrt{1 - \left( \frac{n_{1}}{n_{2}} \sin{\theta} \right)^{2} } - n_{2} \cos{\theta}}{n_{1} \sqrt{1 - \left( \frac{n_{1}}{n_{2}} \sin{\theta} \right)^{2} } + n_{2} \cos{\theta}} \right|^{2} \]
with \(\theta\) the glancing angle of the incident radiation and \(n\) defined as \(n = \alpha - i\beta\) with
\[ \alpha = \left(\frac{hc}{E}\right)^{2} \frac{N_{A}r_{0}\rho}{2\pi} \sum\limits_{j=1}^N \frac{w_{j}}{A_{j}} (Z_{j} + f_{j}^{'}) \\ \beta = \left(\frac{hc}{E}\right)^{2} \frac{N_{A}r_{0}\rho}{2\pi} \sum\limits_{j=1}^N \frac{w_{j}}{A_{j}} f_{j}^{"} = \frac{hc}{4\pi} \frac{\mu_{L}}{E} \]
Here \(h\) is Planck's constant, \(c\) the light velocity, \(E\) the photon energy, \(N_{A}\) Avogadro's number, \(r_{0}\) the classical electron radius, \(\rho\) the material density, \(N\) the number of elements with weight fraction \(w_{j}\), \(A_{j}\) the atomic weight, \(Z_{j}\) the atomic number and \(f_{j}\) the atomic scattering for element \(j\) and \(\mu_{L}\) the linear attenuation coefficient. By propagating the photon through the capillary and determining the reflectivity at each point a final transmission efficiency, exit coordinate and direction is obtained. This process can then be repeated for multiple photons as a means to simulate an X-ray source with known distance, size and divergence propagating through the capillary optic.