Skip to main content

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:

Christoph Gohlke

License:

BSD 3-Clause

Version:

2024.5.24

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.5.24

  • Fix docstring examples not correctly rendered on GitHub.

2024.4.24

  • Support NumPy 2.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chebyfit-2024.5.24.tar.gz (18.0 kB view details)

Uploaded Source

Built Distributions

chebyfit-2024.5.24-cp313-cp313-win_arm64.whl (23.4 kB view details)

Uploaded CPython 3.13 Windows ARM64

chebyfit-2024.5.24-cp313-cp313-win_amd64.whl (29.1 kB view details)

Uploaded CPython 3.13 Windows x86-64

chebyfit-2024.5.24-cp313-cp313-win32.whl (25.6 kB view details)

Uploaded CPython 3.13 Windows x86

chebyfit-2024.5.24-cp312-cp312-win_arm64.whl (23.5 kB view details)

Uploaded CPython 3.12 Windows ARM64

chebyfit-2024.5.24-cp312-cp312-win_amd64.whl (28.8 kB view details)

Uploaded CPython 3.12 Windows x86-64

chebyfit-2024.5.24-cp312-cp312-win32.whl (25.6 kB view details)

Uploaded CPython 3.12 Windows x86

chebyfit-2024.5.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (71.2 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chebyfit-2024.5.24-cp312-cp312-macosx_11_0_arm64.whl (30.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

chebyfit-2024.5.24-cp312-cp312-macosx_10_9_x86_64.whl (33.5 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

chebyfit-2024.5.24-cp311-cp311-win_arm64.whl (23.4 kB view details)

Uploaded CPython 3.11 Windows ARM64

chebyfit-2024.5.24-cp311-cp311-win_amd64.whl (28.8 kB view details)

Uploaded CPython 3.11 Windows x86-64

chebyfit-2024.5.24-cp311-cp311-win32.whl (25.5 kB view details)

Uploaded CPython 3.11 Windows x86

chebyfit-2024.5.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chebyfit-2024.5.24-cp311-cp311-macosx_11_0_arm64.whl (29.9 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

chebyfit-2024.5.24-cp311-cp311-macosx_10_9_x86_64.whl (33.4 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

chebyfit-2024.5.24-cp310-cp310-win_amd64.whl (28.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

chebyfit-2024.5.24-cp310-cp310-win32.whl (25.5 kB view details)

Uploaded CPython 3.10 Windows x86

chebyfit-2024.5.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (69.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chebyfit-2024.5.24-cp310-cp310-macosx_11_0_arm64.whl (29.9 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

chebyfit-2024.5.24-cp310-cp310-macosx_10_9_x86_64.whl (33.4 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

chebyfit-2024.5.24-cp39-cp39-win_amd64.whl (28.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

chebyfit-2024.5.24-cp39-cp39-win32.whl (25.5 kB view details)

Uploaded CPython 3.9 Windows x86

chebyfit-2024.5.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (69.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

chebyfit-2024.5.24-cp39-cp39-macosx_11_0_arm64.whl (29.9 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

chebyfit-2024.5.24-cp39-cp39-macosx_10_9_x86_64.whl (33.4 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file chebyfit-2024.5.24.tar.gz.

File metadata

  • Download URL: chebyfit-2024.5.24.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.5.24.tar.gz
Algorithm Hash digest
SHA256 3f4dd5b8d3b4e09ca0802a127b41afa2c9774a779061b9c6dbcb5bda51928f20
MD5 384718506771556e46617930a4de16a3
BLAKE2b-256 0886faf82e75277d77bad89a41e937eb2d265f93937e2b2762899b2cfd7a380d

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp313-cp313-win_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 e5990e2afc066234f0d0af92491350cc8bec2d0cd4ae9e24f8f5e8f6c0c3b4e7
MD5 62eaef99aaa85d6b9ef06fd6fb6833cf
BLAKE2b-256 a39a948ce795dc3c7ac93201402cff873a3d4358c94864dd47fb5a6ed87ff243

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 082d7c4e07dd74df6f96d7638a75755e74bd0a5eb177cee60e3775c25a8821db
MD5 0723514c06643afbe600a14fecacc3af
BLAKE2b-256 5c4c313d76a36fa749f34c99e88ac7f34cda75d59cf7bb4c60b8a3f5c9fed135

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp313-cp313-win32.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 ca6ea145bd6c39ec68e02173798f93adc19d2b92bd31cfb52d2733da3b5e2a6d
MD5 9b6fbc41060f079a4050065b6f6f6fe0
BLAKE2b-256 540634cc4b32dc02049e9696682dac203b9b219dae07349133acc2e01b09e0c8

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-win_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 d64b2d1f785a6893596ea524690b7cfac8369ebb2b9ec98172d66f2c0314f5da
MD5 1cb25a4e5e81aabf4154ceff3b0de485
BLAKE2b-256 8edd40161b410747964f6025247fa16b3a5e1d0b21fabf75fe1a8bc82a4c3258

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 70a69b1b53faf57c37eac881e35bf186c01482b799b234d21d8b58439578b501
MD5 20d14705be6ebec0b3711463b8ea2f2a
BLAKE2b-256 31853946d9816b3dab0662dc20697fd57d0f762347d216e22e8602cd0c8754ed

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-win32.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 013d4528d8f251a1bc6e85d787469ec1091585860f2723f43e10f693cf3a69a3
MD5 acc2e367d135e96a6a68eca39e143927
BLAKE2b-256 bb4efa93b2604d3d156692ac6c0ad9cebe2c9cb2603ba4aa805391cc00efcd0c

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a40789fd4cee3b18aa44cc6f6775ca1dff5e17e0c94f0c11b300116254a8e6e
MD5 7e91e6d32974953185f98e9fb1a26f93
BLAKE2b-256 e0734c5add9eba40666c81eada5e41f9c2c127e888213f63859f9033f78e3c6e

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e92d0cbaa1b6ad92a1b0f5e8bc5aa2b3afa285a4b9f65ec884209610f2eaed4
MD5 b42775664307411d93e2d61fb5de48d8
BLAKE2b-256 c5d0773a25f01df8e1f053aba0f0d762c9cae12049302447414eb828b5b18312

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b225fcbe06bd2c22533b203421033f82c224c87fb86f3863995ed6bcb3099938
MD5 296b5c16117108a2970240852c004f7c
BLAKE2b-256 666445bfe89bfd51325b1f31d6d04bbbfab68df3680d2713493bc96f1ecb36a9

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-win_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 226722b3ba120ddf1db32dbe7a296ce0ae75f492286d6fc344420db0be57c47e
MD5 5f85e1a3bb8e86c5c21c056e82b0a6ce
BLAKE2b-256 ffa0798a52e45766048a312be0a57327fdc3936c0b3f032650a38d1b081ea2aa

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 034ddf36d6da53aad98ed067b484ddbaba19ce925e5713c13ccdfba2cfd3a4eb
MD5 60b6f4ec6dc5ad56c3ea3f662085a0c6
BLAKE2b-256 74f77e771594faa88f6d8e78b1b2439bbb13c8ad6916f633d478044d07fc71a6

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-win32.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 66a40535d3543edc167e2aa7f1c4921e7592dbbb89c714e7cc7376fb7fff5570
MD5 dd12b9d366a286aafdc727b5d92834f7
BLAKE2b-256 e5189425ede5e3da9a14c7e3a36ccafb4c31c04023fe279d9710505f8abdbbe6

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e50e323c5f50c4d985e0059194ef9208214ca919234c43c4f0ef023d1b472a5
MD5 91a9aa3deee4f24d075a59940f0cee7c
BLAKE2b-256 02988d5041a376117271714017167499ce304c2cb4496a9a7fce2b78c82f6a37

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 910731675ea473e966aaf6045e739808c548fee55de6467072b3cb761c1a6177
MD5 5fbca454bd912b3bc34e82cd9635b201
BLAKE2b-256 5f6a74059e70ab451000b583d06bcdeebc8a4e3ccb0ef441d070516e16d70a35

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bc9ff499da6c34eb45f80493a31fac81037289a4307a690c709030f8206cfe85
MD5 49b459115a5bd735a95c75278fa7bbaf
BLAKE2b-256 ac4f2b7fbbed616ed56ef33fc8e623ff188a8b1eb01efa1d1ab9b97b3c84648d

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 55275b40c9021664d45b21d626b190ab2bfac5be1a59b7e91c52b6b596e41c50
MD5 46e14353231ae20f7d7a85faa22892e9
BLAKE2b-256 b118dfa9101797494db213b69c87e7893d26f158399e21b4ddf311f5b9ce4b2d

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp310-cp310-win32.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 41294749858479594a4a5d22789da223b40f4e13a4889d2091d46cca756722ce
MD5 19ce368ba97cc91f6dd748f6e7d9b4b4
BLAKE2b-256 ad050168948f55cf7a04bfb2a5cd27cff533e4df4b255216ab178ec1e3f1d424

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 29f1c6ae9f9ad4fdf38ad8af83e3e53925979c10d90620ff5f2331a457d5a911
MD5 c6849735ef87b3679b96202f1c33744a
BLAKE2b-256 e292dc5cccf07af0d3798720c165ccd575af029af97236c0dd79af4a8b2b9f53

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dc1403dd61e4591fb7b5759d1be1c8103acbf934877c31398cdbd62530844611
MD5 f31dec1dd94daee5beaca520bae8d852
BLAKE2b-256 a5a20c76d209003e66c3357afd09ff1aa0f04c689ec91a757956d7dc26a80c9d

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 df1320f558661da18f5dee3e6eaa91abffcaa3d4344a1fc5fa0337a7b81af7b4
MD5 aaaf7e21b75d872667e2c1668006565a
BLAKE2b-256 29fe50ba19160c2a6c40ff71473a16783c7cb463e5fe24102c6fb1cb87d94f16

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 831296cb347f96f626c4a03e3f48fe51577e4b1ae5ebec5bc5e52a8ad837fc55
MD5 bef9fe201ae045599dc006f54f7fa425
BLAKE2b-256 6fcf943fbc90aebd9c16b6846738631a193765e59742faa070b89b5e0fc41d03

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp39-cp39-win32.whl.

File metadata

  • Download URL: chebyfit-2024.5.24-cp39-cp39-win32.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.5.24-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 533bed369c5b25ea4913569ab4fd729682ff470661197feed1a92a5a8726d2bb
MD5 643ef81df789239818f806d594de7287
BLAKE2b-256 1ad3d1c7636dab619f841d4bd1ede9ea18fc942d0ae6fb5cdf0997f7c821a368

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0363cb01330a42ceef02d4cba147f245cb5c70e809b0d9b91f74dcd162a0f377
MD5 0c915254a2d88d9a0be73f72cff50e82
BLAKE2b-256 95553217507c5d87d6b7d7031d9abee14c01a89242457d2346cd91b45abfa0a6

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e005878da1d1a9b08caf5121ecd7cda1faab7e007a7bc00cd8062e4d07202f3
MD5 f40dacc3b30e9d03b56e9928f05412bc
BLAKE2b-256 67347944dce6b7aa843677840454041b99762c86473a0c42a474ddad31ad7daa

See more details on using hashes here.

File details

Details for the file chebyfit-2024.5.24-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2024.5.24-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 58aaff3862bdabc1ddf8321709eed18a240cfc41fab0ba9b0bfdaca3b8b46ce1
MD5 1f4078db0b938160f798021647a15c69
BLAKE2b-256 98a9580b3a14e7b2ab6cb43fc86df60be83a2e6e41b2156f95de8587ee032548

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page