Skip to content

Use error-limited ToF lookup table #96

Merged
jl-wynen merged 5 commits intomainfrom
error-limited-lookup-table
Mar 17, 2026
Merged

Use error-limited ToF lookup table #96
jl-wynen merged 5 commits intomainfrom
error-limited-lookup-table

Conversation

@jl-wynen
Copy link
Copy Markdown
Member

This uses the new error-limited lookup table. There is a complication from mapping over detectors, the default detector lut provider depends on the detector name. But the tof conversion happens after collecting the detector banks into a single data array. So the sciline map fails. We have two options here:

  1. Update the workflow to merge banks after converting to ToF. This might be cleaner long term. But it is a larger refactor and there are performance implications.
  2. Replace the default provider to not require a detector name parameter.

I went with 2 and hard-coded the name 'detector'. This threshold is applied to all banks. This is probably fine because the path lengths are all similar. But maybe we could tune this a little better with per bank thresholds.

Needed for new lookup table error masking.
@jl-wynen jl-wynen requested a review from nvaytet March 16, 2026 09:48
Comment on lines +96 to +97
" detector: EmptyDetector[RunType],\n",
" data: NeXusData[snx.NXdetector, RunType],\n",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird diff? (also in the rest of the file)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess ruff ran on the file automatically at some point. Should I revert?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need

Comment thread docs/user-guide/bifrost/bifrost-reduction.ipynb Outdated
"metadata": {},
"outputs": [],
"source": [
"workflow.visualize(TimeOfFlightLookupTable, graph_attr={\"rankdir\": \"LR\"})"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that these changes are fine, but the name TimeOfFlightLookupTable (which is now an alias) should still be available?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to keep both names indefinitely? I figured I'd change it now so that we have a simpler interface.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Note that the name will change again with scipp/ess#65 😞

Co-authored-by: Neil Vaytet <39047984+nvaytet@users.noreply.github.com>
@jl-wynen jl-wynen merged commit 8676040 into main Mar 17, 2026
4 checks passed
@jl-wynen jl-wynen deleted the error-limited-lookup-table branch March 17, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants