TLDecPy core library for thermoluminescence glow-curve deconvolution.
Project description
TLDecPy: Thermoluminescence Glow-Curve Deconvolution in Python
tldecpy is an open-source scientific Python library for thermoluminescence (TL) glow-curve analysis, nonlinear deconvolution, and kinetic-model benchmarking.
The project is designed for reproducible research workflows in radiation dosimetry and TL materials analysis, with typed APIs and physically motivated models.
Supported Kinetic Models
TLDecPy includes single-peak and multi-peak deconvolution with:
- First-order (FO):
fo_rq,fo_ka,fo_wp,fo_rb - Second-order (SO):
so_ks,so_la - General-order (GO):
go_kg,go_rq,go_ge - One-Trap One-Recombination center (OTOR):
otor_lw(Lambert W),otor_wo(Wright Omega) - Mixed-order families:
mo_kitis,mo_quad,mo_vej - Continuous trap-distribution models (Gaussian and Exponential forms)
Highlights
- Multi-component deconvolution with robust losses and optional Poisson weighting
- Automatic initialization helpers (
autoinit_multi, peak detection, preprocessing) - Uncertainty metrics and diagnostics in fit outputs
- Synthetic data generation utilities for method validation
- Bundled Refglow benchmark datasets (
x001tox010) - Typed models and results (
py.typed, Pydantic v2 schemas)
Installation
From source
git clone https://github.com/HideOnParadise/TLDecPy.git
cd TLDecPy
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
Planned PyPI install
pip install tldecpy
Quickstart
import tldecpy as tl
# 1) Load a reference glow curve (Refglow)
T, I = tl.load_refglow("x001")
# 2) Automatic initialization of peaks and optional background
peaks, bg = tl.autoinit_multi(
T,
I,
max_peaks=3,
allow_models=("fo_rq", "go_kg", "otor_lw"),
bg_mode="auto",
)
# 3) Run deconvolution
result = tl.fit_multi(
T,
I,
peaks=peaks,
bg=bg,
beta=1.0,
robust=tl.RobustOptions(loss="soft_l1", f_scale=2.0, weights="poisson"),
options=tl.FitOptions(local_optimizer="trf"),
)
print("Converged:", result.converged)
print("R2:", f"{result.metrics.R2:.4f}", "FOM:", f"{result.metrics.FOM:.3f}%")
for peak in result.peaks:
print(peak.name, peak.model, peak.params)
For an end-to-end OTOR demonstration, see:
examples/example_otor_fit.pyexamples/example_refglow002_manual_fit.py(manual Refglow x002 deconvolution)
Development Quality Checks
make lint
make typecheck
make test
make qa
Citation
If TLDecPy contributes to your research, please cite the software archive (Zenodo DOI once released).
Suggested BibTeX entry:
@software{romero2026tldecpy,
title = {TLDecPy},
author = {Romero, Cesar},
year = {2026},
url = {https://github.com/HideOnParadise/TLDecPy},
note = {Zenodo DOI to be added after first release}
}
License
This project is distributed under the BSD 3-Clause License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tldecpy-1.0.0.tar.gz.
File metadata
- Download URL: tldecpy-1.0.0.tar.gz
- Upload date:
- Size: 81.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27a0e6b06a879f97cb160f6550e8ee0394a7057facec874f17ff8b009c431601
|
|
| MD5 |
59ecbac45cf3bd57f00e34cfaf3a97f2
|
|
| BLAKE2b-256 |
4d1c275c1e1db4489e27921a12ce710610542c21d5ec88431dcb5510dbecc541
|
Provenance
The following attestation bundles were made for tldecpy-1.0.0.tar.gz:
Publisher:
release-pypi.yml on HideOnParadise/TLDecPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tldecpy-1.0.0.tar.gz -
Subject digest:
27a0e6b06a879f97cb160f6550e8ee0394a7057facec874f17ff8b009c431601 - Sigstore transparency entry: 995119487
- Sigstore integration time:
-
Permalink:
HideOnParadise/TLDecPy@b8b1903b4104e64f0131cb723a039afb4c7e37a3 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/HideOnParadise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@b8b1903b4104e64f0131cb723a039afb4c7e37a3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tldecpy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tldecpy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 85.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdc03b8c631255655f60744a3554e36d50eece12aaff0d9e1764735b58585909
|
|
| MD5 |
993edcc6cd1be55108bb04d475127338
|
|
| BLAKE2b-256 |
280d83365d418966908734da7395160723f453dcace5971cd894e8fe4d40a4d9
|
Provenance
The following attestation bundles were made for tldecpy-1.0.0-py3-none-any.whl:
Publisher:
release-pypi.yml on HideOnParadise/TLDecPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tldecpy-1.0.0-py3-none-any.whl -
Subject digest:
fdc03b8c631255655f60744a3554e36d50eece12aaff0d9e1764735b58585909 - Sigstore transparency entry: 995119498
- Sigstore integration time:
-
Permalink:
HideOnParadise/TLDecPy@b8b1903b4104e64f0131cb723a039afb4c7e37a3 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/HideOnParadise
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@b8b1903b4104e64f0131cb723a039afb4c7e37a3 -
Trigger Event:
push
-
Statement type: