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.
Description of work
This change addresses a scenario where a pixel group in a given reduction process can become entirely masked out. When all pixels in a group are excluded, the data arrays for that group are effectively empty. Downstream algorithms (notably,
SmoothDataExcludingPeaks
) currently assume that some data are always present, and fail when attempting to process an empty dataset. The modifications introduced here ensure that the workflow can detect when a pixel group is fully masked, skip any further data processing for that group, and provide a clear warning message to the user.Explanation of work
The code replaces
_isGroupFullyMasked()
checks with_checkMaskedPixels()
, which takes a more semantic approach. Instead of iterating through raw pixel data,_checkMaskedPixels()
:groupingWorkspace
name to determine the corresponding "focus group."pixelGroup
object associated with that focus group.pixelGroupingParameters
of thepixelGroup
to determine if any subgroups are fully masked.If a subgroup is found to be fully masked, a warning is logged and the method instructs the calling code to skip further processing. If the entire group is masked, a similar warning is provided.
To test
Dev testing
diffraction calibration
run number
: 58882convergence threshold
: 0.1bins across peak width
: 10sample
: Silicon_NIST_640D_001grouping
: Columnnormalization:
run number
: 58882background run number
: 58810sample
: Silicon_NIST_640D_001grouping
: Columndiffcal_masking_script.py
within mantid workbench to produce a masking workspace where all pixels are masked.Following this, use these masks in two separate test runs of Reduction within SNAPRed to see how these cases are handled.
CIS testing
Same as above.
Link to EWM item
EWM # 7922
Verification
Acceptance Criteria
This list is for ease of reference, and does not replace reading the EWM story as part of the review. Verify this list matches the EWM story before reviewing.