Skip to content

pipeline work - #109

Merged
JGoodrichBNL merged 1 commit into
mainfrom
unify_pipelines
Oct 12, 2026
Merged

JGoodrichBNL merged 1 commit into
mainfrom
unify_pipelines

Conversation

@JGoodrichBNL

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 18:30
@JGoodrichBNL
JGoodrichBNL merged commit 330cb93 into main Oct 12, 2026
23 of 25 checks passed
@JGoodrichBNL
JGoodrichBNL deleted the unify_pipelines branch October 12, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The ROI generator has multiple execution-blocking defects, and WAXS percentile calculations incorrectly include masked pixels.

3 open findings
What changed in this PR

Adds geometry support, validation, tests, and coordinate guidance for the unified XPCS pipeline.

Changes:

  • Adds geometry, ROI, mask, and plotting helpers.
  • Adds synthetic pipeline tests across four scattering modes.
  • Adds mask/ROI utilities and coordinate documentation.
File Description
pyCHX/​tests/​test_xpcs_pipeline_geometry.py Tests geometry modes and pipeline outputs.
pyCHX/​_xpcs_pipeline_geometry.py Implements geometry and ROI helpers.
pipelines/​masking_and_rois/​Detector_Masks_Add_Pixels.ipynb Adds detector-mask editing workflow.
pipelines/​masking_and_rois/​Auto_ROI_Mask_Generator.ipynb Adds automatic ROI generation workflow.
pipelines/​COORDINATE_CONVENTIONS.md Documents detector coordinate conventions.
pipelines/​beam_center_position_issue.md Documents beam-center offsets.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +193 to +199
"try:\n",
" if mask_param_dict[mask_selection]['ang_centers']==None and mask_param_dict[mask_selection]['ang_width']==None and mask_param_dict[mask_selection]['inner_angle']==None and mask_param_dict[mask_selection]['outer_angle']==None and mask_param_dict[mask_selection]['num_angles']==None:\n",
" geometry='saxs'\n",
" roi_mask0, good_ind = combine_two_roi_mask( roi_mask0, np.ones(np.shape(roi_mask0),dtype=int),pixel_num_thres=pixel_num_thres) \n",
"except:\n",
" geometry='ang_saxs'\n",
" \n",
valid = np.asarray(mask, dtype=bool) & np.isfinite(smoothed)
if not valid.any():
raise ValueError("No valid WAXS pixels")
values = smoothed[np.isfinite(smoothed)]

The same conversion appears in the SAXS mask and ROI notebooks. It can shift beam masks, ROIs, and calibrated q maps. Separately, the unified pipeline writes SAXS result metadata with `beam_center_x` and `beam_center_y` swapped.

**Check before changing historical results:** compare a direct-beam pixel in a raw frame, its BeamX/BeamY values, and its location in the oriented analysis image for each detector. The automatic finder is zero-based; manually entered centers may have a different convention. See [coordinate conventions](pipelines/COORDINATE_CONVENTIONS.md) for the full trace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants