Skip to main content

Advisor-Scattering — Advanced Visual Scattering Toolkit for Reciprocal-space

Python PyQt5 License Tests Docs

Advisor-Scattering is a PyQt5 desktop app for X-ray scattering/diffraction experiments. It helps you convert scattering angles ↔ momentum transfer (HKL), explore scattering geometry, and visualize structure factors—all with interactive plots. Full docs on Read the Docs.

Demo video or use the link below to view the demo video. ▶ Demo video (MP4)

Features

  • Convert scattering angles to momentum transfer (HKL) and vice versa.
  • Visualize scattering geometry and unit cells
  • Compute and visualize structure factors in reciprocal space.
  • CIF file drop-in support
  • Local structure library ("My structures"): remembers CIFs you've loaded on this device, with Recent/Starred/search, and a bundled offline example to try immediately
  • Import crystal orientation from diffraction test data

Install

  • Python 3.9 only, with PyQt5, numpy, scipy, matplotlib, Dans_Diffraction (see requirements.txt).

It is recommened to install from PyPI:

pip install advisor-scattering

Run

advisor
# or
advisor-scattering
# or
python -m advisor

Note: the install command is pip install advisor-scattering, and the import is import advisor.


Minimal workflow (60 seconds)

  1. Launch the app.
  2. Enter lattice constants/angles and beam energy, or drop a CIF file.
  3. Click Initialize.
  4. Use the feature tabs (Scattering Geometry / Structure Factor) to calculate and visualize.

Init flow


Using the app

1. Initialization window

  • Enter lattice constants (a, b, c) and angles (alpha, beta, gamma); beam energy auto-updates wavelength/|k|.
  • Optional: drop a CIF to autofill lattice parameters and preview the unit cell.
  • Adjust Euler angles (roll, pitch, yaw) to orient the lattice/sample relative to the goniometer.
  • New: Use Import from Diffraction Test to automatically determine Euler angles from known diffraction measurements.
  • Click Initialize to load the main interface and pass parameters to all tabs.

2. Scattering Geometry tab

  • Angles → HKL: enter 2θ/θ/χ/φ, compute HKL.
  • HKL → Angles: enter HKL, compute feasible angles.
  • HK to Angles (fixed 2θ) and HKL scan (fixed 2θ) subtabs for trajectory planning.

Scattering geometry demo

3. Structure Factor tab

  • Requires a CIF (from init) and an energy in the tab.
  • HKL plane: explore a 3D HKL cube with linked HK/HL/KL slices.
  • Customized plane: choose U/V vectors and a center to sample an arbitrary plane in reciprocal space.

Structure factor demo

4. My structures and Try an example

  • Click Structures ▾ next to the CIF area (or File → My structures…) to reopen a previously loaded CIF, without finding the original file again.
  • No CIF on hand? Try an example loads a small bundled structure, fully offline.
  • Accepted CIFs are remembered automatically on this device (toggle in the picker); removing a saved entry never touches your original file on disk.

5. Changing or resetting the structure

Use the toolbar button or File → Change Structure… to pick a different CIF or start over, returning to the init window.


Project structure (at a glance)

advisor/          application package
  app.py          bootstrap
  controllers/    app/feature coordinators
  domain/         math and geometry helpers (no PyQt)
  features/       per-feature domain/controller/ui code
  ui/             shared UI pieces (init window, main window, base tab, visualizers)
  resources/      QSS, icons, config JSON, sample data
docs/             Sphinx sources and assets

Documentation

  • Full Sphinx docs live in docs/ and on Read the Docs.
  • Appendix covers scattering angle definitions and HKL conventions.

Contributing

Bug reports, feature requests, and pull requests are welcome — see CONTRIBUTING.md for dev setup, testing, and architecture pointers. This project follows the Contributor Covenant Code of Conduct.

Metadata

Release files for advisor-scattering 1.2.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 advisor-scattering 1.2.0
File Size Uploaded Provenance Actions
advisor_scattering-1.2.0.tar.gz 419.1 kB Without provenance Details for advisor_scattering-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for advisor-scattering 1.2.0
File Interpreter ABI Platform Actions
advisor_scattering-1.2.0-py3-none-any.whl Python 3 none any Details for advisor_scattering-1.2.0-py3-none-any.whl

Total release size: 875.5 kB

Release files / advisor_scattering-1.2.0.tar.gz

Download URL advisor_scattering-1.2.0.tar.gz
Size 419.1 kB
Tags Source
SHA-256 checksum
How to use checksums
88f97683cb77a9957d1c6e6f103ae21bbeec87598a38cbdc84282c5ff6c31fad
BLAKE2b-256 checksum
How to use checksums
b2c5567b26f9b7fde7daf79c3079e0048e4348d588e113c7223be00991c75441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / advisor_scattering-1.2.0-py3-none-any.whl

Download URL advisor_scattering-1.2.0-py3-none-any.whl
Size 456.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a85a5ba41fe30a647a94c8b5f0d30cbd04172bbfa8e97e3bc15249bb3701b2f
BLAKE2b-256 checksum
How to use checksums
17ce7d39f476aa62d29eab52d3df61aede257140e5d7f9c47caad41c1a3bd454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for advisor-scattering 1.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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