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.10.14
Requirements
Revisions
- 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
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.10.14-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9533be2fde5a818d46fe9b545be926636f0a3733941f3b022eee4c80d95f42a |
|
MD5 | e402a7c7649e329b05463117abaaf420 |
|
BLAKE2b-256 | 3ba8312a4a3ad8377b2664e686bce5441775508ba965bf921066e764068b92e6 |
Hashes for chebyfit-2019.10.14-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923ebf19deaebefd394aee00c57988806b43b9f0c1ef0c605cb303a838b19d3b |
|
MD5 | beda4cb75ede39350eda57a1a1eb295b |
|
BLAKE2b-256 | 1e1dfdeed0470b517390bbc15038a3e154c0ffeba7a389e4f74747a56b38dcae |
Hashes for chebyfit-2019.10.14-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c7ed731b5fa30e8b6881e5b874efff9b10a858481b943c733721cb545a7a149 |
|
MD5 | f8f34f5e4b581e02eedc104dee6a9a16 |
|
BLAKE2b-256 | db5059f3c8c4a4398a14a8f216ce08a3233462327f029e2445b06469b46782f7 |
Hashes for chebyfit-2019.10.14-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 735e4b41ce5bd2a19661dd9f098af67ab7681425f004780791d3be6ec88be971 |
|
MD5 | 110b55158074868a64b4aa761eb8dacd |
|
BLAKE2b-256 | 3a21f683efade1bfd7f307c6a2a20d737eb1c3fd836cce44dddee1002101d52e |
Hashes for chebyfit-2019.10.14-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea5577348d11cfeaee24a1872031fd6cb9de4af114f2ee8b5b306e95de7e30f |
|
MD5 | 2d7a2b8516896d12c85b59d033508021 |
|
BLAKE2b-256 | 91e899ddbb6d6220092a55ac1c46cd64db553a696dacf94b0c241108d049a994 |
Hashes for chebyfit-2019.10.14-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d24add50211eb6d475ccf72fbfd638a2deec9bc412a3cde26aab3298a33c12a |
|
MD5 | cd5ef05165853a89ffc2470f29d580f1 |
|
BLAKE2b-256 | 7dd7ea3cb37283b6aeac6fcebd181a64de67d042d74950fc1c1a2b7c50f500fa |
Hashes for chebyfit-2019.10.14-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17d0556a7de7a7dbce18bf49a689f53b17565ea02186f7e0dbc760d49540382e |
|
MD5 | 9bfc808a4ecd51890574de31de0bfead |
|
BLAKE2b-256 | c9673f8cfb0db69073803abcec68e341d0e438b947de91b6194d279e643dd328 |
Hashes for chebyfit-2019.10.14-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 924563ccdd9c212805f6ca9dd3cef71f83edb2db2108b757965d820b56ec51ac |
|
MD5 | 96c6a4ec327a6f07d2c294f9f69722d5 |
|
BLAKE2b-256 | 76cd50a5089c6ed199357c9ad9c9bb4d69a093efcd376dcaa33e7be57f0304f7 |
Hashes for chebyfit-2019.10.14-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 161ab5c855dc78ea940531ad18f15a48ba6defb1c940ecd811ef3669b792a23b |
|
MD5 | 5b9d4788e1e6791ce015c992a54948f5 |
|
BLAKE2b-256 | 942156e1a4b7c9e099b9398b9fbd31fcb6b87c6263eb285fca7cd27180766474 |
Hashes for chebyfit-2019.10.14-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6305e2da5ec03f369aa23d9c810253b407b70332fc42d2b2d5939c5b5a8b0a |
|
MD5 | ee87da08911aa518f1ab09997fc035ef |
|
BLAKE2b-256 | 87bcffe9dab1712146c1b4a75d9483f74412dce6b38e4c3e1af4dae9ae948c09 |