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.1.28
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.1.28-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44ac057451f1bc367d68ac38db2528659a1806d77a8857a851cddeec6bcbefd1 |
|
MD5 | 0e550aa3bd38c77b9fe409eda0bee3ab |
|
BLAKE2b-256 | 42feab85cbd1ffddf795453841649405f3374d43767b6a577863502b161ef3c1 |
Hashes for chebyfit-2019.1.28-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46583fac51700ff1c55cf7a17f833c2c32787beda96b8645bac79b627b109385 |
|
MD5 | 094c949a3ec46040cf70afe37b684691 |
|
BLAKE2b-256 | f042b19915df53a8bbb0d7805a33d98e440b012563f21a393a4b60ae3fe4d6af |
Hashes for chebyfit-2019.1.28-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbbdedadbbf8cb8f07303c8fe3906e649d3342ba4e5f61225fb01bf4f1fdbf7d |
|
MD5 | 50e1af5e502586c381c0dd7c8b223fc4 |
|
BLAKE2b-256 | a34b272ae317f784c76100fa26cdad5cbbc4dc67642838a9c29264e401e7c477 |
Hashes for chebyfit-2019.1.28-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3ccc8b53d71bde59b02f4b24f8c57275af46bbd93f59356da2b134239194e3f |
|
MD5 | bedf093dbcaf6744953340e278bab341 |
|
BLAKE2b-256 | e7a4a49d3db98e626d5e77cc97b7550f2be1c45f99712ac9b9160af102301677 |
Hashes for chebyfit-2019.1.28-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74f4284c0a8875cea04d266bbace24a95c7354e7261043c65940d29341b1d120 |
|
MD5 | fccc8fb0c2a2668b352c2181c4df36d4 |
|
BLAKE2b-256 | 50f7434da65c9914031bfd0bad6ee51a3538bcd0979132ca36b7d2cc2cb6f429 |
Hashes for chebyfit-2019.1.28-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf4b726e924de07fe29f4f711186cde2ca8f729a2d1ef53ec78520972b42213d |
|
MD5 | aadb8636f02d6cc256b4aa3770e764ba |
|
BLAKE2b-256 | 7b71353d83761269bffe2d828502cb4ca7966f6db28f0844cb1838301607f217 |
Hashes for chebyfit-2019.1.28-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a087fe4e6086ceabdd5ed335b2f197040a6bdc369a0fb24bfe91ed2602cdb6bc |
|
MD5 | 339e5753a963fb9d509a189a0a323b1c |
|
BLAKE2b-256 | b04266fcde7b3e6157dff3f983743b0419f6c5d4f2a07a60d4a73d43a7aa45a7 |
Hashes for chebyfit-2019.1.28-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a375074ddf82fd36beefabb33173250003c219e77e6b71bdaadaccfef0ed16 |
|
MD5 | 3b2fe3dd11bcdccfd23c7b39a3130717 |
|
BLAKE2b-256 | ab49a22e63b66ac46974bb4d43c56880ac25fefd163ce2049a01a96c5c0ce2e0 |
Hashes for chebyfit-2019.1.28-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b78edbe41c2769164b2109267a7a2cbd25ce19f075e719978a629666245125 |
|
MD5 | 9008ae30c53eac2f48bc7cafa4e2ff0d |
|
BLAKE2b-256 | 64ef276b7d79e77054c0d95b8f09a8e01a94e2aa2c0781b4248d43456932167e |
Hashes for chebyfit-2019.1.28-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d295a1a10bf05c775ef33d3d4d8453558bea2fe9e5deb09f4b76eedb91dfb3 |
|
MD5 | e19e68d5fe4768eda0719b45413e033b |
|
BLAKE2b-256 | 73455a0eb0ab6af0b5731e5e119c21f825198992895e6f5e69be860792bcdf7e |