Metadata-Version: 2.4
Name: KKCalc2
Version: 1.0.0
Summary: Kramers-Kronig transforms for optical data.
Project-URL: code, https://github.com/xraysoftmat/kkcalc
Project-URL: documentation, https://kkcalc.readthedocs.io/en/latest/
Author-email: Benjamin Watts <benjamin.watts@gmail.com>, Matthew Gebert <mattheuu.gebert@gmail.com>
Maintainer-email: Matthew Gebert <mattheuu.gebert@gmail.com>
License: Copyright (c) 2013 Benjamin Watts, Daniel J. Lauk
        
        This software is provided 'as-is', without any express or implied warranty.
        In no event will the authors be held liable for any damages arising from the
        use of this software.
        
        Permission is granted to anyone to use this software for any purpose,
        including commercial applications, and to alter it and redistribute it
        freely, subject to the following restrictions:
        
            1. The origin of this software must not be misrepresented; you must not
               claim that you wrote the original software. If you use this software
               in a product, an acknowledgment in the product documentation would be
               appreciated but is not required.
        
            2. Altered source versions must be plainly marked as such, and must not
               be misrepresented as being the original software.
        
            3. This notice may not be removed or altered from any source
               distribution.
License-File: LICENSE
Keywords: Contrast,Kramers-Kronig,Optical Data,Spectroscopy,Transform,X-ray
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: numpy~=2.4.0
Requires-Dist: scipy~=1.17.1
Provides-Extra: gui
Requires-Dist: matplotlib~=3.10; extra == 'gui'
Requires-Dist: pyqt6~=6.10; extra == 'gui'
Description-Content-Type: text/x-rst

=====================================
 KKCalc2
=====================================

``kkcalc2`` 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 <https://github.com/xraysoftmat>`_.

|tool-semver| |tool-black| |tool-ruff| |tool-numpydoc|

|PyPI Version2| |readthedocs| |Coveralls| |Pre-commit|

|PyTest| |Linting| |Documentation|

.. |PyPI Version| image:: https://img.shields.io/pypi/v/kkcalc?label=KKCalc&logo=pypi
   :target: https://pypi.org/project/kkcalc/
   :alt: pypi
.. |PyPI Version2| image:: https://img.shields.io/pypi/v/kkcalc2?label=KKCalc2&logo=pypi
    :target: https://pypi.org/project/kkcalc2/
    :alt: pypi
.. |PyTest| image:: https://github.com/xraysoftmat/kkcalc/actions/workflows/tests.yml/badge.svg
    :alt: PyTest
    :target: https://github.com/xraysoftmat/kkcalc/actions/workflows/test.yml
.. |Linting| image:: https://github.com/xraysoftmat/kkcalc/actions/workflows/linting.yml/badge.svg
    :alt: Linting
    :target: https://github.com/xraysoftmat/kkcalc/actions/workflows/linting.yml
.. |Documentation| image:: https://github.com/xraysoftmat/kkcalc/actions/workflows/docs.yml/badge.svg
    :alt: Documentation
    :target: https://github.com/xraysoftmat/kkcalc/actions/workflows/docs.yml
.. |Coveralls| image:: https://img.shields.io/coverallsCoverage/github/xraysoftmat/kkcalc?branch=v2&label=Coveralls
    :alt: Coverage Status
    :target: https://coveralls.io/github/xraysoftmat/kkcalc?branch=v2
.. |Pre-commit| image:: https://results.pre-commit.ci/badge/github/xraysoftmat/kkcalc/v2.svg
    :alt: pre-commit.ci status
    :target: https://results.pre-commit.ci/latest/github/xraysoftmat/KKCalc/v2
.. |readthedocs| image:: https://img.shields.io/readthedocs/kkcalc?version=latest&style=flat&label=ReadtheDocs
    :alt: Documentation
    :target: https://kkcalc.readthedocs.io/

.. |tool-semver| image:: https://img.shields.io/badge/versioning-Python%20SemVer-blue.svg
    :alt: Python SemVer
    :target: https://python-semantic-release.readthedocs.io/en/stable/
.. |tool-black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :alt: Code style: black
    :target: https://github.com/psf/black
.. |tool-ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
    :alt: Ruff
    :target: https://github.com/astral-sh/ruff
.. |tool-numpydoc| image:: https://img.shields.io/badge/doc_style-numpydoc-blue.svg
    :alt: Code doc: numpydoc
    :target: https://github.com/numpy/numpydoc

Introduction
############

``kkcalc2`` is an open-source `python` package to calculate the Kramers-Kronig (inverse) transform of X-ray absorption (dispersion) data:

.. note: mathjax github requires double backslashes to properly compute.

$$f_2(E) = \\frac{2}{\\pi} P \\int_{0}^{\\infty}\\frac{x f_1(x)}{x^2 - E^2} dx + \\mathcal{Z}^\\star$$

where $f_1$ and $f_2$ are the real and imaginary parts of the complex index of refraction, respectively, $\\mathcal{Z}^\\star$ is the relativistic correction, and $P$ denotes the Cauchy principal value at ($x=E$).

``kkcalc2`` uses a polynomial representation algorithm developed by Watts [1]_.

This package provides an object oriented API, to evaluate optical constants (index of refraction, absorption and dispersion, etc.), extend measurement spectra with databases, or can be accessed through a PyQT6 GUI interface. Documentation can be found at  `readthedocs <https://kkcalc.rtfd.org/>`_, and releases (including documentation and executable builds) can be found at `github <https://github.com/xraysoftmat/kkcalc>`_.

References
==========

.. [1] 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>`_

.. We use the optical constants databases from Henke et al. [2]_, Biggs and Lighthill [3]_.

..
    .. [2] 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>`_.

    .. [3] 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>`_
