-
Notifications
You must be signed in to change notification settings - Fork 1
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 support for selecting a TOA range in detector plots #304
base: roi-histogram
Are you sure you want to change the base?
Conversation
if (toa_range := self._toa_range()) is None: | ||
return data | ||
low, high = toa_range | ||
return data.bins.assign_coords(toa=data.bins.data).bins['toa', low:high] |
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 need some explanation here 😄
- What is
data
? (What shape shape and what fields is it expected to have?) - Why do we need to assign coords?
- Why is
toa=data.bins.data
?
options=[ | ||
{'label': 'Filter by time-of-arrival [μs]', 'value': 'enabled'} | ||
], | ||
value=[], |
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.
(minor) checklist is slightly odd for what seems to be a "toggle" on/off, maybe consider https://dash.plotly.com/dash-daq/booleanswitch
sc.scalar(value['low'], unit=value['unit']).to(unit='ns'), | ||
sc.scalar(value['high'], unit=value['unit']).to(unit='ns'), |
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.
Will the unit always be 'ns', or should we instead just store floats and use the units of data.bins.coords['toa']
in apply_toa_range
below?
dcc.Checklist( | ||
id='toa-checkbox', | ||
options=[ | ||
{'label': 'Filter by time-of-arrival [μs]', 'value': 'enabled'} |
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 seems it's microseconds here and nanoseconds above?
Fixes #305.