-
Notifications
You must be signed in to change notification settings - Fork 1
Use RunType instead of SampleRun for tof lookup table
#251
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
jl-wynen
left a comment
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 think this is generally a good idea. The extra flexibility could come in handy. But can we actually use different chopper settings for different runs? Or would that mess with the available wavelength ranges and resolutions in a way that makes the data incompatible?
Would this PR break anything for users or just internally in the downstream packages?
Is there a way to avoid running the simulation twice, once for sample and once for, e.g., vanadium? Without an intermediate file, that is?
This would not break (I mean breakage would be internal) workflows/notebooks where an instrument configuration is used to select the tof LUT (as is done in Dream).
Not sure it's easy to do automatically. You'd have to compute the Maybe this is a sign that it's turning out to be a bad idea? |
|
One option would be to have types like Loading from file is probably fast enough because the tables are fairly small. In practice, that is probably what we would use most of the time, right? We would usually not run a simulation during reduction? So we could just leave it as is and see if we get into performance problems. |
|
Is there a way to have a function take in |
…common lut table type which then gets wrapped by the RunType in a second provider
Note that after the update, we can either: wf = GenericTofWorkflow(tof_lut_provider=TofLutProvider.TOF, ...)
table = wf.compute(TimeOfFlightLookupTable[SampleRun])
for run in (SampleRun, BackgroundRun, OpenRun):
wf[TimeOfFlightLookupTable[run]] = tablewf = GenericTofWorkflow(tof_lut_provider=TofLutProvider.FILE, ...)
# Compute from simulation is still possible
table = wf.compute(TimeOfFlightLookupTableFromSimulation[SampleRun])
wf[CommonTimeOfFlightLookupTable] = tableBut I am still wondering if it might be better to just not really support the |
|
This is replaced by #253 |
See discussion scipp/essimaging#91 (comment) for context.
This should allow more flexible use of run types created in downstream packages, as opposed to only being able to use aliases of the types defined in
essreduce.Downside is that this is now a breaking change (again), which would break all downstream packages that use the Tof workflow 😞
So I am not happy about that, hence the draft. Can we think of an alternative?
There were also other uses of
SampleRunin thelivesubmodule here, but I did not modify those, as I am unsure if it is required.