Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-48375: cpCombine should optionally erase all mask planes except NO_DATA #290

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

czwa
Copy link
Contributor

@czwa czwa commented Jan 17, 2025

No description provided.

@czwa czwa requested a review from erykoff January 17, 2025 00:21
@czwa czwa force-pushed the tickets/DM-48375 branch from e07f9b3 to 9d56c1a Compare January 17, 2025 00:25

self.interpolateNans(combined)
self.interpolateNans(combined, self.noGoodPixelsMask)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explicitly use the keyword here, maskPlane=self.noGoodPixelsMask?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and I've fixed the missing .config.

if np.any(bad):
median = np.median(array[np.logical_not(bad)])
medianVariance = np.median(variance[np.logical_not(bad)])
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be variance[~bad].

@@ -701,6 +738,9 @@ def calibStats(self, exp, calibrationType):
bad = ((ampImage.mask.array & noGoodPixelsBit) > 0)
key = f"LSST CALIB {calibrationType.upper()} {amp.getName()} BADPIX-NUM"
metadata[key] = bad.sum()
self.log.warn(f"Found {metadata[key]} pixels with "
f"mask plane {self.config.noGoodPixelsMask} "
f"for amp {amp.getName()}.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Two things. First, this must be self.log.warning() and not self.log.warn(). Second, this should only trigger if metadata[key] > 0 or else we'll get flooded with non-warnings.

@czwa czwa force-pushed the tickets/DM-48375 branch from ea3e11e to 4c26d09 Compare January 21, 2025 23:27
@erykoff
Copy link
Contributor

erykoff commented Jan 21, 2025

The code as it is looks good. I do wonder about tests, however.

@czwa czwa force-pushed the tickets/DM-48375 branch from ca3656c to 4b216b8 Compare January 23, 2025 22:56
@czwa czwa force-pushed the tickets/DM-48375 branch from 4b216b8 to b3fd2de Compare January 23, 2025 23:00
@czwa czwa merged commit c838ca2 into main Jan 24, 2025
2 checks passed
@czwa czwa deleted the tickets/DM-48375 branch January 24, 2025 21:36
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