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
fix negative drift time #82
fix negative drift time #82
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.
Small things just worth knowing
strax/xenon/plugins.py
Outdated
result = dict(n_peaks=len(peaks)) | ||
if not len(peaks): | ||
return result | ||
|
||
#identify largest s2 properties |
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.
Can replace with:
from collections import defaultdict
s2_info = defaultdict(None)
strax/xenon/plugins.py
Outdated
if 2 in peaks['type']: | ||
s_mask = peaks['type'] == 2 | ||
ss = peaks[s_mask] | ||
s2_values = ss['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.
Can combine with above liine
Thanks! Here is a suggestion which finds a different main S1 (which might work, I don't know :-) ):
Maybe at some time adding a max drift time option and another &= mask changing to avoid matching to S1s outside the max drift time would be useful |
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.
Thanks Boris! This will deal with the negative drift times.
@@ -485,6 +494,7 @@ def compute_loop(self, event, peaks): | |||
for q in 'xy': | |||
result[f'{q}_s2'] = s[q] | |||
|
|||
#bind the largest s1 to the largest s2 only for valid s1-s2 pairs |
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.
Ok, you mean: only compute the drift time if we identified a valid s1-s2 pair.
Simple main s1/s2 pairing: The main s1 (largest s1) have to be before main s2 (largest s2)