Skip to main content

interactive_curve_fit

A Python project enables you to do curve fitting on spectrum data interactively on GUI. You can visualize your spectrum and fit the optional number of peaks on GUI using Scipy.optimize.curve_fit method.

How to use?

Try tutorial.py with your spectrum data!

Spectrum data format must be like the table below

x y
0 1
1 13
2 30
3 43
4 31
5 11
... ...

Steps to curve-fit

  1. Teach your initial guess of the positions of each peaks roughly to Fitter.

    from interactive_curve_fit import read_data, Guessor, Fitter
    
    data = read_data(data, headers=2, sep=',')
    guessor = Guessor(data, background=10, method='drag')
    guess = guessor.guess()
    

    Initial Guess method

    • mouse-dragging (wrap up peak area by mouse-dragging)
    • click (click the top and the both edges of each peaks)

    Screenshot

    Guessing peak pos interactively Guessing another peak pos Fitting results (by Fitter class) Peak information on terminal

  2. Give your spectrum data and your guess to Fitter.

    fitter = Fitter(data, guess)
    fitter.run(method='gaussian')
    

    Supported fitting functions

    • gaussian function
    • polynomial function

    Output information includes

    • position (x, y) of each peaks
    • baseline height of the spectrum
    • bandwidth of each peaks with its CI (confidential interval)
  3. Save the fitting results

    fitter.save_data('out/fitting_result.csv')
    
  4. Other features

    bmp_to_csv converts bmp file to csv file.

    from interactive_curve_fit import bmg_to_csv
    bmp_to_csv('data/line_spectrum.bmp')
    data = read_data('data/line_spectrum.csv')
    

    Fitter can visualize fitting results

    fitter.plot_fit()
    

    Fitter can also display fitting results on terminal

    fitter.display_results_terminal(ci=2)
    

Supported supectrum file format

  • ascii file(.asc .csv .txt etc..)

  • bmp image(.bmp .jpg .png .jpeg etc..)

    excel sheet files, table of html are planed to be suported in the near future.

Features that are planned to be supported!

  • baseline correlation
  • other fitting functions (e.g. binomical distribution function)
  • automated guessor method using wavelet transform and CNN

Metadata

Release files for interactive-curve-fit 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for interactive-curve-fit 0.0.1
File Size Uploaded Provenance Actions
interactive_curve_fit-0.0.1.tar.gz 356.0 kB Without provenance Details for interactive_curve_fit-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for interactive-curve-fit 0.0.1
File Interpreter ABI Platform Actions
interactive_curve_fit-0.0.1-py3-none-any.whl Python 3 none any Details for interactive_curve_fit-0.0.1-py3-none-any.whl

Total release size: 371.5 kB

Release files / interactive_curve_fit-0.0.1.tar.gz

Download URL interactive_curve_fit-0.0.1.tar.gz
Size 356.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c193c67b693e0a807c1793caab6ed14a1230e5499eb9b83d6a235280783539c0
BLAKE2b-256 checksum
How to use checksums
d6267fc933035b994ce00bd7529d17466390ca8a69f345e93fa914e1702cda85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / interactive_curve_fit-0.0.1-py3-none-any.whl

Download URL interactive_curve_fit-0.0.1-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15daa3c2eb87bdd15afb05935ad5784a54907a3ecf62aeda726a3113b2c9bf19
BLAKE2b-256 checksum
How to use checksums
881734ccb061c34f1e6175b0f8569a8d8d99636a69b1effa991ee2e38a00f21e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Security for interactive-curve-fit 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page