Xunyang Hong

X-ray geometry,
made visible.

A Python desktop app that connects a crystal structure to the angles and reciprocal-space coordinates of an X-ray experiment.

Plan a measurement, check the geometry and explore calculated reflections in one visual workspace.

  • Python
  • PyQt5
  • NumPy / SciPy
  • Matplotlib
From crystal setup to reciprocal-space exploration1 min · silent demo
Read the walkthrough

The recording loads a crystal file, previews the structure and sample orientation, opens the scattering-geometry tools, then calculates structure factors and explores different reciprocal-space planes.

From crystal to measurement.

Each clip shows a working part of the app. Play, pause or expand it to inspect the interface.

Start with your crystal.

Drop in a CIF—a standard crystal-structure file—or enter lattice parameters manually. Set the beam energy and sample orientation, with a visual preview of the crystal.

One setup supplies the experiment parameters to the feature tabs.

Import a crystal file and preview the setup26 sec · silent demo

Connect angles to the measurement.

Convert instrument angles into HKL coordinates, or work backwards from a target HKL to scattering angles. The geometry view makes the beam and sample orientation visible.

Fixed-angle tools also support planning a sequence of measurement positions.

What does HKL mean?

H, K and L describe the momentum transfer in coordinates tied to the crystal lattice. They connect the instrument geometry to the location being probed in reciprocal space.

Edit angles and inspect the corresponding HKL and geometry14 sec · silent demo

Explore the diffraction landscape.

Calculate structure factors from the crystal model. Explore reflections in 3D and inspect 2D slices, including planes defined by your own directions.

See how calculated reflection amplitudes vary across reciprocal space.

What is a structure factor?

It combines the scattering contributions of the atoms in a unit cell, including their relative phases. The app visualizes its amplitude, |F|; measured intensity also depends on experimental factors.

Explore a 3D reflection map and its 2D slices14 sec · silent demo

A research tool, built for accelerating your X-ray experiments

Calculations independent of the UI

Geometry and conversion logic live in Python modules without Qt imports, making the numerical code easier to test and reuse.

Shared experiment context

Controllers pass crystal and beam parameters to feature tabs, keeping the setup connected across different tools.

Room for new features

Each feature has its own calculator, controller and view, alongside reusable widgets and visualizers.

Scientific libraries: NumPy, SciPy, Matplotlib and Dans_Diffraction. Desktop interface: PyQt5.

Try ADVISOR.

Install the Python package, launch the app and load your crystal structure.

In your Python environment

python -m pip install advisor-scattering
advisor-scattering