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
Add some basic cuts #84
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.
Looks good, thanks!
It would be good to factor out a basic cut base class and use that for these example cuts, but we can do that after this is merged.
dtype = [('cut_s1_low_energy_range', np.bool, "Event under 200pe")] | ||
|
||
def compute(self, events): | ||
ret = np.all([events['cs1'] < 200], axis=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.
Why do you need np.all here? I'm not sure what happens now, sounds like you're computing one boolean per chunk. I would have thought you'd just do ret = events['cs1'] < 200
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, I see, the extra []'s make a new axis, and you're all-ing over that axis which has one element here (so it's not needed here), but above you use it as a way of combining event selections.
OK, I usually use the & sign for this, e.g. (cs1 > 70) & (r < 20) % ... .
Just ignore Codacy's comments: it doesn't seem to understand the flexible signature of the compute method. |
(should hit refresh before commenting) |
This is an attempt to add a few basic cuts to strax. Cuts added are the 1.3T FV cylinder, S1MaxPMT, and S1 low energy. They should be direct ports from lax/sciencerun0.
This also adds the max pmt value to peak_basics, previously only the max pmt index had been stored per peak.
(all the changes are within strax/xenon)