Python library for analyzing and visualizing SSLS SUV Beamline data.
Project description
SUV Tools
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.xminandxmaxdetermines the range to fit. Ifxminandxmaxare not provided, whole range is used.numdetermines the number of points returned inx_fitandy_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.xminandxmaxdetermines the range to fit. Ifxminandxmaxare not provided, whole range is used.numdetermines the number of points returned inx_fitandy_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 asdatafilewith namedatafile.csvunlesscsvnameis specified. Like theloadmodule, 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 inputx1andx2. 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 givenxandyvalues.x_startandx_endcan 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file suvtools-1.1.1.tar.gz.
File metadata
- Download URL: suvtools-1.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc701959c0125fa0c7c00b1a67e795cfc0d04ea73395242211700914ce218ee9
|
|
| MD5 |
50b52090c21979ec48edb827e65eaa52
|
|
| BLAKE2b-256 |
ecebadaf84939814fef5ed31717d11a6e0aa6c5982c658e5c9a2f0b83620ea28
|
Provenance
The following attestation bundles were made for suvtools-1.1.1.tar.gz:
Publisher:
publish.yml on pranabdas/suvtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
suvtools-1.1.1.tar.gz -
Subject digest:
bc701959c0125fa0c7c00b1a67e795cfc0d04ea73395242211700914ce218ee9 - Sigstore transparency entry: 160267727
- Sigstore integration time:
-
Permalink:
pranabdas/suvtools@5a95cd4c064e59648c2326d68485e99980314276 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/pranabdas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a95cd4c064e59648c2326d68485e99980314276 -
Trigger Event:
release
-
Statement type:
File details
Details for the file suvtools-1.1.1-py3-none-any.whl.
File metadata
- Download URL: suvtools-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f29003da1f59b5bc81a1d8aab108dceaff0b0d76d88057d4ed464f892d1382f
|
|
| MD5 |
1e72b9c692f27e13af665a122fb63718
|
|
| BLAKE2b-256 |
2bf6c357c8c4a1c9fe162da38996ee39a95d12a3dea5c35d0d7aca41ca3aeed0
|
Provenance
The following attestation bundles were made for suvtools-1.1.1-py3-none-any.whl:
Publisher:
publish.yml on pranabdas/suvtools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
suvtools-1.1.1-py3-none-any.whl -
Subject digest:
5f29003da1f59b5bc81a1d8aab108dceaff0b0d76d88057d4ed464f892d1382f - Sigstore transparency entry: 160267729
- Sigstore integration time:
-
Permalink:
pranabdas/suvtools@5a95cd4c064e59648c2326d68485e99980314276 -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/pranabdas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a95cd4c064e59648c2326d68485e99980314276 -
Trigger Event:
release
-
Statement type: