Skip to main content

PicoHarp TCSPC lifetime fitting tool

Project description

LifetimeFittingTool

This is a quick tool I wrote to take some of my TCSPC fluorescence lifetime fitting tools from spectraImport.ipynb and make them usable for other people. It can read PicoHarp .phd files thanks to adreasnow/picoharp-phd and also reads the plain .txt output it can save.

screenshot

The app itself is a basic least squares regression tool but allows you to fit in linear or logarithmic space, supports up to 4 decays, and can export images as well as .csv files of the fitted histograms

Installing

PyPi

The easiest way to get it is to install it directly from pypy, so as too pull all the dependencies:

pip install lifetimefitting

Manually

  • Python (I'm not sure how old you could go, but I know it runs on >3.9)
  • Matplotlib
  • Numpy
  • PyQt6
  • Scipy

These can be installed pretty easily via pip

pip install matplotlib numpy scipy pyqt6

or conda

conda install matplotlib numpy scipy pyqt6

Then you can clone the module down and install it manually

git clone https://github.com/adreasnow/LifetimeFittingTool.git
cd LifetimeFittingTool
python setup.py install

Usage

To run the app, all you need to do is execute the module in python and a QT window should appear :)

python -m lifetimefitting

The Maths

Uses the form of the function:

$$ fl(t)=I_0 exp\bigg(-\frac{t}{\tau}\bigg) $$

Where:

  • $t =$ Time
  • $\tau =$ Fluorescence lifetime
  • $I_0 =$ Initial photon concentration

For the corrected fitting procedure, the convolved function is calculated as:

$$ fl=fl(t)_{IRF}\otimes fl(t) $$

$$ fl_{fitted}=\sum_{i=1}^{\text{exponents}} C_i\cdot fl(t)_i $$

Where:

  • $fl(t)_{IRF} =$ Fitted instrument response function
  • $fl(t)_i =$ Fitted function for each decay
  • $C_i =$ Linear coefficient for each decay

$\chi^2$ is calculated as per fluortools

$$ \chi^2 = \sum_{j=1}^{n} (c_j-\hat{c_j})^2/\hat{c_j}\ \chi^2_{red}=\frac{\chi^2}{n} $$

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

lifetimefitting-0.0.30.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.

lifetimefitting-0.0.30-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file lifetimefitting-0.0.30.tar.gz.

File metadata

  • Download URL: lifetimefitting-0.0.30.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for lifetimefitting-0.0.30.tar.gz
Algorithm Hash digest
SHA256 74659fd5fec73e3ebc092b6d66884036df47b32118dbd3741cd8214cd7a100da
MD5 b0e739168f07a03cdff8ae14af3f9687
BLAKE2b-256 80e7e15a3a3c94a05bd3a33b56436767ebcf98361b5129a3cbf10cb2c2c13eab

See more details on using hashes here.

File details

Details for the file lifetimefitting-0.0.30-py3-none-any.whl.

File metadata

File hashes

Hashes for lifetimefitting-0.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 8df5e5d9cbed9944676a18ba48a317a6a82a5f0fa89a3283bb64dd588793b2cc
MD5 7ddf253a6b64ca336afd4f327f47288a
BLAKE2b-256 4ac5f67eb023b8e1cfe2bdceedbb98bcfcb05065226df2b77b17ed879c828e5d

See more details on using hashes here.

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