Skip to main content

API and GUI for analysis of X-ray total scattering data

Project description

codecov DOI

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 pattern
  • SiO2_bkg.xy - Background pattern

Use these with the example scripts to get started!

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

glassure-2.3.3.tar.gz (77.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glassure-2.3.3-py3-none-any.whl (110.7 kB view details)

Uploaded Python 3

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

Hashes for glassure-2.3.3.tar.gz
Algorithm Hash digest
SHA256 44d7252d4ecf68d1cc02e7cae33c6c30e6f6ffedd72874f300f7c22b4969f8b7
MD5 4622515d795d011d0fc0503f1cf6dff2
BLAKE2b-256 46b8de11a86e48d5606fe1018396af6c83b50c7d70224d34aae20ce0fbf2fe97

See more details on using hashes here.

Provenance

The following attestation bundles were made for glassure-2.3.3.tar.gz:

Publisher: CD.yml on CPrescher/Glassure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for glassure-2.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 482bf73f8ced45f98db083f78656c1092ac3b4b231fd88bfc1ca67c41d01976c
MD5 f0233ca0ab6a609a3a245d2f70145798
BLAKE2b-256 8dc611b586d198caf494a90501cc5fd9281c7f8317b8e1b1b46b52841fb21104

See more details on using hashes here.

Provenance

The following attestation bundles were made for glassure-2.3.3-py3-none-any.whl:

Publisher: CD.yml on CPrescher/Glassure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page