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:
- License:
BSD 3-Clause
- Version:
2024.1.6
Quickstart
Install the chebyfit package and all dependencies from the Python Package Index:
python -m pip install -U chebyfit
See Examples for using the programming interface.
Source code and support are available on GitHub.
Requirements
This revision was tested with the following requirements and dependencies (other versions may work):
Revisions
2024.1.6
Support Python 3.12.
2023.4.22
Drop support for Python 3.8 and numpy < 1.21 (NEP29).
2022.9.29
Add type hints.
Convert to Google style docstrings.
2022.8.26
Update metadata.
Remove support for Python 3.7 (NEP 29).
2021.6.6
Fix compile error on Python 3.10.
Remove support for Python 3.6 (NEP 29).
2020.1.1
Remove support for Python 2.7 and 3.5.
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
File details
Details for the file chebyfit-2024.1.6.tar.gz
.
File metadata
- Download URL: chebyfit-2024.1.6.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01648f1646ccb4ea8fc06cbd9e3b0216ddc3dfb420fcc32fc1d785dc1ec0d8db |
|
MD5 | b5077e500e010c6aaf20e550e2f97736 |
|
BLAKE2b-256 | da5895ebfb121d2ab9c9cc2c7409926ec27deda7aa8ff6a1ab57f02f46ecacd6 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-win_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-win_arm64.whl
- Upload date:
- Size: 22.6 kB
- Tags: CPython 3.12, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cc38b89816cddda6189ffb4de2eb7bd4f2e1ea239675ed77eb0c6e72e6e5aaa |
|
MD5 | 5078fbfd428c57b1821758c06c4e644d |
|
BLAKE2b-256 | d8b5a40a12edf09e4260bd3c5c189715fef5c17cbc4f2172f9d29556ecddd623 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 28.0 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea3661665bc248164ca251f32890cfdb190f1e00fad2df5190c44243fef760da |
|
MD5 | 5186bdd10240f00b321d421af1d158be |
|
BLAKE2b-256 | 5541dd11e7cb2d2da2879e5c7a4b52e98f53bafda28c5451de6c6fad5aa07fb8 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-win32.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-win32.whl
- Upload date:
- Size: 24.8 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e6b4d293458ad932be65c893ee025b8bbf3b98bdd6f601bc7e7e855fe80cf3e |
|
MD5 | dee6c623dd635bec726885e095a8533a |
|
BLAKE2b-256 | d1d687c2cbd35bf41f6f7d41d7ba28c3e3092ad3742476c698ea56f6e34d2eb2 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 69.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406678862ec85043f9f31200b9348f6ced68c451d0cfe3adc095b4400021e916 |
|
MD5 | 67a7be9a38bdbba91d1c5eb7f9846fda |
|
BLAKE2b-256 | 359c3419f2effa3d52198fb9f4c96fe40c6e78d7fa020d46bf2bb408520fbde5 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.9 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aad708f91c0d57cc488f45940c80163a1ed8ba19e043a5562e48f7b929d9d886 |
|
MD5 | 09ec88b9512be1a17f9a1568a11fcadc |
|
BLAKE2b-256 | 58b81340e1a820e7db8c26b714186f1c34a7ed55a157a12a63ef2e2cd28748d6 |
File details
Details for the file chebyfit-2024.1.6-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.4 kB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee218e139f725f5e87a4b18c7b5dcbdc89b2fc4c1cde2ea5e4156812e93b55c0 |
|
MD5 | 6345990d40f4aeb4959a907e5441389c |
|
BLAKE2b-256 | ca2d274c38a5cb2df3ffac09637717ab2786af309e021d2ad0e3ec1b1a391807 |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-win_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-win_arm64.whl
- Upload date:
- Size: 22.6 kB
- Tags: CPython 3.11, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55facd0483f7aae90a5faa9941c199c9a0c76794e95e21c37f4643e979c1af50 |
|
MD5 | 7abf9a3b175c439752f6d5c46498fa3c |
|
BLAKE2b-256 | c19c287fa08dfcfc975f758dd78ba60acb08585c0bfdad7b45b5fa41f15983c1 |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 28.0 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1480bca1fb1abb28a25210aa91b564209b2a13a7c92f30c6b2b5ae673ed3ee7c |
|
MD5 | ec91269a0dc8c26e69a4750d21c01edf |
|
BLAKE2b-256 | 2d03af08022e800423ad9b6361f31bc8cdcd9da2af68de7b2a8b5b3ba167537b |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-win32.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-win32.whl
- Upload date:
- Size: 24.6 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 381098b29e64066a503f416db613110ff1b2c02217c4408c236c41e73ed17408 |
|
MD5 | d6ce02eb7b236a3db49811612eb5f068 |
|
BLAKE2b-256 | 5ed75f314e87c6e4016d23a14120fa5dd89e1a243d0d8fbef9b0b50aa2ddcba3 |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 68.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 379d0558bbbbc2a9a25ce2b45d79dcffadac95c6d5196655e966aac22f25f336 |
|
MD5 | d979fe62374cfd8a89a35fb907bc5a7e |
|
BLAKE2b-256 | b8d7d9774c3e4f650fd56c0287dffbf49f2da7ed794627a1f9cfa9a94e9c4cea |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.8 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 211d218f48e0efa84572db0c62895083d9a5b20ce5fbecebd3e8eb92a1f2f88d |
|
MD5 | 0492f16bd04ab9a2baae7c72c60b48af |
|
BLAKE2b-256 | faf6814600a3d743c983254d535e405641e63d5a2b4583fabbe785128e298381 |
File details
Details for the file chebyfit-2024.1.6-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.3 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d28ee9cc02363ae6a012c74ca3f6477bbdc9a57349d63a8a1452323d5753790 |
|
MD5 | 0f394cd32d751da7d5d8d86665c9e236 |
|
BLAKE2b-256 | 20687c5c0143848d77d4f777ac2a212d1a50d0730bdc1b6c7ebd61bc24bc6cb1 |
File details
Details for the file chebyfit-2024.1.6-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 28.0 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69d5b8da3f21255c549ce692cf3cfeed2f73779c0f4eaffcd65488986e73adb3 |
|
MD5 | 7f719d62630322a475f4a48aadbc4b54 |
|
BLAKE2b-256 | 51b92b01256c96196d141ae59af7c83805a2c340465e6c434b54789f8283f9f7 |
File details
Details for the file chebyfit-2024.1.6-cp310-cp310-win32.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp310-cp310-win32.whl
- Upload date:
- Size: 24.6 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9083457fbca9e05e97b9b62d0133674fdfd19459e45762691ca482186eeece1 |
|
MD5 | c816263e18ade04f192b01110d3529ce |
|
BLAKE2b-256 | 1b52641741e083ad0907501c92632ee492d7d9f68350f82633723d12a77246e6 |
File details
Details for the file chebyfit-2024.1.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 67.7 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d37591595846f6acfaf5ec6a150277c526b534301c87b78c7b396af5ece074b |
|
MD5 | 13f0ec576755ac6ab68cd4100669a207 |
|
BLAKE2b-256 | 9e19b841e74989b7faf65d4320dd7bd6909c61723a11250acfd9e6b582f38471 |
File details
Details for the file chebyfit-2024.1.6-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.8 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bd9e36d471e88f772c29706055537ccec18ed2ef0c79d1b17c7698ed4099b99 |
|
MD5 | 83598853c8d62d10e8154dc8ba3424db |
|
BLAKE2b-256 | 4731761066e275a72fb73722170b00b5b3f784e8b8753961bdfb13ef365fd304 |
File details
Details for the file chebyfit-2024.1.6-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.3 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b78a6f9fdd0333e25d444e4c7af61c916eff5d66423c275f3a299e77395247d |
|
MD5 | a3bde03969a5a805d7666a0860cd2ff2 |
|
BLAKE2b-256 | c34ea4289967f4a583b80d3fe0c447e31eb12065757da9544fc45512f959cdde |
File details
Details for the file chebyfit-2024.1.6-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 28.0 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00c561f2c78ff762ae30b3176e2e1a1d5960fd1bb5c3b1522ed73c5a1cabbdb6 |
|
MD5 | 6bc84e3f948b5134b596d4aca84e4629 |
|
BLAKE2b-256 | 9ee58e22a6a96f88e04f7b17000129fefe72871b2944abbd44874ac1c5d6aac3 |
File details
Details for the file chebyfit-2024.1.6-cp39-cp39-win32.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp39-cp39-win32.whl
- Upload date:
- Size: 24.6 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96beb5828ca5a042cd03a5c19f0d938f571424903e3a90ea366fa215379037d |
|
MD5 | 481bf954d6f580db9ec7d0b855a6f81c |
|
BLAKE2b-256 | e5ac9be69252a76e977eea0a5f8ac84b1982e302ab0b4397037d7e1ead10c320 |
File details
Details for the file chebyfit-2024.1.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 67.5 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f523d99d56aa0d1f5ef023bc49d11c60079d2e21d8f81cfb576000f17e30d4 |
|
MD5 | 7d2450923f1c9dc5f2338b40aae69cb0 |
|
BLAKE2b-256 | 4998759a4d1af72f8b2e91e0a55f7205eba11abaa7978eca123af63bac8e5225 |
File details
Details for the file chebyfit-2024.1.6-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.8 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e707039c0c882c96fb786f05ae4e0cb21c3b3018d6f184581c8aef49169bd2b |
|
MD5 | d77de2e27ad9265fa0f9e235e4ffc090 |
|
BLAKE2b-256 | 68c5d125eaac0f5759d181adc30d8a56906eb8d37f30ecfe6bd0cfc0f9e2a35c |
File details
Details for the file chebyfit-2024.1.6-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: chebyfit-2024.1.6-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 32.3 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 857abc22ab5c156b29772a71992dc77051354220262265da15fa4358a83b454f |
|
MD5 | 1f54feeb6321cf3d87408faa0056d6fc |
|
BLAKE2b-256 | a0c70040ac9284cde7f3b3fa26e182f7d0ff6aeb01ceb0f5ced09e149324a83c |