Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
87cd8c6
rename submodule to kinematics
nvaytet Feb 25, 2026
9a4e75a
can now compute wavelengths from on-the-fly built lut
nvaytet Feb 25, 2026
7834b57
quick fix to dream notebook
nvaytet Feb 25, 2026
2754a7e
remove unused import
nvaytet Feb 25, 2026
c54df5b
some formatting
nvaytet Feb 25, 2026
89a33d4
Merge branch 'main' into essreduce-tofectomy
nvaytet Feb 26, 2026
65a8b8c
start renaming variables in tests
nvaytet Mar 4, 2026
a87b8ee
more name fixing
nvaytet Mar 4, 2026
9ae750d
Merge branch 'essreduce-tofectomy' of github.com:scipp/ess into essre…
nvaytet Mar 4, 2026
a108988
update wfm tests
nvaytet Mar 4, 2026
7aaf07f
kinematics -> unwrap
nvaytet Mar 6, 2026
fbf182b
rename workflow
nvaytet Mar 6, 2026
9915597
fix last tests
nvaytet Mar 6, 2026
b011129
fix linting
nvaytet Mar 6, 2026
590cb64
Merge branch 'main' into essreduce-tofectomy
nvaytet Mar 6, 2026
2aa1012
Merge branch 'main' into essreduce-tofectomy
nvaytet Mar 9, 2026
7dddbca
time_of_flight -> unwrap
nvaytet Mar 9, 2026
ff81bbc
TimeOfFlightLookupTable -> LookupTable
nvaytet Mar 9, 2026
08675c1
fix more names, remove conversion to wavelength
nvaytet Mar 9, 2026
495dc18
use type from essreduce
nvaytet Mar 9, 2026
0903f1a
lint
nvaytet Mar 9, 2026
9506b11
Merge branch 'main' into essreduce-tofectomy
nvaytet Mar 9, 2026
2fa4fd0
update odin notebooks and data
nvaytet Mar 9, 2026
be5745d
update tables to wavelength and notebooks in imaging
nvaytet Mar 9, 2026
d7d41de
fix tests
nvaytet Mar 9, 2026
6209b2c
rename docs folder and update indexes
nvaytet Mar 9, 2026
086b7ad
update frame unwrapping ntoebooks
nvaytet Mar 9, 2026
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
1 change: 0 additions & 1 deletion packages/essimaging/docs/api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
:template: module-template.rst
:recursive:

conversion
data
tools
types
Expand Down
2 changes: 1 addition & 1 deletion packages/essimaging/docs/odin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ maxdepth: 1
---

