Skip to content

Conversation

@mguthriem
Copy link
Collaborator

Description of work

This is a very primitive implementation of prototype swiss cheese mask. External to SNAPRed, I have machinery to make the swiss cheese masks and to save these to a mantid BinMaskTableWorkspace with the names:

maskBins_{units}

Where units are recognised mantid units such as dSpacing, Wavelength, TOF

I then modified SNAPRed to check if any of these are present in the ADS and, if it finds these, apply them by looping through all bin_mask ws it finds, then

  1. converting units to match those of the maskBins ws
  2. running MaskBinsFromTable

finally, it converts units back to TOF.

Explanation of work

This is obviously not the best way to handle the operation.

I would like to make a list of BinMaskTableWorkspaces a reduction ingredient identical to pixel masks. I'd then like these to be saved the same as pixel masks.

Any advice on how to go about this appreciated!

(the machinery to make the mask can stay outside of SNAPRed and live in SNAPBlue)

To test

Dev testing

CIS testing

# replace with your test script below

Link to EWM item

EWM#<ticket_number>

Verification

  • the author has read the EWM story and acceptance critera
  • the reviewer has read the EWM story and acceptance criteria
  • the reviewer certifies the acceptance criteria below reflect the criteria in EWM

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.

  • acceptance criterion 1
  • acceptance criterion 2

@mguthriem
Copy link
Collaborator Author

Addi suggested I create a PR for this protoype work. I don't think this is suitable for merging, but maybe this is a good way to keep tabs on my prototyping?

@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.21%. Comparing base (9e969c8) to head (9f1b3d7).

Files with missing lines Patch % Lines
...napred/backend/recipe/PreprocessReductionRecipe.py 64.70% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next     #579      +/-   ##
==========================================
+ Coverage   95.93%   96.21%   +0.27%     
==========================================
  Files          71       71              
  Lines        5660     5677      +17     
==========================================
+ Hits         5430     5462      +32     
+ Misses        230      215      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +42 to +45
self.binMasks = []
for ws in mtd.getObjectNames():
if "maskBins_" in ws:
self.binMasks.append(ws)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of inspecting the ads for a name schema we would instead want to append this to the pixelMask list on the ReductionRequest so it may be picked up by the prepCombinedMask method in ReductionService

To accomplish this you will need to:

  1. Create a new WorkspaceNameGenerator name for the swisscheese mask: A. Add another template to the application.yml B. Add another workspace type to the enum C. Add another method to the WNG itself following the naming pattern
  2. Add a new case to the prepCombinedMask method for the new workspace type you added in the previous step, probably in the same fashion as this case
  3. When you submit your reduction request, use the wng to generate the name and add it to pixelMask list on the ReductionRequest

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.

3 participants