Skip to main content

SUV Tools

Python tests status Deploy gh-pages status Deploy gh-pages status Latest Release Supported Python versions

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

Quick start

Install latest stable release:

pip install --upgrade suvtools

Import suvtools into your project:

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 and documentation for example usage.

Python tests

python3 -m unittest discover tests

Metadata

Release files for suvtools 1.3.0

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

Source distribution (sdist)

Source distribution for suvtools 1.3.0
File Size Uploaded
suvtools-1.3.0.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for suvtools 1.3.0
File Interpreter ABI Platform
suvtools-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / suvtools-1.3.0.tar.gz

Download URL suvtools-1.3.0.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ef0ce6b4266289f0914c9ac7ea1d14d9a1ea566c08642e30cb39c84502b82437
BLAKE2b-256 checksum
How to use checksums
a025f3302a21c4305aac7ad259b2fa9f76d5b256e1105dc67bc6e6c457d90508
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / suvtools-1.3.0-py3-none-any.whl

Download URL suvtools-1.3.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e9108fe0b78532a278e2cdcfb033cbfce5b389da72da5f8ee006e4ed4f462e7
BLAKE2b-256 checksum
How to use checksums
d6460eed97de249bd95c0b04c1c7b516c4b9d9cc54cf46613d5c7154ed4d064e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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