odin-data-reduction
odin-make-tof-lookup-table
odin-make-wavelength-lookup-table
```
17 changes: 9 additions & 8 deletions packages/essimaging/docs/odin/odin-data-reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"outputs": [],
"source": [
"import scipp as sc\n",
"from ess.reduce import time_of_flight\n",
"from ess.reduce import unwrap\n",
"from ess import odin\n",
"import ess.odin.data # noqa: F401\n",
"from ess.imaging.types import *"
Expand All @@ -45,7 +45,7 @@
"\n",
"wf[Filename[SampleRun]] = odin.data.iron_simulation_sample_small()\n",
"wf[NeXusDetectorName] = \"event_mode_detectors/timepix3\"\n",
"wf[time_of_flight.TimeOfFlightLookupTableFilename] = odin.data.odin_tof_lookup_table()"
"wf[unwrap.LookupTableFilename] = odin.data.odin_wavelength_lookup_table()"
]
},
{
Expand Down Expand Up @@ -84,9 +84,9 @@
"id": "7",
"metadata": {},
"source": [
"## Compute neutron time-of-flight/wavelength\n",
"## Compute neutron wavelengths\n",
"\n",
"We will now use the workflow to compute the neutron time-of-flight (equivalent to wavelength) using a lookup table built from the beamline chopper information."
"We will now use the workflow to compute the neutron wavelengths using a lookup table built from the beamline chopper information."
]
},
{
Expand All @@ -96,7 +96,7 @@
"metadata": {},
"outputs": [],
"source": [
"wf.visualize(TofDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
"wf.visualize(WavelengthDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
Expand All @@ -106,7 +106,7 @@
"source": [
"### Inspect the lookup table\n",
"\n",
"It is always a good idea to quickly plot the TOF lookup table, as a sanity check."
"It is always a good idea to quickly plot the wavelength lookup table, as a sanity check."
]
},
{
Expand All @@ -116,7 +116,7 @@
"metadata": {},
"outputs": [],
"source": [
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
"table = wf.compute(unwrap.LookupTable)\n",
"table.plot(figsize=(9, 4))"
]
},
Expand Down Expand Up @@ -285,7 +285,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "0",
"metadata": {},
"source": [
"# Create a time-of-flight lookup table for ODIN"
"# Create a wavelength lookup table for ODIN"
]
},
{
Expand All @@ -16,7 +16,7 @@
"outputs": [],
"source": [
"import scipp as sc\n",
"from ess.reduce import time_of_flight\n",
"from ess.reduce import unwrap\n",
"from ess.reduce.nexus.types import AnyRun\n",
"from ess.odin.beamline import choppers"
]
Expand All @@ -39,15 +39,15 @@
"source_position = sc.vector([0, 0, 0], unit='m')\n",
"disk_choppers = choppers(source_position)\n",
"\n",
"wf = time_of_flight.TofLookupTableWorkflow()\n",
"wf[time_of_flight.DiskChoppers[AnyRun]] = disk_choppers\n",
"wf[time_of_flight.SourcePosition] = source_position\n",
"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(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')"
"wf = unwrap.LookupTableWorkflow()\n",
"wf[unwrap.DiskChoppers[AnyRun]] = disk_choppers\n",
"wf[unwrap.SourcePosition] = source_position\n",
"wf[unwrap.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
"wf[unwrap.SimulationSeed] = 1234\n",
"wf[unwrap.PulseStride] = 2\n",
"wf[unwrap.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(65.0, unit=\"m\")\n",
"wf[unwrap.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
"wf[unwrap.TimeResolution] = sc.scalar(250.0, unit='us')"
]
},
{
Expand All @@ -65,7 +65,7 @@
"metadata": {},
"outputs": [],
"source": [
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
"table = wf.compute(unwrap.LookupTable)\n",
"table.array"
]
},
Expand Down Expand Up @@ -95,7 +95,7 @@
"outputs": [],
"source": [
"# Write to file\n",
"table.save_hdf5('ODIN-tof-lookup-table-5m-65m.h5')"
"table.save_hdf5('ODIN-wavelength-lookup-table-5m-65m.h5')"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/essimaging/docs/tbl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ maxdepth: 1

tbl-data-reduction
orca-image-normalization
tbl-make-tof-lookup-table
tbl-make-wavelength-lookup-table
```
24 changes: 11 additions & 13 deletions packages/essimaging/docs/tbl/tbl-data-reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"outputs": [],
"source": [
"import plopp as pp\n",
"from ess.reduce import time_of_flight\n",
"from ess.reduce import unwrap\n",
"from ess import tbl\n",
"import ess.tbl.data # noqa: F401\n",
"from ess.imaging.types import *"
Expand All @@ -40,7 +40,7 @@
"wf = tbl.TblWorkflow()\n",
"\n",
"wf[Filename[SampleRun]] = tbl.data.tutorial_sample_data()\n",
"wf[TimeOfFlightLookupTableFilename] = tbl.data.tbl_tof_lookup_table_no_choppers()"
"wf[LookupTableFilename] = tbl.data.tbl_wavelength_lookup_table_no_choppers()"
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
"id": "8",
"metadata": {},
"source": [
"### Time-of-flight"
"### Neutron wavelengths"
]
},
{
Expand All @@ -99,15 +99,15 @@
"metadata": {},
"outputs": [],
"source": [
"wf.visualize(TofDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
"wf.visualize(WavelengthDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
"cell_type": "markdown",
"id": "10",
"metadata": {},
"source": [
"#### Visualize the time-of-flight lookup table"
"#### Visualize the wavelength lookup table"
]
},
{
Expand All @@ -117,7 +117,7 @@
"metadata": {},
"outputs": [],
"source": [
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
"table = wf.compute(unwrap.LookupTable)\n",
"table.plot()"
]
},
Expand All @@ -136,10 +136,9 @@
"metadata": {},
"outputs": [],
"source": [
"ngem_tofs = wf.compute(TofDetector[SampleRun])\n",
"ngem_wavs = wf.compute(WavelengthDetector[SampleRun])\n",
"\n",
"ngem_tofs.bins.concat().hist(tof=100).plot() + ngem_wavs.bins.concat().hist(wavelength=100).plot()"
"ngem_wavs.bins.concat().hist(wavelength=100).plot()"
]
},
{
Expand Down Expand Up @@ -182,7 +181,7 @@
"id": "17",
"metadata": {},
"source": [
"### Time-of-flight"
"### Neutron wavelengths"
]
},
{
Expand All @@ -192,15 +191,13 @@
"metadata": {},
"outputs": [],
"source": [
"he3_tofs = {}\n",
"he3_wavs = {}\n",
"\n",
"for bank in ('he3_detector_bank0', 'he3_detector_bank1'):\n",
" he3_wf[NeXusDetectorName] = bank\n",
" he3_tofs[bank] = he3_wf.compute(TofDetector[SampleRun]).bins.concat().hist(tof=100)\n",
" he3_wavs[bank] = he3_wf.compute(WavelengthDetector[SampleRun]).bins.concat().hist(wavelength=100)\n",
"\n",
"pp.plot(he3_tofs) + pp.plot(he3_wavs)"
"pp.plot(he3_wavs)"
]
}
],
Expand All @@ -219,7 +216,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.12.12"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "0",
"metadata": {},
"source": [
"# Create a time-of-flight lookup table for TBL"
"# Create a wavelength lookup table for TBL"
]
},
{
Expand All @@ -16,7 +16,7 @@
"outputs": [],
"source": [
"import scipp as sc\n",
"from ess.reduce import time_of_flight\n",
"from ess.reduce import unwrap\n",
"from ess.reduce.nexus.types import AnyRun"
]
},
Expand All @@ -37,15 +37,15 @@
"source": [
"source_position = sc.vector([0, 0, 0], unit='m')\n",
"\n",
"wf = time_of_flight.TofLookupTableWorkflow()\n",
"wf[time_of_flight.DiskChoppers[AnyRun]] = {}\n",
"wf[time_of_flight.SourcePosition] = source_position\n",
"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(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')"
"wf = unwrap.LookupTableWorkflow()\n",
"wf[unwrap.DiskChoppers[AnyRun]] = {}\n",
"wf[unwrap.SourcePosition] = source_position\n",
"wf[unwrap.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
"wf[unwrap.SimulationSeed] = 1234\n",
"wf[unwrap.PulseStride] = 1\n",
"wf[unwrap.LtotalRange] = sc.scalar(5.0, unit=\"m\"), sc.scalar(35.0, unit=\"m\")\n",
"wf[unwrap.DistanceResolution] = sc.scalar(0.1, unit=\"m\")\n",
"wf[unwrap.TimeResolution] = sc.scalar(250.0, unit='us')"
]
},
{
Expand All @@ -63,7 +63,7 @@
"metadata": {},
"outputs": [],
"source": [
"table = wf.compute(time_of_flight.TimeOfFlightLookupTable)\n",
"table = wf.compute(unwrap.LookupTable)\n",
"table.array"
]
},
Expand Down Expand Up @@ -94,7 +94,7 @@
"source": [
"# Save chopper metadata\n",
"# Write to file\n",
"table.save_hdf5('TBL-tof-lookup-table-no-choppers-5m-35m.h5')"
"table.save_hdf5('TBL-wavelength-lookup-table-no-choppers-5m-35m.h5')"
]
}
],
Expand Down
62 changes: 0 additions & 62 deletions packages/essimaging/src/ess/imaging/conversion.py

This file was deleted.

Loading
Loading