Repository navigation
pipeline work - #109
Merged
Merged
pipeline work#109
Conversation
There was a problem hiding this comment.
🟡 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.