suvtools


Namesuvtools JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://pranabdas.github.io/suvtools/
SummaryPython library for analyzing and visualizing SSLS SUV Beamline data.
upload_time2024-10-06 14:16:39
maintainerNone
docs_urlNone
authorPranab Das
requires_python<4.0,>=3.9
licenseMIT
keywords python data-analysis matplotlib materials-science surface-science condensed-matter-physics photoelectron-spectroscopy arpes
VCS
bugtrack_url
requirements matplotlib numpy pandas scipy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">SUV Tools</h1>

<p align="center">
  <a href="https://github.com/pranabdas/suvtools/actions/workflows/python-tests.yml"><img src="https://github.com/pranabdas/suvtools/actions/workflows/python-tests.yml/badge.svg" alt="Python tests status"></a>
  <a href="https://github.com/pranabdas/suvtools/actions/workflows/deploy-gh-pages.yml"><img src="https://github.com/pranabdas/suvtools/actions/workflows/deploy-gh-pages.yml/badge.svg" alt="Deploy gh-pages status"></a>
  <a href="https://github.com/pranabdas/suvtools/blob/master/LICENSE"><img src="https://img.shields.io/github/license/sourcerer-io/hall-of-fame.svg?colorB=A31F34"></a>
  <a href="https://github.com/pranabdas/suvtools/releases/latest"><img src="https://img.shields.io/github/v/release/pranabdas/suvtools.svg" alt="Latest Release"/></a>
</p>


Visit the project homepage <https://pranabdas.github.io/suvtools/>

## Quick start

Install latest stable release:
```console
pip3 install --upgrade suvtools
```

Import suvtools into your project:
```python
import suvtools as suv
```

**Modules:**

- `suv.load("datafile.txt", scan=None)`: It will return a two dimensional array
with columns for various parameters. If the second argument, i.e., the scan
number is not specified, the code will read the last scan from the file.

- `suv.fit_gauss(x, y, a=None, x0=None, sigma=None, xmin=None, xmax=None, num=1000)`:
returns x, Gaussian fitted y values, and prints out relevant parameters. `xmin`
and `xmax` determines the range to fit. If `xmin` and `xmax` are not provided,
whole range is used. `num` determines the number of points returned in `x_fit`
and `y_fit`.

- `suv.fit_lorentz(x, y, a=None, x0=None, gamma=None, xmin=None, xmax=None, num=1000)`:
returns x, Lorentzian fitted y values, and prints out relevant parameters.
`xmin` and `xmax` determines the range to fit. If `xmin` and `xmax` are not
provided, whole range is used. `num` determines the number of points returned in
`x_fit` and `y_fit`.

- `suv.save_csv("datafile.txt", csvname=None, scan=None)`: saves scan to a csv
file. The file will be saved in the save directory as `datafile` with name
`datafile.csv` unless  `csvname` is specified. Like the `load` module, if the
scan number is not specified, it will read the last scan from the file.

- `suv.norm_bg(energy, intensity, x1, x2, x_norm_loc=None)`:
Removes linear background, and normalizes the data. x1, x2 are energy values
that determines the slope of the background. By default the normalization done
at the tail point of the spectra. It can be changed to other point, enter the
corresponding energy value. The intention is to normalize at an energy value
away from the peaks/features of interest.

- `suv.lock_peak(data, refdata, x1=None, x2=None, E_col=0, I_col=9, I0_col=4)`:
Locks peak position with respect to the reference data. It locks the maximum of
intensity to the same energy; the range of peak search can be specified by input
`x1` and `x2`. If no bounds are given, it will find the maximum in the whole
data range.

- `suv.calc_area(y, x, x_start=None, x_end=None)`:
Calculates area under the curve for given `x` and `y` values. `x_start` and
`x_end` can be specified to set the limit of integration region, if not provided
whole range is integrated.

See the notebook for some example usage.

### Documentation development

```console
# install npm packages
npm install

# serve locally
npm start

# build
npm run build

# deploy to github
npm run gh-deploy
```

### Python tests

