API and GUI for analysis of X-ray total scattering data
Project description
Glassure
A Python API for data analysis of total x-ray diffraction data. It performs background subtraction, Fourier transform and optimization of experimental data.
Warning, the upgrade from version 1.4.5 to 2.0.0 has removed the GUI - which came with glassure. A new WebGUI based on the version 2 API is available under glassure.vercel.app.
Documentation
The documentation can be found here.
Changelog
The changelog can be found here.
Maintainer
Clemens Prescher (clemens.prescher@gmail.com)
Requirements
- python 3.10+
It is known to run on Windows, Mac OS X and Linux.
Installation
The Glassure package can be installed into your existing python distribution using pypi via:
python -m pip install glassure
Quick Start
Check out the examples directory for complete working examples:
1. Quick Start ⭐
from glassure.pattern import Pattern
from glassure.calc import create_calculate_pdf_configs, calculate_pdf
# Load your data
data = Pattern.from_file("sample.xy")
bkg = Pattern.from_file("background.xy")
# Create configs with defaults - just provide the essentials!
data_config, calculation_config = create_calculate_pdf_configs(
data=data,
composition="SiO2", # or {"Si": 1, "O": 2}
density=2.2, # g/cm³
bkg=bkg,
)
# Calculate PDF
result = calculate_pdf(data_config, calculation_config)
# Access results: S(Q), F(r), g(r)
result.sq.save("sq.xy")
result.fr.save("fr.xy")
result.gr.save("gr.xy")
2. Configuration System (For production)
For more control, use the configuration system with SampleConfig, TransformConfig, and CalculationConfig.
3. Raw Functions (For research/debugging)
For maximum control, use the low-level functions directly.
See the examples directory for complete, documented examples of all three approaches.
Example Datasets
The repository includes test datasets in tests/data/:
SiO2.xy- SiO2 (silica) X-ray scattering patternSiO2_bkg.xy- Background pattern
Use these with the example scripts to get started!
Project details
Release history Release notifications | RSS feed
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 glassure-2.3.3.tar.gz.
File metadata
- Download URL: glassure-2.3.3.tar.gz
- Upload date:
- Size: 77.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44d7252d4ecf68d1cc02e7cae33c6c30e6f6ffedd72874f300f7c22b4969f8b7
|
|
| MD5 |
4622515d795d011d0fc0503f1cf6dff2
|
|
| BLAKE2b-256 |
46b8de11a86e48d5606fe1018396af6c83b50c7d70224d34aae20ce0fbf2fe97
|
Provenance
The following attestation bundles were made for glassure-2.3.3.tar.gz:
Publisher:
CD.yml on CPrescher/Glassure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glassure-2.3.3.tar.gz -
Subject digest:
44d7252d4ecf68d1cc02e7cae33c6c30e6f6ffedd72874f300f7c22b4969f8b7 - Sigstore transparency entry: 849799578
- Sigstore integration time:
-
Permalink:
CPrescher/Glassure@f011893f2aa2dbe193025dfd3e31e84e373c91a4 -
Branch / Tag:
refs/tags/2.3.3 - Owner: https://github.com/CPrescher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CD.yml@f011893f2aa2dbe193025dfd3e31e84e373c91a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file glassure-2.3.3-py3-none-any.whl.
File metadata
- Download URL: glassure-2.3.3-py3-none-any.whl
- Upload date:
- Size: 110.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
482bf73f8ced45f98db083f78656c1092ac3b4b231fd88bfc1ca67c41d01976c
|
|
| MD5 |
f0233ca0ab6a609a3a245d2f70145798
|
|
| BLAKE2b-256 |
8dc611b586d198caf494a90501cc5fd9281c7f8317b8e1b1b46b52841fb21104
|
Provenance
The following attestation bundles were made for glassure-2.3.3-py3-none-any.whl:
Publisher:
CD.yml on CPrescher/Glassure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glassure-2.3.3-py3-none-any.whl -
Subject digest:
482bf73f8ced45f98db083f78656c1092ac3b4b231fd88bfc1ca67c41d01976c - Sigstore transparency entry: 849799579
- Sigstore integration time:
-
Permalink:
CPrescher/Glassure@f011893f2aa2dbe193025dfd3e31e84e373c91a4 -
Branch / Tag:
refs/tags/2.3.3 - Owner: https://github.com/CPrescher
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CD.yml@f011893f2aa2dbe193025dfd3e31e84e373c91a4 -
Trigger Event:
release
-
Statement type: