From 172f5ec27082ea1254b0f7d75b456deb3412df5d Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 4 Feb 2026 15:54:13 +0100 Subject: [PATCH 1/7] update notebook and add new table to data registry --- docs/odin/odin-make-tof-lookup-table.ipynb | 13 ++++++------- src/ess/odin/data.py | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/docs/odin/odin-make-tof-lookup-table.ipynb b/docs/odin/odin-make-tof-lookup-table.ipynb index 6478cfa..9ff89d1 100644 --- a/docs/odin/odin-make-tof-lookup-table.ipynb +++ b/docs/odin/odin-make-tof-lookup-table.ipynb @@ -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" ] }, { @@ -67,7 +67,7 @@ "outputs": [], "source": [ "table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n", - "table" + "table.array" ] }, { @@ -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')" ] } ], @@ -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, diff --git a/src/ess/odin/data.py b/src/ess/odin/data.py index ac17369..31ab32a 100644 --- a/src/ess/odin/data.py +++ b/src/ess/odin/data.py @@ -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", }, ) @@ -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 fulle range should be prefered, 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") From 2a8f6fa990dad06573758e3b1370743f0b82bac7 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 4 Feb 2026 15:54:56 +0100 Subject: [PATCH 2/7] bump essreduce requirement --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8bb1ce2..5a844c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", ] From 019514360335f0814bb4cb110758a72b48b521e5 Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 4 Feb 2026 16:02:15 +0100 Subject: [PATCH 3/7] update deps --- requirements/base.in | 2 +- requirements/base.txt | 2 +- requirements/docs.txt | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index 9e1a2c5..5345c7c 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -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 diff --git a/requirements/base.txt b/requirements/base.txt index 633b6fd..23dedf1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -# SHA1:a1100845ace4b19ad8a759324efbe63c69022f7b +# SHA1:fcc863d6dd3fc563d169eb78aedec09467a24bb3 # # This file was generated by pip-compile-multi. # To update, run: diff --git a/requirements/docs.txt b/requirements/docs.txt index 6d8f566..34ac36d 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -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 @@ -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 From 49b58edc490991921ddcd08ce613939ab262c32d Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Wed, 4 Feb 2026 16:07:39 +0100 Subject: [PATCH 4/7] spelling --- src/ess/odin/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ess/odin/data.py b/src/ess/odin/data.py index 31ab32a..49ebee2 100644 --- a/src/ess/odin/data.py +++ b/src/ess/odin/data.py @@ -66,7 +66,7 @@ def odin_tof_lookup_table(full_beamline: bool = False) -> pathlib.Path: 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 fulle range should be prefered, and the shorter range is kept for + The full range should be preferred, and the shorter range is kept for retro-compatibility. These tables were computed using `Create a time-of-flight lookup table for ODIN From 127d3e9bcd334577f3a8f82a14375563ac65b76f Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Thu, 12 Feb 2026 13:36:36 +0100 Subject: [PATCH 5/7] update odin and tbl lookup tables and notebooks --- docs/odin/odin-make-tof-lookup-table.ipynb | 5 ++--- docs/tbl/tbl-make-tof-lookup-table.ipynb | 13 ++++++------ src/ess/odin/data.py | 23 +++++----------------- src/ess/tbl/data.py | 5 +++-- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/docs/odin/odin-make-tof-lookup-table.ipynb b/docs/odin/odin-make-tof-lookup-table.ipynb index 9ff89d1..a494ad5 100644 --- a/docs/odin/odin-make-tof-lookup-table.ipynb +++ b/docs/odin/odin-make-tof-lookup-table.ipynb @@ -47,8 +47,7 @@ "wf[time_of_flight.PulseStride] = 2\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] = 1.0" + "wf[time_of_flight.TimeResolution] = sc.scalar(250.0, unit='us')" ] }, { @@ -116,7 +115,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.7" + "version": "3.12.12" } }, "nbformat": 4, diff --git a/docs/tbl/tbl-make-tof-lookup-table.ipynb b/docs/tbl/tbl-make-tof-lookup-table.ipynb index cbb8e74..870c757 100644 --- a/docs/tbl/tbl-make-tof-lookup-table.ipynb +++ b/docs/tbl/tbl-make-tof-lookup-table.ipynb @@ -43,10 +43,9 @@ "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] = 1\n", - "wf[time_of_flight.LtotalRange] = sc.scalar(25.0, unit=\"m\"), sc.scalar(35.0, unit=\"m\")\n", + "wf[time_of_flight.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(35.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] = 1.0" + "wf[time_of_flight.TimeResolution] = sc.scalar(250.0, unit='us')" ] }, { @@ -65,7 +64,7 @@ "outputs": [], "source": [ "table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n", - "table" + "table.array" ] }, { @@ -75,7 +74,7 @@ "metadata": {}, "outputs": [], "source": [ - "table.plot()" + "table.plot(title=\"Predicted time-of-flight\") + sc.stddevs(table.array).plot(title=\"Standard deviation\")" ] }, { @@ -95,7 +94,7 @@ "source": [ "# Save chopper metadata\n", "# Write to file\n", - "table.save_hdf5('TBL-tof-lookup-table-no-choppers.h5')" + "table.save_hdf5('TBL-tof-lookup-table-no-choppers-5m-35m.h5')" ] } ], @@ -115,7 +114,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.7" + "version": "3.12.12" } }, "nbformat": 4, diff --git a/src/ess/odin/data.py b/src/ess/odin/data.py index 49ebee2..dcd7f95 100644 --- a/src/ess/odin/data.py +++ b/src/ess/odin/data.py @@ -15,7 +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", + "ODIN-tof-lookup-table-5m-65m.h5": "md5:c815eed6835a98d0b8d5252ffe250964", }, ) @@ -60,26 +60,13 @@ def iron_simulation_ob_large() -> pathlib.Path: return _registry.get_path("iron_simulation_ob_large.nxs") -def odin_tof_lookup_table(full_beamline: bool = False) -> pathlib.Path: +def odin_tof_lookup_table() -> 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 file is used to convert the raw ``event_time_offset`` to time-of-flight. - These tables were computed using `Create a time-of-flight lookup table for ODIN + This table was 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. """ - if full_beamline: - return _registry.get_path("ODIN-tof-lookup-table-5m-65m.h5") - else: - return _registry.get_path("ODIN-tof-lookup-table.h5") + return _registry.get_path("ODIN-tof-lookup-table-5m-65m.h5") diff --git a/src/ess/tbl/data.py b/src/ess/tbl/data.py index d01c58d..10200be 100644 --- a/src/ess/tbl/data.py +++ b/src/ess/tbl/data.py @@ -12,6 +12,7 @@ files={ "tbl_sample_data_2025-03.hdf": "md5:12db6bc06721278b3abe47992eac3e77", "TBL-tof-lookup-table-no-choppers.h5": "md5:8bc98fac0ee64fc8f5decf509c75bafe", + "TBL-tof-lookup-table-no-choppers-5m-35m.h5": "md5:be7e73f32d395abd3c28b95f75934d61", # noqa: E501 'tbl-orca-focussing.hdf.zip': Entry( alg='md5', chk='f365acd9ea45dd205c0b9398d163cfa4', unzip=True ), @@ -34,9 +35,9 @@ def tbl_tof_lookup_table_no_choppers() -> pathlib.Path: This table was computed using `Create a time-of-flight lookup table for TBL <../../tbl/tbl-make-tof-lookup-table.rst>`_ - with ``NumberOfSimulatedNeutrons = 2_000_000``. + with ``NumberOfSimulatedNeutrons = 5_000_000``. """ - return _registry.get_path("TBL-tof-lookup-table-no-choppers.h5") + return _registry.get_path("TBL-tof-lookup-table-no-choppers-5m-35m.h5") def tbl_orca_focussing_data() -> pathlib.Path: From a76f8149ebd850a105c0b7d9bc2aff98caa718ca Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Thu, 12 Feb 2026 14:17:06 +0100 Subject: [PATCH 6/7] bump essreduce version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5a844c7..d4c6e7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "scippneutron>=24.12.0", "scippnexus>=23.11.1", "tifffile>=2024.7.2", - "essreduce>=26.2.0", + "essreduce>=26.2.1", "scitiff>=25.7", ] From 6716d3cd9170a81c4e03fbd285d12a29b1ca987e Mon Sep 17 00:00:00 2001 From: Neil Vaytet Date: Thu, 12 Feb 2026 14:22:09 +0100 Subject: [PATCH 7/7] update deps --- requirements/base.in | 2 +- requirements/base.txt | 14 +++++++------- requirements/basetest.txt | 4 ++-- requirements/ci.txt | 2 +- requirements/dev.txt | 4 ++-- requirements/docs.txt | 2 +- requirements/nightly.txt | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index 5345c7c..8e80f00 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -10,5 +10,5 @@ scipp>=25.4.0 scippneutron>=24.12.0 scippnexus>=23.11.1 tifffile>=2024.7.2 -essreduce>=26.2.0 +essreduce>=26.2.1 scitiff>=25.7 diff --git a/requirements/base.txt b/requirements/base.txt index 23dedf1..0531832 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -# SHA1:fcc863d6dd3fc563d169eb78aedec09467a24bb3 +# SHA1:25cc169af2b425517b579101f3f19c2bdc88e9b2 # # This file was generated by pip-compile-multi. # To update, run: @@ -33,13 +33,13 @@ dnspython==2.8.0 # via email-validator email-validator==2.3.0 # via scippneutron -essreduce==26.2.0 +essreduce==26.2.2 # via -r base.in executing==2.2.1 # via stack-data fonttools==4.61.1 # via matplotlib -fsspec==2026.1.0 +fsspec==2026.2.0 # via dask graphviz==0.21 # via @@ -115,17 +115,17 @@ packaging==26.0 # dask # lazy-loader # matplotlib -parso==0.8.5 +parso==0.8.6 # via jedi partd==1.4.2 # via dask pexpect==4.9.0 # via ipython -pillow==12.1.0 +pillow==12.1.1 # via # ipympl # matplotlib -plopp[all]==25.11.0 +plopp[all]==26.2.0 # via # -r base.in # scippneutron @@ -221,7 +221,7 @@ typing-extensions==4.15.0 # typing-inspection typing-inspection==0.4.2 # via pydantic -wcwidth==0.5.3 +wcwidth==0.6.0 # via prompt-toolkit widgetsnbextension==4.0.15 # via ipywidgets diff --git a/requirements/basetest.txt b/requirements/basetest.txt index f0512c3..99601d3 100644 --- a/requirements/basetest.txt +++ b/requirements/basetest.txt @@ -49,11 +49,11 @@ packaging==26.0 # matplotlib # pooch # pytest -pillow==12.1.0 +pillow==12.1.1 # via matplotlib platformdirs==4.5.1 # via pooch -plopp==25.11.0 +plopp==26.2.0 # via tof pluggy==1.6.0 # via pytest diff --git a/requirements/ci.txt b/requirements/ci.txt index 20ed816..fd69cd4 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -5,7 +5,7 @@ # # requirements upgrade # -cachetools==7.0.0 +cachetools==7.0.1 # via tox certifi==2026.1.4 # via requests diff --git a/requirements/dev.txt b/requirements/dev.txt index b752fad..9929ec7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -66,7 +66,7 @@ jupyter-server==2.17.0 # notebook-shim jupyter-server-terminals==0.5.4 # via jupyter-server -jupyterlab==4.5.3 +jupyterlab==4.5.4 # via -r dev.in jupyterlab-server==2.28.0 # via jupyterlab @@ -78,7 +78,7 @@ overrides==7.7.0 # via jupyter-server pip-compile-multi==3.2.2 # via -r dev.in -pip-tools==7.5.2 +pip-tools==7.5.3 # via pip-compile-multi plumbum==1.10.0 # via copier diff --git a/requirements/docs.txt b/requirements/docs.txt index 34ac36d..67afc0e 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -40,7 +40,7 @@ fastjsonschema==2.21.2 # via nbformat imagesize==1.4.1 # via sphinx -ipykernel==7.1.0 +ipykernel==7.2.0 # via -r docs.in jinja2==3.1.6 # via diff --git a/requirements/nightly.txt b/requirements/nightly.txt index 83a6e53..156f84c 100644 --- a/requirements/nightly.txt +++ b/requirements/nightly.txt @@ -38,7 +38,7 @@ essreduce @ git+https://github.com/scipp/essreduce@main # via -r nightly.in fonttools==4.61.1 # via matplotlib -fsspec==2026.1.0 +fsspec==2026.2.0 # via dask graphviz==0.21 # via -r nightly.in @@ -93,7 +93,7 @@ packaging==26.0 # pytest partd==1.4.2 # via dask -pillow==12.1.0 +pillow==12.1.1 # via matplotlib platformdirs==4.5.1 # via pooch