Skip to content

Conversation

@isullivan
Copy link
Contributor

The preliminary_mask is written by calibrateImage and persisted as a separate dataset so that the full preliminary_visit_image does not need to be saved until step 4 of DRP processing.

if mp not in exposure.mask.getMaskPlaneDict().keys():
exposure.mask.addMaskPlane(mp)
bitMask = mask.getPlaneBitMask(mp)
exposure.mask.array |= ((mask.array & bitMask) > 0) * bitMask
Copy link
Member

Choose a reason for hiding this comment

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

You can transfer all of the mask planes at once:

bitMask = mask.getPlaneBitMask(self.config.copyMaskPlanes)
exposure.mask.array |= mask.array & bitMask

I don't think you need the loop to add mask planes, either; just reading the new mask will add them to the global plane dict if they weren't there already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this to remove part of the loop, and added a unit test to verify the behavior.

@isullivan isullivan merged commit e82cbf9 into main Oct 29, 2025
10 checks passed
@isullivan isullivan deleted the tickets/DM-53063 branch October 29, 2025 05:19
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