https://github.com/cgohlke/chebyfit

Fit exponential and harmonic functions using Chebyshev polynomials.

https://github.com/cgohlke/chebyfit

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Keywords

chebyshev-polynomials fluorescence-lifetime-spectroscopy fluorescence-microscopy-imaging image-processing python
Last synced: 6 months ago · JSON representation

Repository

Fit exponential and harmonic functions using Chebyshev polynomials.

Basic Info
Statistics
  • Stars: 2
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
chebyshev-polynomials fluorescence-lifetime-spectroscopy fluorescence-microscopy-imaging image-processing python
Created about 6 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.rst

..
  This file is generated by setup.py

Fit exponential and harmonic functions using Chebyshev polynomials
==================================================================

Chebyfit is a Python library that implements the algorithms described in:

    Analytic solutions to modelling exponential and harmonic functions using
    Chebyshev polynomials: fitting frequency-domain lifetime images with
    photobleaching. G C Malachowski, R M Clegg, and G I Redford.
    J Microsc. 2007; 228(3): 282-295. doi: 10.1111/j.1365-2818.2007.01846.x

:Author: `Christoph Gohlke `_
:License: BSD 3-Clause
:Version: 2025.8.1

Quickstart
----------

Install the chebyfit package and all dependencies from the
`Python Package Index `_::

    python -m pip install -U chebyfit

See `Examples`_ for using the programming interface.

Source code and support are available on
`GitHub `_.

Requirements
------------

This revision was tested with the following requirements and dependencies
(other versions may work):

- `CPython `_ 3.11.9, 3.12.10, 3.13.5, 3.14.0rc 64-bit
- `NumPy `_ 2.3.2

Revisions
---------

2025.8.1

- Drop support for Python 3.10, support Python 3.14.

2025.1.1

- Improve type hints.
- Drop support for Python 3.9, support Python 3.13.

2024.5.24

- Fix docstring examples not correctly rendered on GitHub.

2024.4.24

- Support NumPy 2.

2024.1.6

- Support Python 3.12.

2023.4.22

- Drop support for Python 3.8 and numpy < 1.21 (NEP29).

2022.9.29

- Add type hints.
- Convert to Google style docstrings.

2022.8.26

- Update metadata.
- Drop support for Python 3.7 (NEP 29).

2021.6.6

- Fix compile error on Python 3.10.
- Drop support for Python 3.6 (NEP 29).

2020.1.1

- Drop support for Python 2.7 and 3.5.

2019.10.14

- Support Python 3.8.
- Fix numpy 1type FutureWarning.

2019.4.22

- Fix setup requirements.

2019.1.28

- Move modules into chebyfit package.
- Add Python wrapper for _chebyfit C extension module.
- Fix static analysis issues in _chebyfit.c.

Examples
--------

Fit two-exponential decay function:

.. code-block:: python

    >>> deltat = 0.5
    >>> t = numpy.arange(0, 128, deltat)
    >>> data = 1.1 + 2.2 * numpy.exp(-t / 33.3) + 4.4 * numpy.exp(-t / 55.5)
    >>> params, fitted = fit_exponentials(data, numexps=2, deltat=deltat)
    >>> numpy.allclose(data, fitted)
    True
    >>> params['offset']
    array([1.1])
    >>> params['amplitude']
    array([[4.4, 2.2]])
    >>> params['rate']
    array([[55.5, 33.3]])

Fit harmonic function with exponential decay:

.. code-block:: python

    >>> tt = t * (2 * math.pi / (t[-1] + deltat))
    >>> data = 1.1 + numpy.exp(-t / 22.2) * (
    ...     3.3 - 4.4 * numpy.sin(tt) + 5.5 * numpy.cos(tt)
    ... )
    >>> params, fitted = fit_harmonic_decay(data, deltat=0.5)
    >>> numpy.allclose(data, fitted)
    True
    >>> params['offset']
    array([1.1])
    >>> params['rate']
    array([22.2])
    >>> params['amplitude']
    array([[3.3, 4.4, 5.5]])

Fit experimental time-domain image:

.. code-block:: python

    >>> data = numpy.fromfile('test.b&h', dtype='float32').reshape((256, 256, 256))
    >>> data = data[64 : 64 + 64]
    >>> params, fitted = fit_exponentials(data, numexps=1, numcoef=16, axis=0)
    >>> numpy.allclose(data.sum(axis=0), fitted.sum(axis=0))
    True

Owner

  • Name: Christoph Gohlke
  • Login: cgohlke
  • Kind: user
  • Location: Irvine, California

GitHub Events

Total
  • Watch event: 1
  • Push event: 1
  • Create event: 1
Last Year
  • Watch event: 1
  • Push event: 1
  • Create event: 1

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 860 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 14
  • Total maintainers: 1
pypi.org: chebyfit

Fit exponential and harmonic functions using Chebyshev polynomials

  • Versions: 14
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 860 Last month
Rankings
Dependent packages count: 10.1%
Downloads: 14.7%
Average: 20.8%
Dependent repos count: 21.6%
Stargazers count: 27.8%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy >=1.19.2
.github/workflows/wheel.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • pypa/cibuildwheel v2.18.1 composite
pyproject.toml pypi