Skip to content
Merged
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
33 changes: 15 additions & 18 deletions docs/user-guide/beer/beer_modulation_mcstas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@
"metadata": {},
"outputs": [],
"source": [
"import scipp as sc\n",
"import scippneutron as scn\n",
"\n",
"from ess.beer import BeerModMcStasWorkflow, BeerModMcStasWorkflowKnownPeaks\n",
"from ess.beer.data import mcstas_silicon_medium_resolution, mcstas_duplex, duplex_peaks_array, silicon_peaks_array\n",
"from ess.reduce.nexus.types import Filename, SampleRun\n",
"from ess.reduce.time_of_flight.types import DetectorTofData\n",
"from ess.beer.types import *\n",
"\n",
"# Default bin edges for our d_hkl histograms\n",
Expand Down Expand Up @@ -173,7 +170,7 @@
"source": [
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
"wf[Filename[SampleRun]] = mcstas_silicon_medium_resolution()\n",
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
"wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
]
},
{
Expand All @@ -192,7 +189,7 @@
"outputs": [],
"source": [
"wf[DHKLList] = silicon_peaks_array()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), silicon_peaks_array())"
]
Expand All @@ -214,7 +211,7 @@
"source": [
"wf = BeerModMcStasWorkflow()\n",
"wf[Filename[SampleRun]] = mcstas_silicon_medium_resolution()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), silicon_peaks_array())"
]
Expand Down Expand Up @@ -268,7 +265,7 @@
"source": [
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(8)\n",
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
"wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
]
},
{
Expand All @@ -287,7 +284,7 @@
"outputs": [],
"source": [
"wf[DHKLList] = duplex_peaks_array()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand All @@ -309,7 +306,7 @@
"source": [
"wf = BeerModMcStasWorkflow()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(8)\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand Down Expand Up @@ -363,7 +360,7 @@
"source": [
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(9)\n",
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
"wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
]
},
{
Expand All @@ -382,7 +379,7 @@
"outputs": [],
"source": [
"wf[DHKLList] = duplex_peaks_array()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand All @@ -404,7 +401,7 @@
"source": [
"wf = BeerModMcStasWorkflow()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(9)\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand Down Expand Up @@ -458,7 +455,7 @@
"source": [
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(10)\n",
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
"wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
]
},
{
Expand All @@ -477,7 +474,7 @@
"outputs": [],
"source": [
"wf[DHKLList] = duplex_peaks_array()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand All @@ -499,7 +496,7 @@
"source": [
"wf = BeerModMcStasWorkflow()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(10)\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand Down Expand Up @@ -553,7 +550,7 @@
"source": [
"wf = BeerModMcStasWorkflowKnownPeaks()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(16)\n",
"wf.compute(DetectorData[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
"wf.compute(RawDetector[SampleRun])['bank1'].hist(two_theta=1000, event_time_offset=1000).plot(norm='log')"
]
},
{
Expand All @@ -572,7 +569,7 @@
"outputs": [],
"source": [
"wf[DHKLList] = duplex_peaks_array()\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand All @@ -594,7 +591,7 @@
"source": [
"wf = BeerModMcStasWorkflow()\n",
"wf[Filename[SampleRun]] = mcstas_duplex(16)\n",
"da = wf.compute(DetectorTofData[SampleRun])\n",
"da = wf.compute(TofDetector[SampleRun])\n",
"da = da.transform_coords(('dspacing',), graph=scn.conversion.graph.tof.elastic('tof'),)\n",
"ground_truth_peak_positions(da.hist(dspacing=dspacing, dim=da.dims).plot(), duplex_peaks_array())"
]
Expand Down
18 changes: 9 additions & 9 deletions docs/user-guide/dream/dream-advanced-powder-reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"metadata": {},
"outputs": [],
"source": [
"workflow.visualize(IofDspacingTwoTheta[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
"workflow.visualize(IntensityDspacingTwoTheta[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
Expand All @@ -129,7 +129,7 @@
"metadata": {},
"outputs": [],
"source": [
"grouped_dspacing = workflow.compute(IofDspacingTwoTheta[SampleRun])\n",
"grouped_dspacing = workflow.compute(IntensityDspacingTwoTheta[SampleRun])\n",
"grouped_dspacing"
]
},
Expand Down Expand Up @@ -212,7 +212,7 @@
"metadata": {},
"outputs": [],
"source": [
"workflow.visualize(IofDspacing[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
"workflow.visualize(IntensityDspacing[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
Expand All @@ -230,7 +230,7 @@
"metadata": {},
"outputs": [],
"source": [
"result = workflow.compute(IofDspacing[SampleRun])\n",
"result = workflow.compute(IntensityDspacing[SampleRun])\n",
"result.hist().plot(title=result.coords['detector'].value.capitalize())"
]
},
Expand Down Expand Up @@ -288,7 +288,7 @@
"metadata": {},
"outputs": [],
"source": [
"workflow.visualize(IofDspacing[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
"workflow.visualize(IntensityDspacing[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
Expand All @@ -306,7 +306,7 @@
"metadata": {},
"outputs": [],
"source": [
"result = workflow.compute(IofDspacing[SampleRun])\n",
"result = workflow.compute(IntensityDspacing[SampleRun])\n",
"result.hist().plot(title=result.coords['detector'].value.capitalize())"
]
},
Expand All @@ -329,8 +329,8 @@
"metadata": {},
"outputs": [],
"source": [
"intermediates = workflow.compute((CountsWavelength[SampleRun], MaskedData[SampleRun]))\n",
"intermediates[CountsWavelength[SampleRun]]"
"intermediates = workflow.compute((WavelengthDetector[SampleRun], CorrectedDetector[SampleRun]))\n",
"intermediates[WavelengthDetector[SampleRun]]"
]
},
{
Expand All @@ -341,7 +341,7 @@
"outputs": [],
"source": [
"two_theta = sc.linspace(\"two_theta\", 0.8, 2.4, 301, unit=\"rad\")\n",
"intermediates[MaskedData[SampleRun]].hist(two_theta=two_theta, wavelength=300).plot(\n",
"intermediates[CorrectedDetector[SampleRun]].hist(two_theta=two_theta, wavelength=300).plot(\n",
" norm=\"log\"\n",
")"
]
Expand Down
3 changes: 2 additions & 1 deletion docs/user-guide/dream/dream-make-tof-lookup-table.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"source": [
"import scipp as sc\n",
"from ess.reduce import time_of_flight\n",
"from ess.reduce.nexus.types import AnyRun\n",
"from ess.dream.beamline import InstrumentConfiguration, choppers"
]
},
Expand Down Expand Up @@ -62,7 +63,7 @@
"wf[time_of_flight.LtotalRange] = sc.scalar(60.0, unit=\"m\"), sc.scalar(80.0, unit=\"m\")\n",
"wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
"wf[time_of_flight.SourcePosition] = sc.vector([0, 0, 0], unit='m')\n",
"wf[time_of_flight.DiskChoppers] = disk_choppers\n",
"wf[time_of_flight.DiskChoppers[AnyRun]] = disk_choppers\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\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/dream/dream-powder-reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "3.11.10"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/dream/workflow-widget-dream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"wfw = widget.children[1].children[0]\n",
"outputs = wfw.output_selection_box.typical_outputs_widget\n",
"keys, values = zip(*outputs.options, strict=True)\n",
"ind = keys.index(\"IofDspacing[SampleRun]\")\n",
"ind = keys.index(\"IntensityDspacing[SampleRun]\")\n",
"outputs.value = (values[ind],)\n",
"# Refresh parameters\n",
"pbox = wfw.parameter_box\n",
Expand Down
Loading
Loading