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-30170: Define crosstalk tests for cp_verify #127
Conversation
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.
Modulo my comments, the code looks fine. I did not look into the math in detail, if I'm supposed to do that please let me know.
pipelines/measureCrosstalk.yaml
Outdated
@@ -26,8 +26,16 @@ tasks: | |||
config: | |||
connections.inputExp: 'cpCrosstalkProc' | |||
connections.outputRatios: 'cpCrosstalkRatio' | |||
threshold: 30000 | |||
ignoreSaturatedPixels: false |
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 redundant with the default set in the task?
ordering : `list` [`str`] | ||
List to use as a mapping between amplifier names (the | ||
elements of the list) and their position in the output | ||
calibration (the matching index of the list). |
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 may be None, I guess? If so, please say that's okay and what happens if it is None.
for ii, jj in itertools.product(range(calib.nAmp), range(calib.nAmp)): | ||
if ii == jj: | ||
values = [0.0] | ||
else: | ||
values = np.array(ratios[ordering[ii]][ordering[jj]]) | ||
values = values[np.abs(values) < 1.0] # Discard unreasonable values | ||
|
||
calib.coeffNum[ii][jj] = len(values) | ||
# Sigma clip. |
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 is sigma clipping from the IQR, I guess? Make a note of this, please.
if len(values) == 0: | ||
break | ||
lo, med, hi = np.percentile(values, [25.0, 50.0, 75.0]) | ||
sigma = 0.741*(hi - lo) |
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.
Make a note of this is sigma from the IQR, with 0.741 assuming a normal distribution.
Add options for validation/rejection. Ensure amplifier ordering is correct.