-
Notifications
You must be signed in to change notification settings - Fork 3
Tofectomy: workflows without tof #259
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
Changes from 14 commits
dcab701
cdb703f
82aebc5
edb1ad9
b18d266
7cb2f46
5533122
2b6da84
0ab33eb
b426ce1
1cad020
6a4cacc
9568b9e
a4aad0f
8c0efbf
12c7399
e12e269
2187378
af19bf1
7b30aea
b6a3720
9ce3c39
6e5ac55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ | |
| import scipp as sc | ||
|
|
||
| from ess.reduce.nexus.types import Filename, RawDetector, RunType, SampleRun | ||
| from ess.reduce.time_of_flight.types import TofDetector | ||
|
|
||
|
|
||
| class StreakClusteredData(sciline.Scope[RunType, sc.DataArray], sc.DataArray): | ||
|
|
@@ -24,7 +23,6 @@ class StreakClusteredData(sciline.Scope[RunType, sc.DataArray], sc.DataArray): | |
| RawDetector = RawDetector | ||
| Filename = Filename | ||
| SampleRun = SampleRun | ||
| TofDetector = TofDetector | ||
|
|
||
|
|
||
| class DetectorBank(Enum): | ||
|
|
@@ -58,3 +56,9 @@ class DetectorBank(Enum): | |
|
|
||
| CIFPeaksMinIntensity = NewType("CIFPeaksMinIntensity", sc.Variable) | ||
| """Minimum peak intensity for peaks from CIF file to be included in :py:`DHKLList`.""" | ||
|
|
||
|
|
||
| class TofDetector(sciline.Scope[RunType, sc.DataArray], sc.DataArray): | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This type no longer exists in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you leaving the beer workflow for later or does it need to continue using tof?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are leaving it for later. Sorry, I forgot to mention that. |
||
| """ | ||
| Detector with a time-of-flight coordinate | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,9 @@ | |
| # `shrink_nexus.py` script in the `tools` folder at the top level of the | ||
| # `essdiffraction` repository. | ||
| "TEST_DREAM_nexus_sorted-2023-12-07.nxs": "md5:599b426a93c46a7b4b09a874bf288c53", # noqa: E501 | ||
| # Wavelength lookup tables | ||
| "DREAM-high-flux-wavelength-lut-5m-80m-bc215.h5": "md5:10c80c9de311cfa246f7b2c165eb0b49", # noqa: E501 | ||
| "DREAM-high-flux-wavelength-lut-5m-80m-bc240.h5": "md5:9741176f8da9b34c2a15967a43e21462", # noqa: E501 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you remove the tof lookup tables from the registry and their associated functions?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought I would leave them in for backward compatibility, but then this is a very breaking change, so maybe we cannot be backward compatible? I kept them in essimaging when I made my changes...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can still use the old tables. The workflow has changed too much and we no longer have the right providers. So I'd just remove the tables. |
||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -293,3 +296,36 @@ def tof_lookup_table_high_flux(bc: Literal[215, 240] = 215) -> Path: | |
| return get_path("DREAM-high-flux-tof-lut-5m-80m-bc240.h5") | ||
| case _: | ||
| raise ValueError(f"Unsupported band-control chopper (BC) value: {bc}") | ||
|
|
||
|
|
||
| def lookup_table_high_flux(bc: Literal[215, 240] = 215) -> Path: | ||
| """Path to a HDF5 file containing a wavelength lookup table for high-flux mode. | ||
|
|
||
| The table was created using the ``tof`` package and the chopper settings for the | ||
| DREAM instrument in high-resolution mode. | ||
| Can return tables for two different band-control chopper (BC) settings: | ||
| - ``bc=215``: corresponds to the settings of the choppers in the tutorial data. | ||
| - ``bc=240``: a setting with less time overlap between frames. | ||
|
|
||
| Note that the phase of the band-control chopper (BCC) was set to 215 degrees in the | ||
| Geant4 simulation which generated the data used in the documentation notebooks. | ||
| This has since been found to be non-optimal as it leads to time overlap between the | ||
| two frames, and a value of 240 degrees is now recommended. | ||
|
|
||
| This table was computed using `Create a wavelength lookup table for DREAM | ||
| <../../user-guide/dream/dream-make-wavelength-lookup-table.rst>`_ | ||
| with ``NumberOfSimulatedNeutrons = 5_000_000``. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| bc: | ||
| Band-control chopper (BC) setting. The default is 215, which corresponds to the | ||
| settings of the choppers in the tutorial data. | ||
| """ | ||
| match bc: | ||
| case 215: | ||
| return get_path("DREAM-high-flux-wavelength-lut-5m-80m-bc215.h5") | ||
| case 240: | ||
| return get_path("DREAM-high-flux-wavelength-lut-5m-80m-bc240.h5") | ||
| case _: | ||
| raise ValueError(f"Unsupported band-control chopper (BC) value: {bc}") | ||
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.
Why? I find this less readable and normally avoid
wfin documentation. (Except apparently in the lookup table notebook)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 thought we had
wfin most other places. I find it much easier to type, but maybe it is less readable?