Skip to main content

Kinetic Inverse-Laplace Toolbox for MEM fitting

Project description

pyKilt — Kernel-based Inverse Laplace Transform

pyKilt is a lightweight Python package for recovering fluorescence lifetime distributions using the Maximum Entropy Method (MEM). It supports 1D MEM (single-decay) and 2D / global MEM (τ–τ maps or stacks) with optional IRF reconvolution and annealed regularization.

Quick links

  • Full docs: ./docs/ (installation, tutorials, 1D/2D guides, plotting)
  • Examples: ./docs/examples/ (1d_example.py, 2d_example.py)

Installation

From PyPI:

pip install pyKilt

From source (dev):

git clone <repo>
cd pyKilt
pip install -e .[dev]

Minimal usage

1D (single decay)

import numpy as np
import jax.numpy as jnp
from pyKilt import KiltConfig, run_ilt_1d
from pyKilt.plotting import plot_1d_fit, plot_1d_distribution

time = np.linspace(0, 15, 500)
hist = np.loadtxt("my_decay.txt")
tau = jnp.linspace(0.02, 5, 200)
cfg = KiltConfig(use_irf_convolution=True, optimize_eta=True)
res = run_ilt_1d(time, tau, hist, cfg)

# plot best result
fig, ax = plot_1d_fit(time, hist, res["best"]["fit"])
fig, ax = plot_1d_distribution(tau, res["best"]["A"])

2D (global / τ–τ maps)

from pyKilt import KiltConfig, run_ilt_2d
# time: (n_times,), corr_maps: user-provided maps array, tau: lifetime grid
cfg = KiltConfig(global_fit=True, use_irf_convolution=True, optimize_eta=True)
res2d = run_ilt_2d(time, tau, corr_maps, cfg, A_init=A_init)

Key config options (KiltConfig)

  • tau (lifetime grid)
  • optimize_eta, eta_start, eta_end, eta_rounds — annealing schedule for MEM regularization
  • use_irf_convolution, irf, optimize_irf_shift — enable reconvolution and IRF shift search
  • global_fit / A_init — for 2D/global fitting
  • maxiter, rounds_per_eta, conv_pad, sigma2, baseline — solver tuning

Tips

  • Start with a coarse tau grid and short annealing to find stable settings, then refine.
  • Provide experimental IRF and enable reconvolution + IRF shift for accurate fits.
  • Inspect res["trials"] to monitor annealing progression and res["best"] for final outputs.
  • Use plotting helpers in pyKilt.plotting to visualize fits and τ–τ maps.

Documentation & examples

See the docs folder for detailed step-by-step guides:

  • ./docs/usage/1d.md — 1D workflows and examples
  • ./docs/usage/2d.md — 2D/global workflows, A_init suggestions
  • ./docs/usage/plotting.md — plotting helpers
  • ./docs/examples/ — runnable example scripts

Contributing

Open issues or PRs for bugs, examples, doc improvements or feature requests.

License

MIT License See LICENSE in repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pykilt-0.5.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pykilt-0.5.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file pykilt-0.5.0.tar.gz.

File metadata

  • Download URL: pykilt-0.5.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pykilt-0.5.0.tar.gz
Algorithm Hash digest
SHA256 5f165d6ab9f62dd5d496856a384a021b93cdc1184a5f9777566fc6115c632047
MD5 0815d7a8f508122b9019684c89f85872
BLAKE2b-256 fd6db56cb46988a54706cecdfdb068d852614b4bb3a9191dafc4f6d6b5f26d16

See more details on using hashes here.

Provenance

The following attestation bundles were made for pykilt-0.5.0.tar.gz:

Publisher: publish.yml on AdrienR09/pyKilt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pykilt-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pykilt-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pykilt-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cc4915dda8b7f42cbd740ce93dbb19dad38cc350db0aebcd67932c344bc4bd1
MD5 95c63224863cae9f3cbfff036d1dbd7e
BLAKE2b-256 6056ab5f38327604d4ab6e137dd6857ec37c2c118e21ed1d6f1734f01796c878

See more details on using hashes here.

Provenance

The following attestation bundles were made for pykilt-0.5.0-py3-none-any.whl:

Publisher: publish.yml on AdrienR09/pyKilt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page