fitspy


Namefitspy JSON
Version 2024.4 PyPI version JSON
download
home_page
SummaryFitspy: a generic tool to fit spectra in python
upload_time2024-02-27 13:15:51
maintainer
docs_urlNone
author
requires_python>=3.7
licenseGPL v3
keywords fitspy fit spectra spectrum map 1d 2d decomposition gaussian lorentzian pseudovoigt gui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/fitspy?label=pypi%20package)](
https://pypi.org/project/fitspy/)
[![Github](https://img.shields.io/badge/GitHub-GPL--3.0-informational)](
https://github.dev/CEA-MetroCarac/fitspy)
[![Doc](https://img.shields.io/badge/%F0%9F%95%AE-docs-green.svg)](
https://cea-metrocarac.github.io/fitspy/doc/index.html)


<p align="center" width="100%">
    <img align="center" width=250 src=https://cea-metrocarac.github.io/fitspy/logo.png>
</p>


**Fitspy** is a generic tool dedicated to **fit sp**\ ectra in **py**\ thon with a GUI that aims to be as simple and intuitive to use as possible.

<p align="center" width="100%">
    <img align="center" width="75%" src=https://cea-metrocarac.github.io/fitspy/fitspy.png>
</p>

Processed spectra may be independent of each other or may result from 2D-maps
acquisitions.

<p align="center" width="100%">
    <img align="center" width="30%" src=https://cea-metrocarac.github.io/fitspy/2d-map.png> <br>
    <em>Example of fitspy 2D-map frame interacting with the main GUI.</em> 
</p>

The predefined peak models considered in Fitspy are  `Gaussian`, `Lorentzian`, `Asymetric Gaussian`, `Asymetric Lorentzian` and `Pseudovoigt`.

A `constant`, `linear`, `parabolic` or `exponential` background model can also be added in the fitting.

In both cases, `user-defined models` can be added.

Fitspy main features:

- Fitspy uses the [lmfit](https://github.com/lmfit/lmfit-py) library to fit the spectra
- The fit processing can be multi-threaded
- Bounds and constraints can be set on each peaks models parameter
- From an automatic noise level estimation, according to the local noise, peak models can be automatically deactivated
- Fitspy also includes automatic outlier detection to be excluded during the fitting process

All actions allowed with the GUI can be executed in script mode (see examples [here](https://github.com/CEA-MetroCarac/fitspy/tree/main/examples)).
These actions (like baseline and peaks definition, parameters constraints, ...) can be saved in a `Fitspy model` and replayed as-is or applied to other new spectra datasets.


## Installation

```
pip install fitspy
```

*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/intro.html#install-and-launching) for more details)*


## Tests and examples execution

```
pip install pytest
git clone https://github.com/CEA-MetroCarac/fitspy.git
cd fitspy
pytest
python example/ex_gui_auto_decomposition.py
```

*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/intro.html#install-and-launching) for more details)*


## Quick start

Launch the application:

```
fitspy
```

Then, from the top to the bottom of the right panel:

- `Select` file(s)
- *(Optional)* Define the **X-range**
- Define the baseline to `subtract` *(left or right click on the figure to add or delete (resp.) a baseline point)*
- *(Optional)* Normalize the spectrum/spectra
- Click on the `Fitting` panel to activate it
- Select `Peak model` and add peaks *(left or right click on the figure to add or delete (resp.) a peak)*
- *(Optional)* Add a background (**BKG model**) to be fitted
- *(Optional)* Use **Parameters** to set bounds and constraints
- `Fit` the selected spectrum/spectra
- *(Optional)* **Save** the parameters in **.csv** format
- *(Optional)* **Save** the **Model** in a .json file (to be replayed later)


*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/workflow.html) for more details)*


### Authors information


In case you use the results of this code in an article, please cite:

- Quéméré P., (2024). Fitspy: A python package for spectral decomposition. *Journal of Open Source Software. (submitted)*

- Newville M., (2014). LMFIT: Non-Linear Least-Square Minimization and Curve-Fitting for Python. Zenodo. doi: 10.5281/zenodo.11813.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fitspy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Fitspy,fit,spectra,spectrum,map,1D,2D,decomposition,Gaussian,Lorentzian,Pseudovoigt,GUI",
    "author": "",
    "author_email": "Patrick Qu\u00e9m\u00e9r\u00e9 <patrick.quemere@cea.fr>",
    "download_url": "https://files.pythonhosted.org/packages/10/f9/504109a6f386992ddd5011b4f88a407f2ba7cd3ffa44c9a9a4a01a0825ca/fitspy-2024.4.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/fitspy?label=pypi%20package)](\r\nhttps://pypi.org/project/fitspy/)\r\n[![Github](https://img.shields.io/badge/GitHub-GPL--3.0-informational)](\r\nhttps://github.dev/CEA-MetroCarac/fitspy)\r\n[![Doc](https://img.shields.io/badge/%F0%9F%95%AE-docs-green.svg)](\r\nhttps://cea-metrocarac.github.io/fitspy/doc/index.html)\r\n\r\n\r\n<p align=\"center\" width=\"100%\">\r\n    <img align=\"center\" width=250 src=https://cea-metrocarac.github.io/fitspy/logo.png>\r\n</p>\r\n\r\n\r\n**Fitspy** is a generic tool dedicated to **fit sp**\\ ectra in **py**\\ thon with a GUI that aims to be as simple and intuitive to use as possible.\r\n\r\n<p align=\"center\" width=\"100%\">\r\n    <img align=\"center\" width=\"75%\" src=https://cea-metrocarac.github.io/fitspy/fitspy.png>\r\n</p>\r\n\r\nProcessed spectra may be independent of each other or may result from 2D-maps\r\nacquisitions.\r\n\r\n<p align=\"center\" width=\"100%\">\r\n    <img align=\"center\" width=\"30%\" src=https://cea-metrocarac.github.io/fitspy/2d-map.png> <br>\r\n    <em>Example of fitspy 2D-map frame interacting with the main GUI.</em> \r\n</p>\r\n\r\nThe predefined peak models considered in Fitspy are  `Gaussian`, `Lorentzian`, `Asymetric Gaussian`, `Asymetric Lorentzian` and `Pseudovoigt`.\r\n\r\nA `constant`, `linear`, `parabolic` or `exponential` background model can also be added in the fitting.\r\n\r\nIn both cases, `user-defined models` can be added.\r\n\r\nFitspy main features:\r\n\r\n- Fitspy uses the [lmfit](https://github.com/lmfit/lmfit-py) library to fit the spectra\r\n- The fit processing can be multi-threaded\r\n- Bounds and constraints can be set on each peaks models parameter\r\n- From an automatic noise level estimation, according to the local noise, peak models can be automatically deactivated\r\n- Fitspy also includes automatic outlier detection to be excluded during the fitting process\r\n\r\nAll actions allowed with the GUI can be executed in script mode (see examples [here](https://github.com/CEA-MetroCarac/fitspy/tree/main/examples)).\r\nThese actions (like baseline and peaks definition, parameters constraints, ...) can be saved in a `Fitspy model` and replayed as-is or applied to other new spectra datasets.\r\n\r\n\r\n## Installation\r\n\r\n```\r\npip install fitspy\r\n```\r\n\r\n*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/intro.html#install-and-launching) for more details)*\r\n\r\n\r\n## Tests and examples execution\r\n\r\n```\r\npip install pytest\r\ngit clone https://github.com/CEA-MetroCarac/fitspy.git\r\ncd fitspy\r\npytest\r\npython example/ex_gui_auto_decomposition.py\r\n```\r\n\r\n*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/intro.html#install-and-launching) for more details)*\r\n\r\n\r\n## Quick start\r\n\r\nLaunch the application:\r\n\r\n```\r\nfitspy\r\n```\r\n\r\nThen, from the top to the bottom of the right panel:\r\n\r\n- `Select` file(s)\r\n- *(Optional)* Define the **X-range**\r\n- Define the baseline to `subtract` *(left or right click on the figure to add or delete (resp.) a baseline point)*\r\n- *(Optional)* Normalize the spectrum/spectra\r\n- Click on the `Fitting` panel to activate it\r\n- Select `Peak model` and add peaks *(left or right click on the figure to add or delete (resp.) a peak)*\r\n- *(Optional)* Add a background (**BKG model**) to be fitted\r\n- *(Optional)* Use **Parameters** to set bounds and constraints\r\n- `Fit` the selected spectrum/spectra\r\n- *(Optional)* **Save** the parameters in **.csv** format\r\n- *(Optional)* **Save** the **Model** in a .json file (to be replayed later)\r\n\r\n\r\n*(See the [documentation](https://cea-metrocarac.github.io/fitspy/doc/user_guide/workflow.html) for more details)*\r\n\r\n\r\n### Authors information\r\n\r\n\r\nIn case you use the results of this code in an article, please cite:\r\n\r\n- Qu\u00e9m\u00e9r\u00e9 P., (2024). Fitspy: A python package for spectral decomposition. *Journal of Open Source Software. (submitted)*\r\n\r\n- Newville M., (2014). LMFIT: Non-Linear Least-Square Minimization and Curve-Fitting for Python. Zenodo. doi: 10.5281/zenodo.11813.\r\n",
    "bugtrack_url": null,
    "license": "GPL v3",
    "summary": "Fitspy: a generic tool to fit spectra in python",
    "version": "2024.4",
    "project_urls": {
        "Documentation": "https://cea-metrocarac.github.io/fitspy/doc/index.html",
        "Homepage": "https://github.dev/CEA-MetroCarac/fitspy"
    },
    "split_keywords": [
        "fitspy",
        "fit",
        "spectra",
        "spectrum",
        "map",
        "1d",
        "2d",
        "decomposition",
        "gaussian",
        "lorentzian",
        "pseudovoigt",
        "gui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68c75d4645e7a8555b9c192705a339737d23e150d74352d1e71896285886c610",
                "md5": "47c518de81f360d680b6566e689f89c3",
                "sha256": "8b8960f68735c1febc3e36d942a84c6d3c2dd4b0e7f22b0cba0870572d10f5f2"
            },
            "downloads": -1,
            "filename": "fitspy-2024.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "47c518de81f360d680b6566e689f89c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 60052,
            "upload_time": "2024-02-27T13:15:44",
            "upload_time_iso_8601": "2024-02-27T13:15:44.752698Z",
            "url": "https://files.pythonhosted.org/packages/68/c7/5d4645e7a8555b9c192705a339737d23e150d74352d1e71896285886c610/fitspy-2024.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10f9504109a6f386992ddd5011b4f88a407f2ba7cd3ffa44c9a9a4a01a0825ca",
                "md5": "1e786fab694eb5a976ebfefda3bc20ab",
                "sha256": "1f493a9fed8661ce2d84ec6cc025eaa0af48ff1852660dbb061a2dc21dbfe6e5"
            },
            "downloads": -1,
            "filename": "fitspy-2024.4.tar.gz",
            "has_sig": false,
            "md5_digest": "1e786fab694eb5a976ebfefda3bc20ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 20669705,
            "upload_time": "2024-02-27T13:15:51",
            "upload_time_iso_8601": "2024-02-27T13:15:51.609766Z",
            "url": "https://files.pythonhosted.org/packages/10/f9/504109a6f386992ddd5011b4f88a407f2ba7cd3ffa44c9a9a4a01a0825ca/fitspy-2024.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-27 13:15:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fitspy"
}
        
Elapsed time: 0.21201s