-
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
Acqmon Deadtime Plugin #207
Conversation
CodeFator issue just fixed by adding few more lines at the end the acqmon_processing here: c1b9731 |
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 don't know if the dtype works
I've made some modifications to the acqmon plugin.
Example of a result from this plugin.
|
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.
Hi Alex. Hereby some requests for changes.
I've looked at your PR and it generally looks good. Also the tests and output look intuitive https://github.com/XENONnT/analysiscode/blob/master/StraxTests/AqMon.ipynb.
I'll fix the failing travis in a bit. That is actually my fault rather than yours.
Hi, @WenzDaniel can you please review the recent updates and approve the PR. I think I've addressed all the requests/concerns that were raised thus far. |
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.
Hey Alex, I am sorry, but in case I am not still half asleep due to XXXX, I think your code is not working as you would expect. Could you please address my comments and ensure with your example notebook that it is really working as intended?
@jorana @WenzDaniel
Tested with few runs, veto intervals seem to be correct. Simple test notebok can be found here: |
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.
Only two minor comments. The rest looks fine. Thanks a lot.
Alright, more updates based on the input, with the 2 main ones being:
Plugin was tested with the same notebook as before, seems to work. |
straxen/plugins/acqmon_processing.py
Outdated
res_temp.setdefault("veto_interval",[]).extend((vetos['endtime'] - vetos['time'])) | ||
res_temp.setdefault("veto_type",[]).extend([veto + 'veto']*len(vetos)) | ||
|
||
res = strax.dict_to_rec(res_temp) |
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.
There seems to be an error with empty dicts:
x = {}, dtype = None
@export
def dict_to_rec(x, dtype=None):
"""Convert dictionary {field_name: array} to record array
Optionally, provide dtype
"""
if isinstance(x, np.ndarray):
return x
if dtype is None:
if not len(x):
> raise ValueError("Cannot infer dtype from empty dict")
E ValueError: Cannot infer dtype from empty dict
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.
res = strax.dict_to_rec(res_temp, dtype = self.dtype)
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.
Yes, sorry forgot to copy the line
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, yeah it's the trivial solution to fix Travis. Alex I just added it in d92de8c. I believe the review has been quite thorough so let's merge it! Would love to have this shown on the website.
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.
@WenzDaniel @jorana Cheers guys :)
What is the problem / what does the code in this PR do
Calculating deadtimes for busy/veto monitor such that we can use them later for NODIAQ busy monitoring
Can you briefly describe how it works?
Looks for start and end times of veto signals and finds the intervals in between them
Can you give a minimal working example (or illustrate with a figure)?
![sample_pic](https://user-images.githubusercontent.com/28751746/92136136-f626a480-ee0b-11ea-8ed0-534b561f335e.png)
Seems to find the correct deadtime intervals.
Additional info: I have another plugin that uses the new "veto_intervals" to calculate cumulative deadtimes and put it into a collection on mongo. However, we need to decide in which collection it should go and which fields we want. @darrylmasson
Test notebook can be found here: https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:xenon1t:alexelykov:am_veto_interval_notebook