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:

2025.1.1

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):

  • CPython 3.10.11, 3.11.9, 3.12.8, 3.13.1 64-bit

  • NumPy 2.1.3

Revisions

2025.1.1

  • Improve type hints.

  • Drop support for Python 3.9, support Python 3.13.

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.

  • Drop support for Python 3.7 (NEP 29).

2021.6.6

  • Fix compile error on Python 3.10.

  • Drop support for Python 3.6 (NEP 29).

2020.1.1

  • Drop 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-2025.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distributions

chebyfit-2025.1.1-cp313-cp313-win_arm64.whl (23.5 kB view details)

Uploaded CPython 3.13Windows ARM64

chebyfit-2025.1.1-cp313-cp313-win_amd64.whl (28.9 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13Windows x86

chebyfit-2025.1.1-cp313-cp313-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.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

chebyfit-2025.1.1-cp313-cp313-macosx_11_0_arm64.whl (26.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

chebyfit-2025.1.1-cp313-cp313-macosx_10_13_x86_64.whl (30.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

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

Uploaded CPython 3.12Windows ARM64

chebyfit-2025.1.1-cp312-cp312-win_amd64.whl (28.9 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

chebyfit-2025.1.1-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.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

chebyfit-2025.1.1-cp312-cp312-macosx_11_0_arm64.whl (26.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

chebyfit-2025.1.1-cp312-cp312-macosx_10_13_x86_64.whl (30.9 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

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

Uploaded CPython 3.11Windows ARM64

chebyfit-2025.1.1-cp311-cp311-win_amd64.whl (28.9 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11Windows x86

chebyfit-2025.1.1-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.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

chebyfit-2025.1.1-cp311-cp311-macosx_11_0_arm64.whl (26.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

chebyfit-2025.1.1-cp311-cp311-macosx_10_9_x86_64.whl (32.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

chebyfit-2025.1.1-cp310-cp310-win_amd64.whl (28.9 kB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10Windows x86

chebyfit-2025.1.1-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.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

chebyfit-2025.1.1-cp310-cp310-macosx_11_0_arm64.whl (26.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

chebyfit-2025.1.1-cp310-cp310-macosx_10_9_x86_64.whl (32.0 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: chebyfit-2025.1.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chebyfit-2025.1.1.tar.gz
Algorithm Hash digest
SHA256 75a68c52ce4622252334dcc0c81318da78354aa67a953329938f796b0402d186
MD5 46d064be376e8d577b0d6839da68c865
BLAKE2b-256 69be658936c8e2f709981135fc9bf5179ef18ac706338873e7ecc3d390bf0835

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-win_arm64.whl
Algorithm Hash digest
SHA256 572299fd387b469fecccc126d2daf37089a5c10d3144314c7fc58485e096653d
MD5 2d87d588407dd031fb3aac38ff3d1357
BLAKE2b-256 5f28e4cb91e602557fadf3b21ed40de5d20c68e6fd8003c31c2075eaa83eb53e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f7eda6c9565df3c53ad300120d09dc1a7077bedf6a557fee5c9265fe08c76e02
MD5 6a1333cb332822fd96b09c077d4e2289
BLAKE2b-256 f843cc8dafd5b07a03dfd4b5189c2ba47c2dfd85abe176dfff346ef3140b685f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2025.1.1-cp313-cp313-win32.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 d64720631a1fa2c8043b8646f258b79d5a8408ebeacb4dec7ade852c03b30548
MD5 779709227c08b8a4c014cbd34547f498
BLAKE2b-256 9bdaee37d7db80f5936149608f45dbe808bc7fe688dfba7abeafbc399e33a239

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44245a3bf50e7052aad3876496672947bf793cd88cb35acee4c5e0d56cef75e3
MD5 f6c6141694dfb1f6108f95ddd3c77712
BLAKE2b-256 60d62fde8493bfeca2cd9e0a338052f732ff1cf54b08c7d54d712ab05a5aecbc

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f46bcb6e901e42438c838849534d442bb5c9b89283cd7ad78436d4162e35c45
MD5 73c3cabba551b35c8821c5abe40a7d38
BLAKE2b-256 cc59746d4dbc121f2cf7f665397f8eaa20c0a1b759fe312bab8f12a9a5ad0d53

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a28f1955ac1b2f7156b6622e794657add22ad875e42574ff4cea609a5ddb1a04
MD5 20d29e909cb371cd9dcd4d251b8270bb
BLAKE2b-256 52615d4098dd74bf54c086390aef6746d8b1051218d6030da74838b72b3d9d21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp312-cp312-win_arm64.whl
Algorithm Hash digest
SHA256 e78a18ef75b0b7b4730bd41c7ae90df7fa6d2a973d462c8e69390f786412e640
MD5 c762488780ab605f456830fb2803c14d
BLAKE2b-256 ae5b9a5b5ee3a9fe635f54030824b3a833e159824aaf93c522156eadb8688c5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7ca51f6176bed1d3b6430cf59b9dc15d189121be5484939050ed978d6e3051a8
MD5 773ede6c18c5a25650886a855e2b1a01
BLAKE2b-256 ef35af58df207682ca2fe00f38d3601f1e20726901be43b39a8ce9c75a6c7c53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2025.1.1-cp312-cp312-win32.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chebyfit-2025.1.1-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 28e24e0d9959eed41bb4b906eb9fccc63cf4ada67d8b9597ddb9904ad186dbbe
MD5 9bfa83252e48eb2b530d26ade2105a44
BLAKE2b-256 d04de06fc588d23a2eaaf4b8c303fb201f1d2dec09da167fd28966127248a6b8

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-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-2025.1.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9017f21c429248b0c1e4e415fbe4bcdc181753814ae2ee027f77df6b39a91a85
MD5 bb006ae16d12d1379da0d3ba4f80a677
BLAKE2b-256 789778265ccd82fa1a9b989a566a5ad2b6e01311745afe17f05d02fd7f5b111b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d01f7e9106acbbedf8734906d9addb73dbdbb2c13a9fe7f462e40625fa90fff
MD5 6763ec4eac7d8d84e8c83f876a24eb3e
BLAKE2b-256 d68ff4d8be8ea85143f1067904008fff93d433ecc96db908e61d1a28becd31b3

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6d2bbb8d8e33a457a893ed8e5b057d6f31971191966bcd086a143ff5a8f588ea
MD5 761a851bdb4afb6450fae88a14e46423
BLAKE2b-256 09ea3af36967cf8966fd961e146abdcab10d14d1e0ec8473bdc901b02bb693b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp311-cp311-win_arm64.whl
Algorithm Hash digest
SHA256 1b6290ccbe07c94fd473e13648b0c9d1ec7d97c0d71164935b2c38f1db0c08e3
MD5 203786c057bd852a48652e6ebf8d272d
BLAKE2b-256 0bf64412c81b968af7a60057f05d12f7aa078d3b97021f39048c7736ec098140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c9108b1e211828cc4f544f2200ae4059ed820ddf1093d7f36cda27a963880b4d
MD5 72ffa2782350806a8c1265f397b56c99
BLAKE2b-256 4a73d69d5d2059577e6c459748320bdfdee6a40a5dfea3097a79b68218692199

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2025.1.1-cp311-cp311-win32.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chebyfit-2025.1.1-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 dd5572837628d0d4c36acca223b2243fcd99ec3999740cf568bfd3de133572e6
MD5 abf803f6300bd2e49ccfc3cb48722f7e
BLAKE2b-256 723140a0807ea0b8388eb324c35e8757179818cc06563b9d604826677805ec61

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-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-2025.1.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26c5f8a1bbade8c982272fe2eea9d3ef0a0c18350c77966a48bb7464886db2d6
MD5 c761b564c6978d1ddc0430b2a7671d5e
BLAKE2b-256 2950ab1bb5e44f7a7dda0a079d7ce65c450e89cd012a28d0d02159245e47c5b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b10c3c3e489010d5411bb5fdb387501db9dbab021c8039de25fb5236ef2f9627
MD5 50d23c97251904df538cb416abab9fa7
BLAKE2b-256 315749d371ad7953b3667f68e0abe61a571c4936ac82e68d190807b9da1df53e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6ce0e27f0af437d5cf00e9c7add773154bf21981cb0e0d2b4974925df84fcdd9
MD5 e2b3de47651db5f38f4f7e8e9c72c563
BLAKE2b-256 8acc09ebd3db4b41fbf16138f90217d7b8539e636195c221657f98668c450c43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d1b589641df1fde97d7501a081079f89e256d92bfa3a60a67855b3b268ae6b82
MD5 0cb64475e24598245bc81945de527610
BLAKE2b-256 20a9b3891f45b364405b8487742de55000cde6759977ee88889417781f8276fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chebyfit-2025.1.1-cp310-cp310-win32.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for chebyfit-2025.1.1-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 fbc2a2659ca73471d6da3fffb6cab5c5342cc9d26a349075cfda1efb94292339
MD5 b8d8914fc803e81279fc1fec418f1a0c
BLAKE2b-256 cd992b252ddd7ea862599329e2366266282dba9ea9c247cf21a4470fb8c1eacf

See more details on using hashes here.

File details

Details for the file chebyfit-2025.1.1-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-2025.1.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38ca9efcf1a4136843f2ff22bd88b0c0d2ee6e1d94b9a0288244193ff9a4837a
MD5 2c787d064d82f2ae46beff88446f52ba
BLAKE2b-256 14374cb5a36e36ff9f864360c5e14ed4c612c05a87bacd770af2fb96a5456a77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2e5a327f876a4fd8ca598423a8ab4f0eaff5d12ce8e723ca2368452bf44420a0
MD5 5db6e319ecb36a4d762aae84467a1824
BLAKE2b-256 d840edcc105a3442ed45aec3429e20981d4b32de0a2088de26363b219b397cb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for chebyfit-2025.1.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 617a7a422a8e69b17785fcfe9f99d54920c47965fcbfb2a7fc32e6741ea10eee
MD5 a3157ea2285607f5bc3e58b4a8f4219f
BLAKE2b-256 bc5bc9c858b08ebea25f32ecf31f1464757c895ddc0fa5ac8abb6c51ce0f1c8d

See more details on using hashes here.

Supported by

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