How loicpoisson/slac-xrf-project works
This research pipeline turns coarse XRF scans into adaptive fine-scan plans, deciding both where to scan and how long to dwell, with iterative multi-resolution acquisition as its production workflow. Offline scripts validate spatial, temporal, combined, and cascade strategies against fine-scan ground truth; profiling and recommendation provide supporting analysis. The graph preserves the README’s major capabilities. Some script internals were not sampled, so their documented roles are shown without asserting unverified call paths.
Main entry points: 10_run_pipeline.py Iterative scan planner · validation_utils.py Grid and scan metrics · cascade.py Refinement cascade · roi_utils.py ROI and mask tools
Components 24
Planning Workflow
- Iterative scan planner
scripts/10_run_pipeline.py - Adaptive scan plan
outputs
Adaptive Methods
- Spatial ROI detection
scripts/01_roi_detection.py - ROI trajectory
scripts/02_trajectory.py - Morphological mask
scripts/04_validate_morphological.py - Adaptive dwell
scripts/07_validate_temporal.py - Combined strategy
scripts/08_validate_combined.py - Strategy recommender
scripts/09_recommend_strategy.py - Refinement cascade
scripts/utils/cascade.py
Validation and Analysis
- ROI validation
scripts/03_validate_roi.py - Cascade validation
scripts/05_validate_hierarchical.py - Pareto strategy sweep
scripts/06_pareto_sweep.py - Combined validation
scripts/08_validate_combined.py - Sample profiler
scripts/11_profile_samples.py - Report figures
scripts/12_report_figures.py
Shared Runtime
- ROI and mask tools
scripts/utils/roi_utils.py - SSRL HDF5 reader
scripts/utils/hdf5_reader.py - Dwell allocator
scripts/utils/dwell.py - Poisson quality metrics
scripts/utils/quality.py - Grid and scan metrics
scripts/utils/validation_utils.py - Data path discovery
scripts/utils/paths.py - Shared input arguments
scripts/utils/cli.py - Figure output
scripts/utils/plotting.py
Other components
- Beamline user
Connections 33
- Beamline user → Iterative scan planner: runs
README.md - Iterative scan planner → SSRL HDF5 reader: loads scans
scripts/10_run_pipeline.py - Iterative scan planner → Strategy recommender: selects strategy
scripts/10_run_pipeline.py - Iterative scan planner → Dwell allocator: allocates dwell
scripts/10_run_pipeline.py - Iterative scan planner → Refinement cascade: refines levels
scripts/10_run_pipeline.py - Iterative scan planner → ROI and mask tools: builds regions
scripts/10_run_pipeline.py - Iterative scan planner → Grid and scan metrics: projects grids
scripts/10_run_pipeline.py - Iterative scan planner → Poisson quality metrics: scores quality
scripts/10_run_pipeline.py - Iterative scan planner → Figure output: saves figure
scripts/10_run_pipeline.py - Iterative scan planner → Adaptive scan plan: writes plan
README.md - Iterative scan planner → Data path discovery: discovers scans
scripts/10_run_pipeline.py - Spatial ROI detection → SSRL HDF5 reader: loads scan
scripts/01_roi_detection.py - Spatial ROI detection → ROI and mask tools: detects regions
scripts/01_roi_detection.py - ROI trajectory → SSRL HDF5 reader: loads scan
scripts/02_trajectory.py - ROI trajectory → ROI and mask tools: groups regions
scripts/02_trajectory.py - Morphological mask → Grid and scan metrics: validates mask
scripts/04_validate_morphological.py - Adaptive dwell → Dwell allocator: allocates dwell
scripts/07_validate_temporal.py - Adaptive dwell → Poisson quality metrics: measures MSE
scripts/07_validate_temporal.py - Combined strategy → Dwell allocator: allocates dwell
scripts/08_validate_combined.py - Combined strategy → Grid and scan metrics: projects mask
scripts/08_validate_combined.py - Strategy recommender → Refinement cascade: discovers levels
scripts/09_recommend_strategy.py - Strategy recommender → Data path discovery: finds scans
scripts/09_recommend_strategy.py - Refinement cascade → ROI and mask tools: detects footprint
scripts/utils/cascade.py - Refinement cascade → Grid and scan metrics: projects mask
scripts/utils/cascade.py - ROI validation → SSRL HDF5 reader: loads scans
scripts/03_validate_roi.py - ROI validation → ROI and mask tools: detects ROIs
scripts/03_validate_roi.py - Cascade validation → Refinement cascade: validates cascade
scripts/05_validate_hierarchical.py - Pareto strategy sweep → Grid and scan metrics: compares methods
scripts/06_pareto_sweep.py - Combined validation → Combined strategy: runs comparison
README.md - Sample profiler → Strategy recommender: profiles samples
scripts/11_profile_samples.py - Report figures → Poisson quality metrics: plots metrics
scripts/12_report_figures.py - Report figures → Grid and scan metrics: plots validation
scripts/12_report_figures.py - Shared input arguments → Data path discovery: finds defaults
scripts/utils/cli.py