-
Notifications
You must be signed in to change notification settings - Fork 1
Use a dedicated workflow to compute tof LUT #253
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
Conversation
… for main workflow
src/ess/reduce/time_of_flight/lut.py
Outdated
| ) | ||
|
|
||
|
|
||
| def TofLutWorkflow(): |
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.
Any suggestions for a better name are welcome 😄
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.
You could spell it out. E.g., TofLookupTableWorkflow or even TimeOfFlightLookupTableWorkflow. But I think the former is good enough. People typically know what 'tof' means but not 'lut'. Also, we spell out LookupTable elsewhere.
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'm also thinking of renaming TimeOfFlightLookupTable to TofLookupTable, as part of the naming standardization and freeze (e.g. https://github.com/scipp/ess-project/issues/38).
docs/user-guide/tof/dream.ipynb
Outdated
| "We can see from the workflow diagram that we are still missing the simulated neutrons that are used to build the lookup table.\n", | ||
| "By default, the workflow tries to load a `TimeOfFlightLookupTable` from a file.\n", | ||
| "\n", | ||
| "In this notebook, instead of using such a pre-prepare file,\n", |
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.
| "In this notebook, instead of using such a pre-prepare file,\n", | |
| "In this notebook, instead of using such a pre-prepared file,\n", |
Or better 'pre-made' to have less repitition.
docs/user-guide/tof/dream.ipynb
Outdated
| "source": [ | ||
| "### Building the time-of-flight lookup table\n", | ||
| "\n", | ||
| "We use the `tof` module to propagate a pulse of neutrons through the chopper system to the detectors,\n", |
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.
Please link to tof here.
src/ess/reduce/time_of_flight/lut.py
Outdated
| ) | ||
|
|
||
|
|
||
| def TofLutWorkflow(): |
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.
You could spell it out. E.g., TofLookupTableWorkflow or even TimeOfFlightLookupTableWorkflow. But I think the former is good enough. People typically know what 'tof' means but not 'lut'. Also, we spell out LookupTable elsewhere.
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.
Did you change any functions here or did you only move code into this file?
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 moved code.
This is an alternative to #251 .
Instead of having one tof LUT per
RunType, we have a single LUT, which is loaded from file.This will be the main mode of operation for production workflows.
If one wishes to compute the LUT on-the-fly, using
tof, we now have to use a separate workflow that is designed to do just this. TheTofLutWorkflowis used to computeTimeOfFlightLookupTable, and the result of this is then set on theGenericTofWorkflow, bypassing the provider that loads the table from file.I don't think that having different LUT for different runs is a good idea in practice (@jokasimr pointed out that different chopper settings would change the distribution of neutrons, which would make different measurements incompatible in most cases).
If it turns out we do need this in the future, we could always add a wrapper provider that turns
TimeOfFlightLookupTableintoTimeOfFlightLookupTable[RunType].Inserting a custom LUT for a single run can then still be done via