Closed tflehmke closed 2 months ago
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:
led_calibration.py
, hits
are calculated by the find_hits
function in strax
, which are not sorted yet (in the afterpulse plugin they are sorted). If we want to only keep the first hit by time, we need to add the sorting here.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.
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: