Laue Simulator & Indexer — Help & Theory

Core Functionality

  1. Simulation: Define a lattice and detector to predict a Laue pattern (virtual goniometer + polychromatic beam).
  2. Indexing: Load a real image, pick peaks, and solve the unknown crystal orientation; then simulate and overlay spots for verification.
  3. Orientation: Calculate the goniometer angles required to geometrically align a specific (h,k,l) plane normal with the detector normal.

Two Orientations: how rotations are applied

Base Orientation (unknown): The sample’s as-mounted orientation found by the search. Selecting a solution sets this as the internal base matrix.

Goniometer Rotation (knobs): The X,Y,Z sliders in the Set tab. They rotate on top of the Base Orientation and also respond to canvas drag.

Total rotation used in simulation = Base then Goniometer (XYZ Euler). After you choose a solution, the sliders are reset to 0 so the display shows the solved orientation. Moving a slider then offsets from that base.

Typical workflow (indexing)

  1. Analysis → Load Image. If spots are white on black, check Invert Image. Toggle Show Spots to view overlays.
  2. 1. Set Center. Click the beam center. This enables Set Scale and shows a blue reference crosshair.
  3. Set Scale. Drag the blue crosshair to a known reference. Enter its U (mm), V (mm) from the center. (The app uses separate px/mm for U and V; V is inverted screen-to-mm.)
  4. Experimental Peaks. Use Find Peaks or Add Peak. Prefer 3–5 peaks of high symmetry far apart and across quadrants. You can refine (U, V) values directly in the list.
  5. Set. Choose Bravais type, enter lattice parameters, wavelength band. Set the Detector Angle (0°=transmission, 180°=back-scatter) and Distance (mm) exactly as in the experiment.
  6. Search Orientation. Wait for results; then open Solutions, click the best row (lowest Score, best Matches/RMS). The view updates with a yellow overlay.
  7. (Optional) Orient tab. Enter target (h,k,l) and click Calculate Goniometer Angles. The tool calculates the X/Y/Z sliders needed to geometrically align the (h,k,l) plane normal to be parallel with the detector normal (based on the current Detector Angle).
  8. Generate Report. Saves a PDF with parameters, peak table, best solution matches (assigned hkl), and a summary of all solutions.

UI reference (tabs)

Set

Analysis

Solutions

Orient

Mathematical model

1) Unit cell → reciprocal basis

Given cell a,b,c and angles α,β,γ, direct vectors are

// direct basis (Å)
a = (a, 0, 0)
b = (b cosγ, b sinγ, 0)
c = (c cosβ, c (cosα − cosβ cosγ)/sinγ, V/(a b sinγ))

V = a b c √(1 − cos²α − cos²β − cos²γ + 2 cosα cosβ cosγ)

Reciprocal basis vectors (Å⁻¹) are

a* = (b × c)/V ,  b* = (c × a)/V ,  c* = (a × b)/V

Any reflection (h,k,l) maps to g₀ = h a* + k b* + l c*.

2) Systematic absences (Bravais rules)

TypeCondition
Pall (h,k,l) allowed
Ih + k + l even
Fh, k, l all even or all odd
Ch + k even
R−h + k + l ≡ 0 (mod 3)

3) Orientation stacking

Reflections are rotated first by the Base Orientation U (from the solver), then by the goniometer Euler rotation R(X,Y,Z):

g = R(X,Y,Z) · U · g

4) Laue condition, wavelength band, and detector hit

Beam points along +X. With unit wavevectors k̂_in = (1,0,0) and k̂_out, define the (normalized) scattering vector ĝ = k̂_out − k̂_in. For a given lattice vector g (Å⁻¹), elastic diffraction requires

2 k_in · g + |g|² = 0 ,  with k_in = (1/λ, 0, 0)

Solving for the required wavenumber gives

k = − |g|² / (2 gₓ)

The diffracted ray is k_out = g + (k,0,0). The detector plane is defined by its angle φ (0° to 180°) and distance D.

// Detector plane normal and u-axis (horizontal)
n̂ = (cosφ, sinφ, 0)
û = (-sinφ, cosφ, 0)

The intersection P_hit is found by solving t for the ray P(t) = t · k_out and the plane P · n̂ = D.

v = P_hit_z   // Vertical coordinate is the Z component
u = P_hit · û   // Horizontal coordinate
(x₂d, y₂d) = (u, v) // These are the plotted (mm) coordinates

5) Experimental geometry → scattering vectors

From a measured spot at detector coordinates (u_mm, v_mm) relative to the center, we reconstruct the 3D scattering vector.

// φ is the detector angle, D is distance
n̂ = (cosφ, sinφ, 0)
û = (-sinφ, cosφ, 0)
v̂ = (0, 0, 1)

// Reconstruct 3D spot position from (u,v)
P_center = D · n̂
P_hit = P_center + (u_mm · û) + (v_mm · v̂)

k̂_out = normalize( P_hit )
ĝ_exp = normalize( k̂_out − (1,0,0) )  // used for orientation solving

6) Pixel ↔ millimeter conversion

After you click the beam center (pixels) and place a scale point with known (mm), the app sets independent scale factors for U and V:

pixels_per_mm_x = (x_px − x0_px) / U_mm
pixels_per_mm_y = −(y_px − y0_px) / V_mm   // minus because image Y is down

Orientation search (what “Search Orientation” does)

  1. Gather experimental peaks ...
  2. Build HKL library ...
  3. Angle pairing: ...
  4. Candidate orientation: ...
  5. Score it: ...
  6. Keep top-N ...

Note on high-index reflections: The search uses two different (h,k,l) ranges.

This means a high-index experimental spot (like a (3,1,0)) will not help seed the search, but it will be correctly identified and used to confirm and score a good solution. The search only requires at least one pair of your experimental spots to fall within the small "seeding" range.

This strategy is robust to small peak sets and naturally yields symmetry-related orientations (e.g., cubic equivalences).

Peak finder details

Report contents

  1. Detector snapshot with overlays.
  2. Simulation + analysis parameters (lattice, λ band, D, Angle, center/scale).
  3. Experimental peak list in (U, V) mm (+ raw pixels).
  4. Best solution details: each peak’s assigned (h,k,l), simulated (U, V) and error (mm).
  5. All solutions summary.

Troubleshooting

No or poor solutions

A spot doesn't appear after “Orient to (h,k,l)”

Conventions & hints