Skip to main content

Module diffraction_pattern

Module diffraction_pattern 

Source
Expand description

2-D diffraction pattern (FFT of a projected density image).

Mirrors freud.diffraction.DiffractionPattern (source).

Builds a 2-D Gaussian-smeared image of the projected particle positions, takes a 2-D FFT (composed from rustfft’s 1-D plans), and returns the power spectrum |F(k)|². Projection axis defaults to +z, mapping particles onto the xy plane.

This is the first analyzer in the port to use rustfft 6 for real 2-D Fourier work; the FFT planner is built once per frame and reused for both row and column passes.

§Conventions

  • The output image is FFT-shifted so that k = 0 sits at the centre (n_grid / 2, n_grid / 2), matching freud (and the usual numpy.fft.fftshift convention).
  • Square grid (n_grid × n_grid); rectangular grids are a follow-up.
  • Orthorhombic boxes only (matches freud.DiffractionPattern.compute).

Structs§

DiffractionPattern
DiffractionPattern analyzer.
DiffractionPatternResult
Per-frame diffraction-pattern result.