-
Notifications
You must be signed in to change notification settings - Fork 33
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
Dynamic led window #1401
Dynamic led window #1401
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…dynamic_led_window
Hi @tflehmke Many thanks to this very low-level PR! I went through the two updated files and think they are mostly good. The only possible functional problem that I found is that:
I also have some other minor suggestions for naming/comments/changing hard-coded numbers to URLConfigs, please see the single comments for details. For the speed and memory I'm not really worried, as the calculation of dynamic windows is still O(N), and the size of the dynamic window is much smaller than the hits themselves. But it will still be great if you could provide me an example dataset so that I can test the performance. |
@@ -33,7 +37,7 @@ class LEDCalibration(strax.Plugin): | |||
from the signal one. | |||
""" | |||
|
|||
__version__ = "0.2.4" | |||
__version__ = "0.3.0" |
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 would suggest to go to 1.0.0
hit. :return (len(records), 2) array: Integration window for each record | ||
|
||
""" | ||
hits = strax.find_hits( |
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.
What is the lowest hit detectable? 15 ADC? Can this bias the result?
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 didn't know how to test the plugin in place in straxen earlier, so I copied the function and run it outside. However doing that I did not have access to the URL config resources. I tested it again in place and it turns out with the hard cutoff of 15 ADC I see a hard cut in the amplitude spectra at 15 ADC. I removed the hard cutoff and always use the hit_min_height_over_noise
which removes the hard cut in the spectra.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…dynamic_led_window
…dynamic_led_window
for more information, see https://pre-commit.ci
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 looks all good to me now. Thank you @tflehmke !
LED_hit_left_boundary, | ||
LED_hit_right_boundary, | ||
LED_window_width, |
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.
These arguments should be in principle in the snake case. But it is fine to keep things unchanged here to be compatible with the name of configs.
What does the code in this PR do / what does it improve?
This PR implements a dnyamic window for the LED pulse integration in the
afterpulse_processing
andled_calibration
plugins.Can you briefly describe how it works?
It uses the straxen hit finder to find the first hit inside a fixed, wider window in the record. In the afterpulse plugin, all hits around this hit inside the
LED_window_width
are then integrated to give the full LED hit. In led calibration plugin, the samples around the first hit given byled_hit_extension
are integrated and the maximum is taken from this area.Please include the following if applicable: