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.2.20
Requirements
Revisions
- 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.2.20-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba09f5ffcffa6cd60806cb897fa11382542e5dd90442ddf9800c7c41d246dbda |
|
MD5 | f4c0bcb4ac710c9c53fd598a71c87a0e |
|
BLAKE2b-256 | 642e02e2cf9cd7877eacce7632a266cd56b42ab6176f9cc848a1c6b90b2d2138 |
Hashes for chebyfit-2019.2.20-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bfc6a5caa0af711725122d89880c840d694e51a3e83714f30fd2996027b0b7c |
|
MD5 | 128a98bfe38d267f298b6be9358407d2 |
|
BLAKE2b-256 | 72406f58f9255ab8d4d6dfc49f037ef64f084484b96c68102fcd399381c28ccd |
Hashes for chebyfit-2019.2.20-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b9765599338b09613eb970c78afe4185fa238387394a76c0f1b1de19eb5b9b5 |
|
MD5 | fcbe888bbb9f7d0f69ad707933604556 |
|
BLAKE2b-256 | ed24e10aefa8fe6847f7b88e0b950cdac8d79095fe43c06beb4546a358d70932 |
Hashes for chebyfit-2019.2.20-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9835e14d9f282da9c7e7db602aee137adc3ef0e4014c55483f61bff9c696408 |
|
MD5 | ab789398d633876633a7df84d333fcc5 |
|
BLAKE2b-256 | a5687275e7195a5d17e1bf4ebec8c75fe98fe5ef9d3030bc6870af95fd256079 |
Hashes for chebyfit-2019.2.20-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9f945bd31e439055de2ab926f98dbdf788b799391efb76b02420fa91b3cec44 |
|
MD5 | 7698e19d243a757203ccc4ed67916264 |
|
BLAKE2b-256 | 6478ff0113eb9fa6ca80bf2c8b4724588f313038ea055f50aa86ef40e901959c |
Hashes for chebyfit-2019.2.20-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70b52701ccc605d6f047eeef247059b75079cb28ef00cdba797678ff0922a211 |
|
MD5 | 5966a0b26998523546b3917b57161076 |
|
BLAKE2b-256 | 3e4af9fbf6492b8dc7ec43e35a4dbf606aadef657b2e2854ee44564bd9639500 |
Hashes for chebyfit-2019.2.20-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cb938219396680ff8f8a4b31397b978be617bdf8d0388f20cf139ecf72c1186 |
|
MD5 | 2afa7e4c701e050a2f9e7410913e01fc |
|
BLAKE2b-256 | b7ac7e1e649846d85ec64c3a3aaa37cd0c66f9a7f9bbaaaf7af92c8524f3f1f3 |
Hashes for chebyfit-2019.2.20-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d44812c71a9f227ded196decd7abe67ef3e1dbed58f941c7e195e1b2a03dd8 |
|
MD5 | a4796938dd075f79bba44cc877fdd8e1 |
|
BLAKE2b-256 | 1e61aca6eab6e1294aff0463af713c0f7cbd069a8da87aec20c0456d4f5a10e1 |