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.
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-37357: Update masking in parallel overscan #248
DM-37357: Update masking in parallel overscan #248
Changes from 5 commits
d71a103
a8d7e00
5130394
49e1524
d42f90b
f35e4e7
1f79ae5
fdcfb4a
0f27932
bd1b6da
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is this a config that will be per camera, per detector, or per amp? I know we don't currently support running with different isr configs, but I'm curious about this one.
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.
It probably needs to be something that the per-amp overscan config will need to include, but I think it's the same per device (with possible exceptions https://lsstc.slack.com/archives/CBV7K0DK6/p1674082048054619 suggests some amplifiers may allow bleeds at lower flux levels).
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.
This phrasing took me a while to parse. Maybe something like "Masks created from saturated bleeds should be grown
parallelOverscaneMaskGrowSize
pixels during construction of the parallel overscan mask."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.
You say "constant offset" but that's constant per what unit of area?
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'm very confused about the reference to
collapseArray
here because I don't see how it's called in the parallel overscan code.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.
It's calculated from the double-overscan corner, subtracting one value per row. All rows should be the same within the read noise, as there's no real signal. For the images I've been testing, the serial overscan median value is ~13000-15000, and subtracting it pulls the parallel overscan region down so that the parallel overscan median value is ~10-20.
The overscan code is far more confusing than I'd like (definitely my fault). The parallel overscan uses the same code path as the serial, just with some extra transposes.
correctOverscan
callsfitOverscan
, which calls eithermeasureConstantOverscan
ormeasureVectorOverscan
. Continuing with the vector case, that method callscollapseArray
for all exceptMEDIAN_PER_ROW
, which instead callsfitOverscanImage
(the C++ code), then thefillMaskedPixels
method that is also called bycollapseArray
. I'm not happy with the code-spaghetti I've made.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 can't comment there, but
correctOverscan
doesn't have a docstring.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.
Where does this 2.0 come from and should it be configurable?
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.
It can take almost any value and do a similar thing. It was added for the case below:
With these values, the "bleed" column rejects nothing, as all pixels are within 3 sigma, so some sigma clipping of the STDEV values is required. I chose 2.0 because in all the plots I looked at, the real STDEV values were tightly clustered about the median, so the penalty for over clipping makes little difference to the masking step.
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 don't understand "This updates the masked_array to clear the mask for the pixels filled."
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.
"The mask is removed for the pixels filled."