-
Notifications
You must be signed in to change notification settings - Fork 270
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
Refactoring of GainSelector #1093
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1093 +/- ##
==========================================
- Coverage 84.35% 84.29% -0.07%
==========================================
Files 182 182
Lines 11056 11006 -50
==========================================
- Hits 9326 9277 -49
+ Misses 1730 1729 -1
Continue to review full report at Codecov.
|
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.
Looks good to me, only one question but only for curiosity.
return waveforms[0] | ||
else: | ||
pixel_channel = self.select_channel(waveforms) | ||
return waveforms[pixel_channel, np.arange(n_pixels)] |
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.
Just a question, why not just 'return waveforms[pixel_channel, :]?
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.
Unfortunately is isn't as simple to index the array like that. waveforms[pixel_channel, :]
returns an array of shape (n_pix, n_pix, n_samples).
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.
(When pixel_channel is an array of n_pix itself)
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.
Ah ok
I just remembered that it's also necessary to keep the mask of which channel was used as well as the gain-selected waveform. Perhaps that could be done in another PR. |
+1 @watsonjj Are you working on a fixing PR right now? |
This PR is for the refactoring and discussion of the existing (but mostly unused) GainSelector classes.
My next PR will be dedicated to the integration of this class in the calibration chain.
I have simplified the GainSelector class in a similar way as was recently performed for the ImageExtractor class in design. It acts as a low-level class which operates on the waveforms numpy array.
This PR picks up from #683, and includes the suggestion from #818. Other related issues include: #419, #962 and #822.