Skip to content
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

Open
wants to merge 2 commits into
base: roi-histogram
Choose a base branch
from

Conversation

SimonHeybrock
Copy link
Member

@SimonHeybrock SimonHeybrock commented Feb 3, 2025

Fixes #305.

@jokasimr jokasimr self-assigned this Feb 5, 2025
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]
Copy link
Contributor

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=[],
Copy link
Contributor

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

Comment on lines +149 to +150
sc.scalar(value['low'], unit=value['unit']).to(unit='ns'),
sc.scalar(value['high'], unit=value['unit']).to(unit='ns'),
Copy link
Member

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'}
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

3 participants