kkcalc is a comprehensive toolkit for calculating Kramers Kronig transforms of X-ray absorption/dispersion data, and is built to the feature-rich standards of xraysoftmat.
kkcalc is an open-source python package to calculate the Kramers-Kronig (inverse) transform of X-ray absorption (dispersion) data,
f_2 (E) = \frac{2}{\pi} P \int_{0}^{\infty}\frac{x f_1(x)}{x^2 - E^2} dx + \mathcal{Z}^\star
using a polynomial representation algorithm developed by Watts^[[1](#1)].
This package provides an object oriented API, to evaluate optical constants (index of refraction, absorption and dispersion, etc.), extend measurement spectra with databases.
KKCalc is usable via an object-oriented Python API, or through a PyQT6 GUI interface. Documentation can be found at [readthedocs](https://kkcalc.rtfd.org/), or can be [built](#docbuild) for offline.
Cite our previous work for this repository here[<sup>[1]</sup>](#1).
- GUI Interface
- Contrast Calculations
- Can calculate the relative contrast between materials in a mix.
## References
<a id=1><sup>[1]</sup></a> Benjamin Watts, "Calculation of the Kramers-Kronig transform of X-ray spectra by a piecewise Laurent polynomial method", Opt. Express 22, (2014) 23628-23639. [DOI:10.1364/OE.22.023628](https://doi.org/10.1364/OE.22.023628)
<a id=1><sup>[2]</sup></a> B.L. Henke, E.M. Gullikson, and J.C. Davis, "X-ray interactions: photoabsorption, scattering, transmission, and reflection at E=50-30000 eV, Z=1-92", Atomic Data and Nuclear Data Tables 54 (2) (1993) 181-342 [DOI:10.1006/adnd.1993.1013](https://doi.org/10.1006/adnd.1993.1013).
<a id=1><sup>[3]</sup></a> F. Biggs, and R. Lighthill, "Analytical approximations for X-ray cross-sections III", Sandia Report SAND87-0070 UC-34 (1988). [DOI:10.2172/7124946](https://doi.org/10.2172/7124946)