Skip to content

Commit a57e6ee

Browse files
authored
Merge pull request #236 from scipp/full-beamline-tof-lut
Add full beamline tof lookup table
2 parents 2d75b28 + e181359 commit a57e6ee

File tree

13 files changed

+55
-33
lines changed

13 files changed

+55
-33
lines changed

docs/user-guide/dream/dream-make-tof-lookup-table.ipynb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"id": "4",
4949
"metadata": {},
5050
"source": [
51+
"Note that possible configurations are `high_flux`, `high_flux_BC215`, `high_flux_BC240`, and `high_resolution`.\n",
52+
"\n",
5153
"## Setting up the workflow"
5254
]
5355
},
@@ -60,13 +62,12 @@
6062
"source": [
6163
"wf = time_of_flight.TofLookupTableWorkflow()\n",
6264
"\n",
63-
"wf[time_of_flight.LtotalRange] = sc.scalar(60.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
65+
"wf[time_of_flight.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
6466
"wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
6567
"wf[time_of_flight.SourcePosition] = sc.vector([0, 0, 0], unit='m')\n",
6668
"wf[time_of_flight.DiskChoppers[AnyRun]] = disk_choppers\n",
6769
"wf[time_of_flight.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
6870
"wf[time_of_flight.TimeResolution] = sc.scalar(250.0, unit='us')\n",
69-
"wf[time_of_flight.LookupTableRelativeErrorThreshold] = 0.02\n",
7071
"wf[time_of_flight.PulsePeriod] = 1.0 / sc.scalar(14.0, unit=\"Hz\")\n",
7172
"wf[time_of_flight.PulseStride] = 1\n",
7273
"wf[time_of_flight.PulseStrideOffset] = None"
@@ -88,7 +89,7 @@
8889
"outputs": [],
8990
"source": [
9091
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
91-
"table"
92+
"table.array"
9293
]
9394
},
9495
{
@@ -116,7 +117,7 @@
116117
"metadata": {},
117118
"outputs": [],
118119
"source": [
119-
"table.save_hdf5('DREAM-high-flux-tof-lookup-table.h5')"
120+
"table.save_hdf5('DREAM-high-flux-tof-lut-5m-80m.h5')"
120121
]
121122
}
122123
],
@@ -135,7 +136,8 @@
135136
"mimetype": "text/x-python",
136137
"name": "python",
137138
"nbconvert_exporter": "python",
138-
"pygments_lexer": "ipython3"
139+
"pygments_lexer": "ipython3",
140+
"version": "3.12.12"
139141
}
140142
},
141143
"nbformat": 4,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ requires-python = ">=3.11"
3131
# Make sure to list one dependency per line.
3232
dependencies = [
3333
"dask>=2022.1.0",
34-
"essreduce>=25.12.1",
34+
"essreduce>=26.2.1",
3535
"graphviz",
3636
"numpy>=2",
3737
"plopp>=26.2.0",

requirements/base.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# --- END OF CUSTOM SECTION ---
44
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
55
dask>=2022.1.0
6-
essreduce>=25.12.1
6+
essreduce>=26.2.1
77
graphviz
88
numpy>=2
99
plopp>=26.2.0

requirements/base.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:303c70637d6536773db66ff40b4306cd86aee2c0
1+
# SHA1:e8dc8a7c4338f6f02931f7cf0dd2408d0d0351db
22
#
33
# This file was generated by pip-compile-multi.
44
# To update, run:
@@ -35,13 +35,13 @@ dnspython==2.8.0
3535
# via email-validator
3636
email-validator==2.3.0
3737
# via scippneutron
38-
essreduce==26.2.0
38+
essreduce==26.2.1
3939
# via -r base.in
4040
executing==2.2.1
4141
# via stack-data
4242
fonttools==4.61.1
4343
# via matplotlib
44-
fsspec==2026.1.0
44+
fsspec==2026.2.0
4545
# via dask
4646
gemmi==0.7.4
4747
# via ncrystal
@@ -117,13 +117,13 @@ packaging==26.0
117117
# lazy-loader
118118
# matplotlib
119119
# pooch
120-
parso==0.8.5
120+
parso==0.8.6
121121
# via jedi
122122
partd==1.4.2
123123
# via dask
124124
pexpect==4.9.0
125125
# via ipython
126-
pillow==12.1.0
126+
pillow==12.1.1
127127
# via matplotlib
128128
platformdirs==4.5.1
129129
# via pooch
@@ -219,7 +219,7 @@ typing-inspection==0.4.2
219219
# via pydantic
220220
urllib3==2.6.3
221221
# via requests
222-
wcwidth==0.5.3
222+
wcwidth==0.6.0
223223
# via prompt-toolkit
224224
widgetsnbextension==4.0.15
225225
# via ipywidgets

requirements/basetest.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ packaging==26.0
4141
# pytest
4242
pandas==3.0.0
4343
# via -r basetest.in
44-
parso==0.8.5
44+
parso==0.8.6
4545
# via jedi
4646
pexpect==4.9.0
4747
# via ipython
@@ -81,7 +81,7 @@ typing-extensions==4.15.0
8181
# via ipython
8282
urllib3==2.6.3
8383
# via requests
84-
wcwidth==0.5.3
84+
wcwidth==0.6.0
8585
# via prompt-toolkit
8686
widgetsnbextension==4.0.15
8787
# via ipywidgets

requirements/ci.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# requirements upgrade
77
#
8-
cachetools==7.0.0
8+
cachetools==7.0.1
99
# via tox
1010
certifi==2026.1.4
1111
# via requests

requirements/dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jupyter-server==2.17.0
6565
# notebook-shim
6666
jupyter-server-terminals==0.5.4
6767
# via jupyter-server
68-
jupyterlab==4.5.3
68+
jupyterlab==4.5.4
6969
# via -r dev.in
7070
jupyterlab-server==2.28.0
7171
# via jupyterlab
@@ -77,7 +77,7 @@ overrides==7.7.0
7777
# via jupyter-server
7878
pip-compile-multi==3.2.2
7979
# via -r dev.in
80-
pip-tools==7.5.2
80+
pip-tools==7.5.3
8181
# via pip-compile-multi
8282
plumbum==1.10.0
8383
# via copier

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fastjsonschema==2.21.2
4242
# via nbformat
4343
imagesize==1.4.1
4444
# via sphinx
45-
ipykernel==7.1.0
45+
ipykernel==7.2.0
4646
# via -r docs.in
4747
ipympl==0.10.0
4848
# via -r docs.in

requirements/nightly.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ executing==2.2.1
4444
# via stack-data
4545
fonttools==4.61.1
4646
# via matplotlib
47-
fsspec==2026.1.0
47+
fsspec==2026.2.0
4848
# via dask
4949
gemmi==0.7.4
5050
# via ncrystal
@@ -127,13 +127,13 @@ packaging==26.0
127127
# pytest
128128
pandas==3.0.0
129129
# via -r nightly.in
130-
parso==0.8.5
130+
parso==0.8.6
131131
# via jedi
132132
partd==1.4.2
133133
# via dask
134134
pexpect==4.9.0
135135
# via ipython
136-
pillow==12.1.0
136+
pillow==12.1.1
137137
# via matplotlib
138138
platformdirs==4.5.1
139139
# via pooch
@@ -237,7 +237,7 @@ typing-inspection==0.4.2
237237
# via pydantic
238238
urllib3==2.6.3
239239
# via requests
240-
wcwidth==0.5.3
240+
wcwidth==0.6.0
241241
# via prompt-toolkit
242242
widgetsnbextension==4.0.15
243243
# via ipywidgets

src/ess/dream/beamline.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ def choppers(configuration: InstrumentConfiguration) -> dict[str, DiskChopper]:
2626
"""Return the chopper configuration for the given instrument configuration."""
2727

2828
match configuration:
29-
case InstrumentConfiguration.high_flux:
29+
case (
30+
InstrumentConfiguration.high_flux
31+
| InstrumentConfiguration.high_flux_BC215
32+
| InstrumentConfiguration.high_flux_BC240
33+
):
3034
return {
3135
"psc1": DiskChopper(
3236
frequency=sc.scalar(14.0, unit="Hz"),
@@ -115,9 +119,15 @@ def choppers(configuration: InstrumentConfiguration) -> dict[str, DiskChopper]:
115119
"bcc": DiskChopper(
116120
frequency=sc.scalar(112.0, unit="Hz"),
117121
beam_position=sc.scalar(0.0, unit="deg"),
118-
phase=sc.scalar(215 - 180, unit="deg"),
119-
# Use 240 to reduce overlap between frames
120-
# phase=sc.scalar(240 - 180, unit="deg"),
122+
phase=sc.scalar(
123+
(
124+
240
125+
if configuration == InstrumentConfiguration.high_flux_BC240
126+
else 215
127+
)
128+
- 180,
129+
unit="deg",
130+
),
121131
axle_position=sc.vector(value=[0, 0, 9.78], unit="m"),
122132
slit_begin=sc.array(
123133
dims=["cutout"], values=[-36.875, 143.125], unit="deg"

0 commit comments

Comments
 (0)