Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions docs/odin/odin-make-tof-lookup-table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
"wf[time_of_flight.SimulationSeed] = 1234\n",
"wf[time_of_flight.PulseStride] = 2\n",
"wf[time_of_flight.LtotalRange] = sc.scalar(55.0, unit=\"m\"), sc.scalar(65.0, unit=\"m\")\n",
"wf[time_of_flight.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(65.0, unit=\"m\")\n",
"wf[time_of_flight.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
"wf[time_of_flight.TimeResolution] = sc.scalar(250.0, unit='us')\n",
"wf[time_of_flight.LookupTableRelativeErrorThreshold] = 0.02"
"wf[time_of_flight.LookupTableRelativeErrorThreshold] = 1.0"
]
},
{
Expand All @@ -67,7 +67,7 @@
"outputs": [],
"source": [
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
"table"
"table.array"
]
},
{
Expand Down Expand Up @@ -95,10 +95,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Save chopper metadata\n",
"table.choppers = sc.DataGroup(disk_choppers)\n",
"# Write to file\n",
"table.save_hdf5('ODIN-tof-lookup-table.h5')"
"table.save_hdf5('ODIN-tof-lookup-table-5m-65m.h5')"
]
}
],
Expand All @@ -117,7 +115,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies = [
"scippneutron>=24.12.0",
"scippnexus>=23.11.1",
"tifffile>=2024.7.2",
"essreduce>=25.11.2",
"essreduce>=26.2.0",
"scitiff>=25.7",
]

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ scipp>=25.4.0
scippneutron>=24.12.0
scippnexus>=23.11.1
tifffile>=2024.7.2
essreduce>=25.11.2
essreduce>=26.2.0
scitiff>=25.7
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:a1100845ace4b19ad8a759324efbe63c69022f7b
# SHA1:fcc863d6dd3fc563d169eb78aedec09467a24bb3
#
# This file was generated by pip-compile-multi.
# To update, run:
Expand Down
4 changes: 1 addition & 3 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ accessible-pygments==0.0.5
# via pydata-sphinx-theme
alabaster==1.0.0
# via sphinx
appnope==0.1.4
# via ipykernel
autodoc-pydantic==2.2.0
# via -r docs.in
babel==2.18.0
Expand Down Expand Up @@ -160,7 +158,7 @@ tornado==6.5.4
# via
# ipykernel
# jupyter-client
tqdm==4.67.2
tqdm==4.67.3
# via -r docs.in
urllib3==2.6.3
# via requests
Expand Down
20 changes: 17 additions & 3 deletions src/ess/odin/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"iron_simulation_sample_large.nxs": "md5:c162b6abeccb51984880d8d5002bae95",
"iron_simulation_sample_small.nxs": "md5:dda6fb30aa88780c5a3d4cef6ea05278",
"ODIN-tof-lookup-table.h5": "md5:e657021f4508f167b2a2eb550853b06b",
"ODIN-tof-lookup-table-5m-65m.h5": "md5:7b8b3afac20512935d9e6b44d740d06c",
},
)

Expand Down Expand Up @@ -59,13 +60,26 @@ def iron_simulation_ob_large() -> pathlib.Path:
return _registry.get_path("iron_simulation_ob_large.nxs")


def odin_tof_lookup_table() -> pathlib.Path:
def odin_tof_lookup_table(full_beamline: bool = False) -> pathlib.Path:
"""
Odin TOF lookup table.
This file is used to convert the time-of-flight to wavelength.
Use the ``full_beamline`` argument to get the lookup table for the full beamline,
which covers the range 5-65m.
The full range should be preferred, and the shorter range is kept for
retro-compatibility.

This table was computed using `Create a time-of-flight lookup table for ODIN
These tables were computed using `Create a time-of-flight lookup table for ODIN
<../../odin/odin-make-tof-lookup-table.rst>`_
with ``NumberOfSimulatedNeutrons = 5_000_000``.

Parameters
----------
full_beamline:
Whether to return the lookup table for the full beamline (5-65m) or for the
range 55-65m.
"""
return _registry.get_path("ODIN-tof-lookup-table.h5")
if full_beamline:
return _registry.get_path("ODIN-tof-lookup-table-5m-65m.h5")
else:
return _registry.get_path("ODIN-tof-lookup-table.h5")
Loading