-
Notifications
You must be signed in to change notification settings - Fork 12
DM-55282: Add nCrSpanMax configuration to cosmic ray finder for early failure. #480
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -331,6 +331,7 @@ std::vector<std::shared_ptr<afw::detection::Footprint>> findCosmicRays( | |
| int const niteration = ps.getAsInt("niteration"); // Number of times to look for contaminated | ||
| // pixels near CRs | ||
| int const nCrPixelMax = ps.getAsInt("nCrPixelMax"); // maximum number of contaminated pixels | ||
| int const nCrSpanMax = ps.getAsInt("nCrSpanMax"); // maximum number of contaminated spans | ||
| /* | ||
| * thresholds for 3rd condition | ||
| * | ||
|
|
@@ -495,6 +496,14 @@ std::vector<std::shared_ptr<afw::detection::Footprint>> findCosmicRays( | |
| } | ||
| } | ||
|
|
||
| /* | ||
| * Check if number of spans is above threshold to fail fast | ||
| */ | ||
| if (spans.size() > nCrSpanMax) { | ||
| throw LSST_EXCEPT(pex::exceptions::LengthError, | ||
| (boost::format("Too many CR spans (max %d)") % nCrSpanMax).str()); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I take it the at line ~410 doesn't trigger often enough. I don't fully follow the code logic here, but if that initial pass is certain to detect a smaller number than the final one, is it worth considering giving it a smaller threshold for "failing fast"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh wow, I didn't notice that ... this ticket might not be necessary ... in this case that is coming up with 472,977 pixels (first pass) and then later that is much larger. Maybe we just need to override the max pixels to something less insane than 1,000,000. I mean ... if we ever have 100,000 CR pixels that says something has gone terribly wrong. |
||
|
|
||
| /* | ||
| * Resolve aliases; first alias chains, then the IDs in the spans | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the
_, but consistency with above... 🫠