Skip to main content

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!

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.4.0.tar.gz (78.2 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.4.0-py3-none-any.whl (111.5 kB view details)

Uploaded Python 3

File details

Details for the file glassure-2.4.0.tar.gz.

File metadata

  • Download URL: glassure-2.4.0.tar.gz
  • Upload date:
  • Size: 78.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glassure-2.4.0.tar.gz
Algorithm Hash digest
SHA256 b9fd2e50d68831f8c46608a7dd44a8d6c1b0d861ead602c5cc4aaa94d4ed2ac0
MD5 d999e3b1d8c31d17559fa309e006f430
BLAKE2b-256 fa15837a0cbf830bdfb8254fa2f8ed59dd02f2a81807a2095084874bd3477741

See more details on using hashes here.

Provenance

The following attestation bundles were made for glassure-2.4.0.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: glassure-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 111.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for glassure-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79910223b952ad6f8f3ddac3b95b4ead4faf09d351fd4b8d0fb540559d3ac663
MD5 9b24959f22532ec6f120a5fe1a69a6e4
BLAKE2b-256 d81971155268c7574a3c77523eb32c5efc9d4c7c992ecbcb93fc3c41ccfaf088

See more details on using hashes here.

Provenance

The following attestation bundles were made for glassure-2.4.0-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.

Release history Release notifications | RSS feed

This release

2.4.0 This release

2 files

2.3.3

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.4.5

2 files

1.4.4

2 files

1.4.3

2 files

1.4.2

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 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