```console
python3 -m unittest discover tests
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://pranabdas.github.io/suvtools/",
    "name": "suvtools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "python, data-analysis, matplotlib, materials-science, surface-science, condensed-matter-physics, photoelectron-spectroscopy, arpes",
    "author": "Pranab Das",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/7c/cc/f0afbd438c16507b97a9f9b77bf1f876ba9cb790813c3e83ddb4eedbc96b/suvtools-1.0.0.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">SUV Tools</h1>\n\n<p align=\"center\">\n  <a href=\"https://github.com/pranabdas/suvtools/actions/workflows/python-tests.yml\"><img src=\"https://github.com/pranabdas/suvtools/actions/workflows/python-tests.yml/badge.svg\" alt=\"Python tests status\"></a>\n  <a href=\"https://github.com/pranabdas/suvtools/actions/workflows/deploy-gh-pages.yml\"><img src=\"https://github.com/pranabdas/suvtools/actions/workflows/deploy-gh-pages.yml/badge.svg\" alt=\"Deploy gh-pages status\"></a>\n  <a href=\"https://github.com/pranabdas/suvtools/blob/master/LICENSE\"><img src=\"https://img.shields.io/github/license/sourcerer-io/hall-of-fame.svg?colorB=A31F34\"></a>\n  <a href=\"https://github.com/pranabdas/suvtools/releases/latest\"><img src=\"https://img.shields.io/github/v/release/pranabdas/suvtools.svg\" alt=\"Latest Release\"/></a>\n</p>\n\n\nVisit the project homepage <https://pranabdas.github.io/suvtools/>\n\n## Quick start\n\nInstall latest stable release:\n```console\npip3 install --upgrade suvtools\n```\n\nImport suvtools into your project:\n```python\nimport suvtools as suv\n```\n\n**Modules:**\n\n- `suv.load(\"datafile.txt\", scan=None)`: It will return a two dimensional array\nwith columns for various parameters. If the second argument, i.e., the scan\nnumber is not specified, the code will read the last scan from the file.\n\n- `suv.fit_gauss(x, y, a=None, x0=None, sigma=None, xmin=None, xmax=None, num=1000)`:\nreturns x, Gaussian fitted y values, and prints out relevant parameters. `xmin`\nand `xmax` determines the range to fit. If `xmin` and `xmax` are not provided,\nwhole range is used. `num` determines the number of points returned in `x_fit`\nand `y_fit`.\n\n- `suv.fit_lorentz(x, y, a=None, x0=None, gamma=None, xmin=None, xmax=None, num=1000)`:\nreturns x, Lorentzian fitted y values, and prints out relevant parameters.\n`xmin` and `xmax` determines the range to fit. If `xmin` and `xmax` are not\nprovided, whole range is used. `num` determines the number of points returned in\n`x_fit` and `y_fit`.\n\n- `suv.save_csv(\"datafile.txt\", csvname=None, scan=None)`: saves scan to a csv\nfile. The file will be saved in the save directory as `datafile` with name\n`datafile.csv` unless  `csvname` is specified. Like the `load` module, if the\nscan number is not specified, it will read the last scan from the file.\n\n- `suv.norm_bg(energy, intensity, x1, x2, x_norm_loc=None)`:\nRemoves linear background, and normalizes the data. x1, x2 are energy values\nthat determines the slope of the background. By default the normalization done\nat the tail point of the spectra. It can be changed to other point, enter the\ncorresponding energy value. The intention is to normalize at an energy value\naway from the peaks/features of interest.\n\n- `suv.lock_peak(data, refdata, x1=None, x2=None, E_col=0, I_col=9, I0_col=4)`:\nLocks peak position with respect to the reference data. It locks the maximum of\nintensity to the same energy; the range of peak search can be specified by input\n`x1` and `x2`. If no bounds are given, it will find the maximum in the whole\ndata range.\n\n- `suv.calc_area(y, x, x_start=None, x_end=None)`:\nCalculates area under the curve for given `x` and `y` values. `x_start` and\n`x_end` can be specified to set the limit of integration region, if not provided\nwhole range is integrated.\n\nSee the notebook for some example usage.\n\n### Documentation development\n\n```console\n# install npm packages\nnpm install\n\n# serve locally\nnpm start\n\n# build\nnpm run build\n\n# deploy to github\nnpm run gh-deploy\n```\n\n### Python tests\n\n```console\npython3 -m unittest discover tests\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python library for analyzing and visualizing SSLS SUV Beamline data.",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://pranabdas.github.io/suvtools/docs/",
        "Homepage": "https://pranabdas.github.io/suvtools/",
        "Repository": "https://github.com/pranabdas/suvtools"
    },
    "split_keywords": [
        "python",
        " data-analysis",
        " matplotlib",
        " materials-science",
        " surface-science",
        " condensed-matter-physics",
        " photoelectron-spectroscopy",
        " arpes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01689a8986fab4e4631a57825ed9112a0b14c4580afac3493e2cae76bee88262",
                "md5": "26acaff51333a10b0e99fc3f6b7c44bf",
                "sha256": "2dce172f482402b5552d70454325286ec4db4d432baa6144f672d018007b6889"
            },
            "downloads": -1,
            "filename": "suvtools-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "26acaff51333a10b0e99fc3f6b7c44bf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 8919,
            "upload_time": "2024-10-06T14:16:37",
            "upload_time_iso_8601": "2024-10-06T14:16:37.464934Z",
            "url": "https://files.pythonhosted.org/packages/01/68/9a8986fab4e4631a57825ed9112a0b14c4580afac3493e2cae76bee88262/suvtools-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cccf0afbd438c16507b97a9f9b77bf1f876ba9cb790813c3e83ddb4eedbc96b",
                "md5": "a412af976e717a8af52f7959f64c7c1e",
                "sha256": "0a7fd89125ba0b7e0e5b0194fb1660809850e6004909d0365e1d48f5c5273177"
            },
            "downloads": -1,
            "filename": "suvtools-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a412af976e717a8af52f7959f64c7c1e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 5839,
            "upload_time": "2024-10-06T14:16:39",
            "upload_time_iso_8601": "2024-10-06T14:16:39.211602Z",
            "url": "https://files.pythonhosted.org/packages/7c/cc/f0afbd438c16507b97a9f9b77bf1f876ba9cb790813c3e83ddb4eedbc96b/suvtools-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-06 14:16:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pranabdas",
    "github_project": "suvtools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.9.2"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "2.0.2"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.2.3"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.13.1"
                ]
            ]
        }
    ],
    "lcname": "suvtools"
}
        
Elapsed time: 1.48851s