Python package and C binaries for Laue diffraction data analysis at beamline 34IDE, including indexing and wire scan reconstruction.
src/laueanalysis/
βββ indexing/
β βββ index.py # Functional indexing API
β βββ parsers.py # Output file parsers
β βββ xml_utils.py # XML generation utilities
β βββ xmlWriter.py # XML batch writer
β βββ mpi_runner.py # MPI distributed execution
β βββ lau_dataclasses/ # Data models (step, detector, pattern, etc.)
β βββ bin/ # Compiled C executables (euler, peaksearch, pix2qs)
β βββ src/ # C source trees
βββ reconstruct/
β βββ reconstruct.py # Reconstruction API (CPU + GPU)
β βββ bin/ # Compiled C executable (reconstructN_cpu)
β βββ source/ # C source code
βββ __init__.py
Prerequisites:
- Python >= 3.12
- System:
make,gcc,h5cc, GNU Scientific Library (GSL), HDF5 dev libraries - Linux only (conda packaging)
git clone https://github.com/AdvancedPhotonSource/laue-analysis.git
cd laue-analysis
python3 -m pip install .The build step compiles C binaries into indexing/bin/ and reconstruct/bin/.
from laueanalysis.indexing import index
result = index(
input_image='path/to/image.h5',
output_dir='path/to/output',
geo_file='path/to/geometry.xml',
crystal_file='path/to/crystal.xml',
)
print(result.n_peaks_found, result.n_indexed)The index() function runs the full pipeline (peak search, pixel-to-q conversion, indexing) and returns an IndexingResult with output files, statistics, and parsed data. See index.py for all available parameters.
from laueanalysis.reconstruct import reconstruct
result = reconstruct(...)See test files for detailed usage examples.
Indexing outputs are written under output_dir:
xml/ # Per-image indexed XML files
peaks/peaks_<name>.txt # Peak search results
p2q/p2q_<name>.txt # Pixel-to-Q space results
index/index_<name>.txt # Indexing results
error/ # Error logs
python -m pytest tests/ -v