Skip to main content

Fit exponential and harmonic functions using Chebyshev polynomials

Project description

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

Organization:

Laboratory for Fluorescence Dynamics. University of California, Irvine

License:

BSD 3-Clause

Version:

2021.6.6

Requirements

Revisions

2021.6.6

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

2020.1.1

Remove 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:

>>> 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:

>>> 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:

>>> 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

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

chebyfit-2021.6.6.tar.gz (15.7 kB view details)

Uploaded Source

Built Distributions

chebyfit-2021.6.6-pp38-pypy38_pp73-win_amd64.whl (27.5 kB view details)

Uploaded PyPy Windows x86-64

chebyfit-2021.6.6-pp37-pypy37_pp73-win_amd64.whl (28.0 kB view details)

Uploaded PyPy Windows x86-64

chebyfit-2021.6.6-cp310-cp310-win_amd64.whl (28.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

chebyfit-2021.6.6-cp310-cp310-win32.whl (24.3 kB view details)

Uploaded CPython 3.10 Windows x86

chebyfit-2021.6.6-cp39-cp39-win_amd64.whl (27.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

chebyfit-2021.6.6-cp39-cp39-win32.whl (24.3 kB view details)

Uploaded CPython 3.9 Windows x86

chebyfit-2021.6.6-cp38-cp38-win_amd64.whl (27.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

chebyfit-2021.6.6-cp38-cp38-win32.whl (24.3 kB view details)

Uploaded CPython 3.8 Windows x86

chebyfit-2021.6.6-cp37-cp37m-win_amd64.whl (27.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

chebyfit-2021.6.6-cp37-cp37m-win32.whl (24.2 kB view details)

Uploaded CPython 3.7m Windows x86

File details

Details for the file chebyfit-2021.6.6.tar.gz.

File metadata

  • Download URL: chebyfit-2021.6.6.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6.tar.gz
Algorithm Hash digest
SHA256 ebaa968f84a5343b98af1fe2687f51a3e8deae71b2ef4774a6638009696ad3a4
MD5 a27aacb5e8b4636c78f864cf23e61e7a
BLAKE2b-256 89d0cb353cee80b03cd8ae9790bcc1df989773b05b425b126acb42d1d5cf171f

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-pp38-pypy38_pp73-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-pp38-pypy38_pp73-win_amd64.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for chebyfit-2021.6.6-pp38-pypy38_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 28e2bc56f1f07aee6a4c77caf01d15ab9929ac9978189385c3132bdcecf997a8
MD5 7a70d8994d9a8cd495a4f39ac49d3a2a
BLAKE2b-256 b4037925c4c7b4435f7edfe8e92bf2519fe391bd916bfa69542a271e7eadd2af

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-pp37-pypy37_pp73-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-pp37-pypy37_pp73-win_amd64.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 f88846ce998f4a8ead4efd260d53b9b7b071681d9c9c0a5c2212361f7c2e38e6
MD5 406e7b4ff4890f41939a1c33c3b3ba59
BLAKE2b-256 4353c73b1dd7d528abe071b7eaec701b9354772ca44149eccd6040d2b60ce4e4

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for chebyfit-2021.6.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2d76b94caa29547f9f53a124531edb5838fb9b7aa4266a7a4bb252c4c9df5e7a
MD5 27eceb5bee6cacd0022e750ff4f20677
BLAKE2b-256 4c58dd01b4f819d8044d342c7b4aba22725e924edc3497ede6ef2ac3bc1c4706

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp310-cp310-win32.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp310-cp310-win32.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for chebyfit-2021.6.6-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 56b81e88b9173db7f599cfabc7ab72ed19e27410f8bc1bfc9e33de761d057bf1
MD5 1e37b1e1376a96b0dd284756688a4bc2
BLAKE2b-256 b0c20e17224709744d5e3f790d824212696ea5e3cd43b024ecac7a5963fa3edc

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e1fd97040b99a909050adc944d166a7bcabf36aff0b0d65eb0a2e69b694facc3
MD5 79069269eab06cfdad81fd82b0838650
BLAKE2b-256 67af9c3c902c47119f3d72fc104366c89d8942131f30ed55044f3e984e220b11

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp39-cp39-win32.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp39-cp39-win32.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 3b5ada410fd0baeb09d852a59ec98d5d9a83c39ba77ee0bd6a7aba3c2ee761b9
MD5 3ce840caa04c491487685565651912e8
BLAKE2b-256 39ea51e28101257f32b5699cfe84fdf3a5b6a580bff41f67c37d008c53d009ed

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b9d76ae61367a17e7de46fd89a1d11ec875aeb2109ec9854aa87dcc451ffda15
MD5 a81c48df61cd40731bd25d0e2813113d
BLAKE2b-256 60b172946b782dabfc614aa7c329397f6f48f6669323d9566557c677551e97bb

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp38-cp38-win32.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp38-cp38-win32.whl
  • Upload date:
  • Size: 24.3 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 43f872befed7791fed7d8df0b9855349594d4b4ec7716ff53b8a16eb84189ad1
MD5 b60193ef33387d45ad6c1f710f3fe748
BLAKE2b-256 17584553f7da4f3af5e65f76bf434c619a7b60cf318f1fb92c6004026da848f9

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f342fce1c711bc12bba79a8db45717367a9e9be0aaf7d98ec28c9cc9a5b2c022
MD5 dd77ebab0f2b575f21b8c33c27031681
BLAKE2b-256 b2ef287161fdc2a5334f24e31be55430c3879c07806cfb8ebcc1c8828050a9da

See more details on using hashes here.

File details

Details for the file chebyfit-2021.6.6-cp37-cp37m-win32.whl.

File metadata

  • Download URL: chebyfit-2021.6.6-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for chebyfit-2021.6.6-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 b0b52cb0bf996a96b64bc4a53835773093b5d57776fcf3137ddf4eb4a17d7182
MD5 59e7f87d728aff29eff899992cdfd5ce
BLAKE2b-256 7c24af9a5d4c0a9fe0ec80ca5ecca42616a693a4a969178e89171b7bf25f857c

See more details on using hashes here.

Supported by

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