LEEDtal is a lightweight Python tool for simulating and analyzing Low Energy Electron Diffraction (LEED) patterns. It lets you load experimental LEED images, tweak contrast/brightness, and overlay simulated diffraction patterns derived from 2D reciprocal lattice calculations—including surface superstructures and reconstructions inspired by ViperLEED. Main motivation was to write something like ProLEED that would be natively supported on Linux. Vibe coding was used heavily, since I just needed quick tool while processing images. More will be may be added in the future, if you would have any ideas for improvement, just do a commit and I will review it.
Built with a dark Tkinter interface and matplotlib canvas, it utilizes canvas blitting and slider debouncing to keep the pattern overlay smooth and responsive during real-time adjustments.
- Supported Formats: PNG, JPEG, TIFF, BMP.
- Image Controls: Real-time adjustments for brightness, contrast, and gamma correction.
- Display Options: Invert colors and switch between colormaps (
gray,hot,viridis,inferno,magma,bone).
Includes 5 two-dimensional Bravais lattice geometries matching standard crystallographic constraints. Selecting a lattice shape automatically locks dependent parameters:
| Shape | Constraints | User-Editable Parameters |
|---|---|---|
| Oblique | None ( |
a, b, γ
|
| Rectangular |
a, b
|
|
| Square |
|
a |
| Rhombic |
|
a, γ
|
| Hexagonal |
|
a |
Locked parameters are greyed out in the interface and update automatically.
Define surface superstructures relative to the bulk substrate lattice using methods similar to ViperLEED:
-
Matrix Mode: Custom transformation matrix
$M$ ($2 \times 2$ ) where$a_s = M \cdot a_{\text{bulk}}$ . -
Wood's Notation:
$(m \times n) R\phi$ notation specifying scale factors and rotation angle$\phi$ . -
Presets: Includes common surface structures:
$1\times 1$ ,$2\times 1$ ,$1\times 2$ ,$2\times 2$ ,$3\times 1$ ,$3\times 3$ ,$c(2\times 2)$ ,$\sqrt{3}\times\sqrt{3},R30^\circ$ ,$\sqrt{7}\times\sqrt{7}$ ,$\text{Si}(111)\text{-}7\times 7$ , and Custom. -
Domains & Symmetry: Handles rotational domain generation based on substrate rotational symmetry (
Sym) and domain count (Domains). -
Spot Classification: Separate handling and visual styling for integer spots (bulk
$1\times 1$ ) and fractional spots (superstructure additions).
-
Beam Energy (
$E$ ): Sets electron energy in eV to determine the Ewald sphere radius ($k_0$ ). -
Reciprocal Cutoff: Filters spots satisfying
$|G_{hk}| \le k_0$ . - Pattern Rotation: Rotates the calculated pattern relative to the image frame.
-
Order Limit (
$h_{\text{max}}$ ): Sets maximum Miller index range ($1$ to$6$ ).
- Visual Separation: Toggle integer and fractional spots independently.
- Unit Cell Highlight: Option to render full lines for the bulk unit cell and dashed lines for the surface unit cell.
-
Labels: Optional
$(h,k)$ Miller index overlay for diffraction spots. -
Styling: Custom spot sizes, opacity (alpha), and independent color pickers for bulk vs. superstructure spots. Direct beam
$(0,0)$ is rendered as a prominent centered marker.
- Interactive Alignment: Click anywhere on the image canvas to re-center the pattern (direct beam position), or tune center coordinates via X/Y sliders.
- Pattern Scaling: Adjust scale slider to align simulated reciprocal space distances with detector pixel dimensions.
- Reset View: One-click reset for zoom, centering, and image enhancements.
For real-space 2D lattice basis vectors:
The unit cell area is
Reciprocal lattice vector for reflection
The electron wave vector magnitude
Only reflections meeting the condition
Ensure Python 3.8+ is installed. Install required packages via pip:
pip install numpy matplotlib pillow