Skip to content

This app is for fitting Time Resolved Photoluminescence (TRPL) measurement data that includes the Instrument Response Function (IRF). It uses a reconvolution method to account for the IRF of the instrument system. It outputs fitting parameters and offers multiple lifetime decay models.

License

Notifications You must be signed in to change notification settings

RossHaroldson/TRPLFitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRPLFitter

Time-Resolved Photoluminescence (TRPL) Reconvolution and Analysis Tool

alt text

A fast, interactive fitting tool for TRPL data with full instrument response function (IRF) reconvolution.


Overview

TRPL Fitter is a Python-based desktop and web app for analyzing time-resolved photoluminescence (TRPL) data.
It performs reconvolution fitting to extract lifetimes and decay parameters while accounting for the instrument response function (IRF) of your measurement system.

Built with Dash, it provides an intuitive GUI for loading, visualizing, and fitting TRPL datasets interactively via a web browser.


Key Features

  • Full reconvolution fitting - accounts for IRF and response broadening
  • Interactive visualization - inspect fits, residuals, and IRFs in real time
  • Multi-exponential decay models - single or multi-component fits
  • Save and export results - lifetimes, amplitudes, χ², plots
  • Standalone app or Python module - run as an executable or import functions
  • Cross-platform: Windows, macOS, and Linux support
  • Built using: Python 3.11+, Dash, NumPy, SciPy, Plotly, PyInstaller

Quick Start

Installation (with uv recommended)

# Clone the repository
git clone https://github.com/RossHaroldson/TRPLFitter.git
cd TRPLFitter

# Create and activate environment
uv sync

# Run the app
uv run trpl

The app will automatically start on http://127.0.0.1:8055 - open it in your browser.

Installation (without uv)

Windows Install (PowerShell)

# Clone the repository
git clone https://github.com/RossHaroldson/TRPLFitter.git
cd TRPLFitter

# Create an isolated Python environment with the .venv folder.
python -m venv .venv

# Activate that environment so Python/pip operate inside it.
.\.venv\Scripts\Activate.ps1

# Update pip (package installer) to the latest version available.
python -m pip install --upgrade pip

# Install TRPLFitter and its dependencies into the active environment.
python -m pip install -e .

macOS / Linux Install (Bash/Zsh)

# Clone the repository
git clone https://github.com/RossHaroldson/TRPLFitter.git
cd TRPLFitter

# Create an isolated Python environment with the .venv folder.
python3 -m venv .venv

# Activate that environment so Python/pip operate inside it.
source .venv/bin/activate

# Update pip (package installer) to the latest version available.
python -m pip install --upgrade pip

# Install TRPLFitter and its dependencies into the active environment.
python -m pip install -e .

Launch the control UI locally

python -m trplfitter

alt text

Start the web server and go to the locally hosted web address (e.g. https://127.0.0.1:8055/)


Using the app

  1. Upload your .csv text file that contains the time, measurement counts, and the IRF measurement. (If you don't have an IRF measurement you can enable "Use Gaussian IRF" or "Use Double Gaussian IRF" to fit the IRF to a Gaussian function.)
  2. Choose the proper Time, TRPL, and IRF columns via the drop down menus
  3. Choose the model you want to use and how many exponential components if applicable via the NEXP dropdown menu
  4. Enable or disable "FIT T0" to fit for a small delay if necessary. (It is recommended to leave this disabled)
  5. Enable or disable "FIT BG" to fit for a background level in the measurement. (Its recommended to leave this disabled unless you know for sure there is a background level)
  6. You can disable auto-fit and modify the fit timeout duration.
  7. You can modify the initial guess value, lower, and upper bounds for each parameter.
  8. You can fix a parameter and it will show up in blue font.
  9. The fitted parameters are reported in the table on the right side of the page.
  10. Fitted parameters with red font denote a parameter's 95% confidence interval greater than the fitted value itself. (This suggests that the fitted parameter's value isn't well optimized or necessary)
  11. You can use the plot controls to zoom, pan, save, etc...
  12. A more detailed report is generated at the bottom of the page that can be saved or copy and pasted.

Standalone Executable

You can download prebuilt executables under Releases or build your own with pyinstaller.

Building your own executable

Activate the same virtual environment. Build a fresh standalone executable using the PyInstaller spec.

.\.venv\Scripts\Activate.ps1
pyinstaller --clean TRPLFitter.spec

The portable executable is written to dist\TRPLFitter.exe.

Repository Layout

  • src/trplfitter/ – Python package (Dash server, callbacks, layout, control entry point).
  • src/trplfitter/legacy/ – Archived Tkinter UI (tkinter_app.py) kept for reference only.
  • assets/ – Dash static assets (CSS themes, icon, bundled sample dataset).
  • TRPLFitter.spec – PyInstaller specification used for reproducible builds.

License

Released under the MIT License.

About

This app is for fitting Time Resolved Photoluminescence (TRPL) measurement data that includes the Instrument Response Function (IRF). It uses a reconvolution method to account for the IRF of the instrument system. It outputs fitting parameters and offers multiple lifetime decay models.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •