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:

2020.1.1

Requirements

Revisions

2020.1.1

Remove support for Python 2.7 and 3.5. Update copyright.

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-2020.1.1.tar.gz (15.6 kB view details)

Uploaded Source

Built Distributions

chebyfit-2020.1.1-pp37-pypy37_pp73-win_amd64.whl (27.4 kB view details)

Uploaded PyPy Windows x86-64

chebyfit-2020.1.1-cp38-cp38-win_amd64.whl (27.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

chebyfit-2020.1.1-cp38-cp38-win32.whl (29.2 kB view details)

Uploaded CPython 3.8 Windows x86

chebyfit-2020.1.1-cp37-cp37m-win_amd64.whl (27.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

chebyfit-2020.1.1-cp37-cp37m-win32.whl (29.2 kB view details)

Uploaded CPython 3.7m Windows x86

chebyfit-2020.1.1-cp36-cp36m-win_amd64.whl (27.2 kB view details)

Uploaded CPython 3.6m Windows x86-64

chebyfit-2020.1.1-cp36-cp36m-win32.whl (28.8 kB view details)

Uploaded CPython 3.6m Windows x86

File details

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

File metadata

  • Download URL: chebyfit-2020.1.1.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1.tar.gz
Algorithm Hash digest
SHA256 5d4296e1d2a0abe57bbd63b19b9f73baa273c119964dfb0fb193fa753897d16b
MD5 6486c9a59455e17607ec5073c0db3f5c
BLAKE2b-256 387cb59649e1c72677e9648d1cf69a866818ebe8194a64af1a02434aa9d5611f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for chebyfit-2020.1.1-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 9dd95e645f9740ad2ff781de4aab92da29ee2d762325b01a06487f6480458a38
MD5 ba5b5ce49e8ef9ef172da504dde168c8
BLAKE2b-256 9da9894830fcb0d76bf465c27d8bdfa2a5215c56b11253c8fe59e4d47167f578

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2020.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d9ce5cd0f5ab1d9bfeb53fbcbe2a3fc1cab606b2cdb3133e95f559700ded219e
MD5 31cf87a0021880e8dcb16058375912f5
BLAKE2b-256 eb98e23c1a42c4d6614f12218bc56513d76cc4ac2ebca102c1989c1cc210bf9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2020.1.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 fedaccb8170a39a179b7df34b043b45cdb4b3ed5e59c39045b224da87d8f5daa
MD5 4137c9b8c9813ec00cc62a52fbd354c9
BLAKE2b-256 fc76b023bd9a59f69b63f07664a32689409af88a76792d62ad417aadb969cd96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2020.1.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 66aacb78154d1737768a14623345465f0e714266812df13643144d6932d2edcd
MD5 0cdbb4dd21fd8b5016abfb8d79481611
BLAKE2b-256 0b1d7400a165990a537047414a98e6965945d326c4d2d2278a8d9777f5b5e5a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2020.1.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 4ef880d8427837c80713b78e0ab64cc72bc55978c5978b4aa89ca4afa35f908b
MD5 bfd8c68bbbca3b118f1abb647496cfb1
BLAKE2b-256 0fa325ca60b1ae5015d41daa50ddaf1f174fe50e8d732d42254976681024afd4

See more details on using hashes here.

File details

Details for the file chebyfit-2020.1.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: chebyfit-2020.1.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d1bf599a8a324f2ca19d1e5d8144d04ed72f3f539e228bb2379bd4d8019c0d07
MD5 a678c775243719b3610fe7f6d11ed69f
BLAKE2b-256 02c8fd0eae57d1d6f6b6060f47404b003b40afd2d6b00f04bab29b7113d2b51e

See more details on using hashes here.

File details

Details for the file chebyfit-2020.1.1-cp36-cp36m-win32.whl.

File metadata

  • Download URL: chebyfit-2020.1.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for chebyfit-2020.1.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 4d796c24b7669e7f2380c72c2cd5b82c692810da86214c9a4c68d1d2d67422eb
MD5 ec3859f10af3d382363fa5c9f86907b0
BLAKE2b-256 5de9f909c9811a23a1135a8da4975d0495b4279265682d97a4ad6b8fd7744f3f

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