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.4.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.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.4.24.tar.gz (17.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

chebyfit-2024.4.24-cp312-cp312-win_arm64.whl (23.2 kB view details)

Uploaded CPython 3.12Windows ARM64

chebyfit-2024.4.24-cp312-cp312-win_amd64.whl (28.6 kB view details)

Uploaded CPython 3.12Windows x86-64

chebyfit-2024.4.24-cp312-cp312-win32.whl (25.3 kB view details)

Uploaded CPython 3.12Windows x86

chebyfit-2024.4.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.1 kB view details)

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

chebyfit-2024.4.24-cp312-cp312-macosx_11_0_arm64.whl (29.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

chebyfit-2024.4.24-cp312-cp312-macosx_10_9_x86_64.whl (33.2 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

chebyfit-2024.4.24-cp311-cp311-win_arm64.whl (23.2 kB view details)

Uploaded CPython 3.11Windows ARM64

chebyfit-2024.4.24-cp311-cp311-win_amd64.whl (28.6 kB view details)

Uploaded CPython 3.11Windows x86-64

chebyfit-2024.4.24-cp311-cp311-win32.whl (25.2 kB view details)

Uploaded CPython 3.11Windows x86

chebyfit-2024.4.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (69.1 kB view details)

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

chebyfit-2024.4.24-cp311-cp311-macosx_11_0_arm64.whl (29.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

chebyfit-2024.4.24-cp311-cp311-macosx_10_9_x86_64.whl (33.1 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

chebyfit-2024.4.24-cp310-cp310-win_amd64.whl (28.6 kB view details)

Uploaded CPython 3.10Windows x86-64

chebyfit-2024.4.24-cp310-cp310-win32.whl (25.2 kB view details)

Uploaded CPython 3.10Windows x86

chebyfit-2024.4.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (68.3 kB view details)

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

chebyfit-2024.4.24-cp310-cp310-macosx_11_0_arm64.whl (29.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

chebyfit-2024.4.24-cp310-cp310-macosx_10_9_x86_64.whl (33.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

chebyfit-2024.4.24-cp39-cp39-win_amd64.whl (28.6 kB view details)

Uploaded CPython 3.9Windows x86-64

chebyfit-2024.4.24-cp39-cp39-win32.whl (25.2 kB view details)

Uploaded CPython 3.9Windows x86

chebyfit-2024.4.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (68.0 kB view details)

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

chebyfit-2024.4.24-cp39-cp39-macosx_11_0_arm64.whl (29.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

chebyfit-2024.4.24-cp39-cp39-macosx_10_9_x86_64.whl (33.1 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

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

File metadata

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

File hashes

Hashes for chebyfit-2024.4.24.tar.gz
Algorithm Hash digest
SHA256 0383be914551f840ae538df5e84e198390172144317409ea96bd0c87c3f23a80
MD5 12a512fd8bfd3039560dc5d1fa0db92f
BLAKE2b-256 6a81b9fb1f05d99b6767fdc5e87c294d85d534be01dd3343952fd570a2650cb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 4c88a4a77d77d3ab353d751ab030e820bfabd28a60ff5092318a7d73afd18120
MD5 d240f75ed9a264989822fa06718bd04a
BLAKE2b-256 021e9f0ccc1d47f1edbaebc3c7901fad5009db3535aebbc3d93088abc22d3dce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5a0c6212f87b63b643ed9ed2537bd8e9cee7f4974703bb6ea1c253f31168bcf0
MD5 d237688bb3416384580b994a16a70554
BLAKE2b-256 a70377bbdd7ab2a3473494743809d8a7941a125d88ab7f8dda0d85899ae3aed0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2024.4.24-cp312-cp312-win32.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.4.24-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 fe59b1659ba030fe8a44be4a8abdd9b7fd05becc3e1d668de6f6dc9f1cd5f479
MD5 ea8a1f5946e313f5f427ae73fc1dface
BLAKE2b-256 4c8bda539ebd61fe724a624d4961d0af79fe2596057c09ec71805f725976d5fd

See more details on using hashes here.

File details

Details for the file chebyfit-2024.4.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.4.24-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dcc243195a3e10ba9530ef5e25bc66c6685214cee2e9b78e12e50c3897a89a56
MD5 af98883a14574563cfc28e39fc8af945
BLAKE2b-256 a524d65d4d2ebfc63e8e94964b14426f0c546ed307bef1da101fe24466e590dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecd5bd7e54cf14d6ab7a8aa82a55d63d9700da3c2136a9e6b5ec4b5bb5aa2a2d
MD5 d734093e7a789bd5d9def5a10ffb0a9e
BLAKE2b-256 6569da98bce6b6c899e67990f80563e1d7806efd92b03c62fb186e05b4e78e86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6b8b997c226bbfa10997902f1ad941307a778a30467710cb5e1bf462f3c9e31e
MD5 bdac3920eba992c4ba53d50f5f2afdbf
BLAKE2b-256 8085c9e24e4f0eef972f270ded360a668f5d3dc2692f572b4875c37950b6e68b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 b51f339f14a78e316f89d8b453e2b233d5e45464f7e840896a3d8d07ddd0cbfe
MD5 c92c0e1a8b6d1aae42ae2d6f69305603
BLAKE2b-256 3286d0a1aef1eeb51b2085c0474ab5d0b4f1fa576a9bb91bdcb6cb2a5dde7308

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0727f4f2da17e53fec2f4473b101ec1b13e1dd879e76f9a9bb50850e84d6b1c8
MD5 ca7f93c4e033fcb7ac940c5052b4883d
BLAKE2b-256 c6f5c5a2e6a90788968b4400d0064c9d1708f117d427587f02e2c9df050f9759

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2024.4.24-cp311-cp311-win32.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.4.24-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 f4e20ecea3b8fec73398fd240f2bc25863c331e04494aed69fb333fc3d94e6ce
MD5 5d1f0d96d063572b03f42e864e7f4cd8
BLAKE2b-256 09ffdfe43197d92c2a76ec270c9d6388e803c6c560d2c55a8768f945db7606aa

See more details on using hashes here.

File details

Details for the file chebyfit-2024.4.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.4.24-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c97a3cd9570e267ebdb741f4d68905e2f5b6e164140aea867f8b9e2a341db63
MD5 80af265d623d0b6fc547c05f6c6b8f78
BLAKE2b-256 a9ec091e2eb73fa778aa63089d39e87155a506325d1450fe07bd81ec70cdb255

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd0650255218589d9d8c08c8edda6e42b502ce82cbbcea4d3c55a7e0e77df7cc
MD5 f063fc54bde1f8e0acb22eec77565224
BLAKE2b-256 836211b0e30315b3e7bb50c47396b250a66cdc85786a93153c219265b529b96a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 eb011bbe762ec8b14a0a0ce99c8894bc0de9e1ed40b256defab2ebdb7b7a86c0
MD5 a66f902ad7d77de0869c0d767112fd3c
BLAKE2b-256 a41de470fb9e99047cdd3392a5fd17ea7811c79bead6df85bd6e67dcf0af3769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 dafac3fdf1d8c20a3a1661b0b95d6e64b79060f9e3ace355859997b135efe2a7
MD5 4be72f885f0364cb8b298838f38f97a2
BLAKE2b-256 4919100b3fcd5a335d07c1093926062bd3ae3c73b6d8e1de2f395ac12bee1061

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2024.4.24-cp310-cp310-win32.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.4.24-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 18bb6c9898369aa08225555912ab3a48eccaa1a543342479e88979311cac1568
MD5 7b0339de829fd92097dd8334978fae86
BLAKE2b-256 610791a57ca02584865c9e64b1025169b48d204e53a2ca70b72227df5f420771

See more details on using hashes here.

File details

Details for the file chebyfit-2024.4.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.4.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30bebc9d948fac2c40443b7471491b22cb9dd3d9f8d2b9d2264c3b958111605d
MD5 081c2c3335d6166ea3360bbacec33a26
BLAKE2b-256 ec16da3e9104ba7572d80244cf19e9098db217bfb2f8f349ca70d0fcc94524aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c28f8401e0291fb044d655b8154911fcaccc00a690f696f48fafe98aeffde561
MD5 3122fbdd1e1d1dd3707af8b89ad35ab8
BLAKE2b-256 42a497af02f4814d3f8c67886e4a314f84743ebb7f66bef0da82edd337b2ab1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 019918411f5bb1546ec7eae7f359dc81a314043d9cf22f1fc96d5c3ece608bb7
MD5 38e77692f9248ca0e3358a83b1651829
BLAKE2b-256 66a1af7f1c0391dadc2f86857dbefe24002e6fa79f25a572b3bf317644c3beda

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2024.4.24-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chebyfit-2024.4.24-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cecf456b0956ed4ecd295cc31a8f14051fa8ea54fc7b34ceb416a55f0644de91
MD5 21f4f7cd8a673c1ba69e95bfcea2b134
BLAKE2b-256 a36dfcbd3a8c56a389c425d11475530f3b04929993122e85601fec921872d5ff

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for chebyfit-2024.4.24-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 3f3083f6b78c8a93eefe1407681cd758a312326be8d1a90d98368daa5f090f7f
MD5 efc756c05d842a3430af3f4f88f907dd
BLAKE2b-256 7f30fa4c663ce4d6007b34f2285cd6c71afedab14a23fc1bfd50a9fc4fa1bec7

See more details on using hashes here.

File details

Details for the file chebyfit-2024.4.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.4.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7cc6230c6994a618fce17afd1d1896612f744c5c3b7629985be05407110aee59
MD5 86e64899d9f67dae0af6a3cc92dd3e25
BLAKE2b-256 a082c7e2fbd9217670a594d4ede66a07885d58dae438817d9da4a72d834aa66d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0ecbc134a143eb4012338137233e65676630b18c64fb354f45deb7da4a01973
MD5 a3b15417de5deb12cd00906e4344db69
BLAKE2b-256 1c0b1c2cd09435b9335aca9f06737525ff8798aa49ccc4269d8ab5599b8ca4f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2024.4.24-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 78e91f2912915d45cc1b322fc16d73c8e6e3972a291b9ff0661c8cdaeba202ba
MD5 372a60d1bcefeee33e1874593de7a1fb
BLAKE2b-256 6eb949c6ea7b77cb2ae7459bc3b70f3e1bdf510c2413b9f19427906675df4c13

See more details on using hashes here.

Supported by

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