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
- Authors:
- Organization:
Laboratory for Fluorescence Dynamics. University of California, Irvine
- License:
3-clause BSD
- Version:
2019.4.22
Requirements
Revisions
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for chebyfit-2019.4.22-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0479bfe0ebe9e2d71380fb29f732f28870726e111337c09cc799ba16eea3130 |
|
MD5 | ec314500c57ba55174836468db2613c5 |
|
BLAKE2b-256 | 233258ac2dec2c828855dc1a1f4a4268478b12b3f9fbbe33dbd241ac5ae281cc |
Hashes for chebyfit-2019.4.22-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f6bd87f7a97d8afcea37789003fe4f3c5fb9484b73d819ae34a213ccff31451 |
|
MD5 | 0ef8f1cbe265697cf7cdd60f8f95a80e |
|
BLAKE2b-256 | 92585bdd5a5ddc29d6223d5d5bfa6ce22a39821da10efcf7822ef4de30069e0b |
Hashes for chebyfit-2019.4.22-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da4fa6e614fd56857b6408743f02ee3e8e9d1eeede3b8f039ef6d33d727a1c4 |
|
MD5 | e2699eeba121dc1d6d52b8ddff9dd781 |
|
BLAKE2b-256 | ad77f283b161fa218d84d42c4eba323aeb9ec6007e42b9d3d31b545238bb0605 |
Hashes for chebyfit-2019.4.22-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0aa663ae334eb18ce03c5cc292a3aaa703f19331b476832d8f64fd8aaa19e0e7 |
|
MD5 | f42674b80e2527d8d5607b03f2c320d5 |
|
BLAKE2b-256 | 241682920e0158c5603c2fc22cdf6690e217f6f48def797eb03c3dfcdc2f4b43 |
Hashes for chebyfit-2019.4.22-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ec04125cc6011f4ade4a4115cd3b6114ffa1b534e58e93c3c55eef76f9dfd40 |
|
MD5 | d1f47246f25ff93d99666ac84a4130df |
|
BLAKE2b-256 | ab9c58805736151431be708772e0c03140eb4b0f066101667fddc8b82188f023 |
Hashes for chebyfit-2019.4.22-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5bc0410efd25e2f13767da4e3e34c955df2ea686f81eea3de9f2ae00b7f5464 |
|
MD5 | 22d59cd421a4a3bd67662467f0eaf806 |
|
BLAKE2b-256 | da205ab18a9bef2bed248a448b508948a5c91f1fcaf10fdd549ab011a1962057 |
Hashes for chebyfit-2019.4.22-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3630ca57a14825b935264586757a63633787c309282a36f068cc2bd36efd53ea |
|
MD5 | eef64465bba66e7e02c178cb85c5ae51 |
|
BLAKE2b-256 | 97fb1f0a3bd87e417dec01a69f3c383e50f247a63d11b7dc6c265081dd032ec4 |
Hashes for chebyfit-2019.4.22-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02d89e0d0a3e6cb3b1b05743f3dfff198799d2929dd929287fcec3e9b3eb1b1e |
|
MD5 | 7339ff3191e1524baca4e7acddd74d4c |
|
BLAKE2b-256 | a7a28cfdae903b6334536138b434d3fd288fac3410f9ead7d2a5db9f6dc1b480 |