-
Notifications
You must be signed in to change notification settings - Fork 1
Full beamline time-of-flight lookup table #308
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
base: main
Are you sure you want to change the base?
Conversation
| lut_wf[time_of_flight.NumberOfSimulatedNeutrons] = 10_000 | ||
| lut_wf[time_of_flight.LtotalRange] = ( | ||
| sc.scalar(0.0, unit="m"), | ||
| sc.scalar(20.0, unit="m"), |
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.
Using 0 here raised the "No simulation reading found for distance -0.2m." error
| # according to which component reading to use, we simply loop over distances one | ||
| # by one here. | ||
| for dist in distances: | ||
| # Find the correct simulation reading |
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.
Could optimize here instead of starting the search from the beginning every time, but not sure the added complexity (probably involving keeping track of an index for the relevant component reading) is worth the (probably minimal) performance gain?
Some monitors can be placed between choppers and even before the first choppers.
Until now, we only covered a range of distances in the tof lookup table that started after the last chopper in the cascade.
This PR generalizes the mechanism so we can build LUTs for the full beamline range.

For Odin, it now looks as follows:
Note that the
SimulationResultsclass has changed, it is now a dict of event readings at various places along the beamline. Each reading is now essentially what theSimulationResultsused to be before.Note however that despite this change, no updates to the workflow that computes a LUT were necessary (e.g. notebooks for Odin and Dream).
The only small difference (apart from widening the
LtotalRange) is that it is likely that we need to increase theLookupTableRelativeErrorThresholdparameter in these notebooks, as the mixing of wavelengths is high at small distances, before the first choppers.