laue_index
The Python orchestration for LaueMatching, packaged as typed pipeline stages
around the C/CUDA indexer (REFACTOR_PLAN). Mirrors the in-repo laue_torch
conventions (curated __init__, single-responsibility modules, typed records)
but stays independent of the paper-tied packages (laue_torch / laue_jax
/ jax_cpfem) — shared pure math is duplicated with # TODO(unify-after-publish).
Install
pip install 'laue-index[run]' # everything the pipeline needs
pip install laue-index # library + the CPU indexer (numpy only)
LAUEMATCHING_CUDA=1 pip install laue-index # + the CUDA binaries (needs nvcc)
laue-index fetch-db --dest ~/laue # the 6.7 GB orientation database
export LAUEMATCHING_ORIENT_DB=~/laue/100MilOrients.bin
laue-index run process -c params.txt -i frame.h5 -n 8
The C indexer is compiled on your machine at install time (this is an sdist, not a wheel — a binary is tied to the toolkit and GPU architectures that built it). Without a C compiler and OpenMP the install still succeeds; only the binary is missing. The CUDA build is opt-in because a toolkit that cannot compile these sources fails at build time, which would take the working CPU binary down with it.
from laue_index import indexer
indexer.available() # is the CPU indexer usable?
indexer.available("GPU") # is LaueMatchingGPU usable?
indexer.binary_path("GPU") # where it came from
Set LAUEMATCHING_BIN to a binary — or to a directory holding them — to use one
you built elsewhere or downloaded from a
release. It
takes precedence over everything else, and the not-found error names every path
it tried.
Modules
| Module | Responsibility |
|---|---|
records.py |
Solution typed record + parse_solutions(source, fmt) + SolutionFormat column maps (runimage / stream) — replaces positional column "magic numbers". |
geometry.py |
Pure CSL/disorientation helpers (disorientation_deg_axis, is_csl_related, cubic ops, CSL table). |
filtering.py |
calculate_unique_spots, filter_orientations, filter_orientations_robust + OrientationFilter strategies (LegacyUniqueSpotFilter, RobustCSLAwareFilter). Single source of truth. |
thresholds.py |
ThresholdStrategy classes (NoiseFloorThreshold/adaptive, Percentile, Otsu, Fixed) + apply_threshold dispatch. |
preprocess.py |
Image pipeline (background → threshold → components → blur) + Preprocessor. |
indexer.py |
Thin wrapper around the C indexing binary (run_indexer). |
postprocess.py |
PostProcessor: unique-spots → sort → filter → spot-filter. |
output.py |
HDF5 result writer. |
config_schema.py |
One declarative SCHEMA table driving config parse + write. |
cli.py |
laue-index console entry: run (the whole image→index pipeline), fetch-db (the orientation database), parse (summarise a solutions table), filter (re-run post-processing on existing C output, no re-indexing), calibrate. |
pipeline/ |
The orchestrators themselves — RunImage, the streaming daemon driver and image server, the HKL/simulation generators. They import each other flat, so import them from one place: from laue_index.pipeline import add_to_path. |
Relationship to scripts/
The orchestrators used to live in the repo's scripts/ and are now in
pipeline/ here, so the package ships something that can actually run a frame.
scripts/ keeps a one-line shim per entry point — python scripts/RunImage.py …
and the shell pipeline behave exactly as before from a checkout.
laue_stream_utils remains a thin re-export of this package's stages, so
RunImage, laue_postprocess and laue_image_server are unchanged by any of it.
Testing
pytest (from the repo root) runs the unit suite — golden-anchored
characterization tests pin behaviour through the refactor. The full end-to-end
test (tests/test_char_e2e.py) is opt-in: set LAUE_E2E=1 with the orientation
DB, the built C binary, and a prebuilt forward cache present; otherwise it skips,
so CI is safe with SKIP_DOWNLOAD=1 (no 6.7 GB database needed for units).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file laue_index-0.4.0.tar.gz.
File metadata
- Download URL: laue_index-0.4.0.tar.gz
- Upload date:
- Size: 250.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20393aa013ec2787e5e9760f7b44b6a36ef1b5cf5d2c30d5decbff6294e335db
|
|
| MD5 |
ab2bccf161bcfc5789d95d97f534899d
|
|
| BLAKE2b-256 |
77cbe3761c742c54d93dc22af933ad4099ae371a720d7e1062cb5370aa768c15
|
Provenance
The following attestation bundles were made for laue_index-0.4.0.tar.gz:
Publisher:
python-packages.yml on AdvancedPhotonSource/LaueMatching
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
laue_index-0.4.0.tar.gz -
Subject digest:
20393aa013ec2787e5e9760f7b44b6a36ef1b5cf5d2c30d5decbff6294e335db - Sigstore transparency entry: 2687577537
- Sigstore integration time:
-
Permalink:
AdvancedPhotonSource/LaueMatching@334df009ff455f66d8bacda1720d0a040e74a2e8 -
Branch / Tag:
refs/tags/laue-index-v0.4.0 - Owner: https://github.com/AdvancedPhotonSource
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@334df009ff455f66d8bacda1720d0a040e74a2e8 -
Trigger Event:
push
-
Statement type: