Skip to content

Commit d923bbd

Browse files
committed
docs: use sample rotation offset parameters
1 parent d7a67cc commit d923bbd

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

docs/user-guide/amor/amor-reduction.ipynb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"source": [
101101
"workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n",
102102
"# The sample rotation value in the file is slightly off, so we set it manually\n",
103-
"workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n",
103+
"workflow[SampleRotationOffset[ReferenceRun]] = sc.scalar(0.05, unit='deg')\n",
104104
"\n",
105105
"reference_result = workflow.compute(ReducedReference)\n",
106106
"# Set the result back onto the pipeline to cache it\n",
@@ -167,29 +167,30 @@
167167
" '608': {\n",
168168
" # The sample rotation values in the files are slightly off, so we replace\n",
169169
" # them with corrected values.\n",
170-
" SampleRotation[SampleRun]: sc.scalar(0.85, unit='deg'),\n",
170+
" SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n",
171171
" Filename[SampleRun]: amor.data.amor_run(608),\n",
172172
" },\n",
173173
" '609': {\n",
174-
" SampleRotation[SampleRun]: sc.scalar(2.25, unit='deg'),\n",
174+
" SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n",
175175
" Filename[SampleRun]: amor.data.amor_run(609),\n",
176176
" },\n",
177177
" '610': {\n",
178-
" SampleRotation[SampleRun]: sc.scalar(3.65, unit='deg'),\n",
178+
" SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n",
179179
" Filename[SampleRun]: amor.data.amor_run(610),\n",
180180
" },\n",
181181
" '611': {\n",
182-
" SampleRotation[SampleRun]: sc.scalar(5.05, unit='deg'),\n",
182+
" SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n",
183183
" Filename[SampleRun]: amor.data.amor_run(611),\n",
184184
" },\n",
185185
"}\n",
186186
"\n",
187187
"\n",
188188
"reflectivity = {}\n",
189189
"for run_number, params in runs.items():\n",
190-
" workflow[Filename[SampleRun]] = params[Filename[SampleRun]]\n",
191-
" workflow[SampleRotation[SampleRun]] = params[SampleRotation[SampleRun]]\n",
192-
" reflectivity[run_number] = workflow.compute(ReflectivityOverQ).hist()\n",
190+
" wf = workflow.copy()\n",
191+
" for key, value in params.items():\n",
192+
" wf[key] = value\n",
193+
" reflectivity[run_number] = wf.compute(ReflectivityOverQ).hist()\n",
193194
"\n",
194195
"sc.plot(reflectivity, norm='log', vmin=1e-4)"
195196
]
@@ -267,9 +268,10 @@
267268
"# Start by computing the `ReflectivityData` for each of the files\n",
268269
"diagnostics = {}\n",
269270
"for run_number, params in runs.items():\n",
270-
" workflow[Filename[SampleRun]] = params[Filename[SampleRun]]\n",
271-
" workflow[SampleRotation[SampleRun]] = params[SampleRotation[SampleRun]]\n",
272-
" diagnostics[run_number] = workflow.compute((ReflectivityOverZW, ThetaBins[SampleRun]))\n",
271+
" wf = workflow.copy()\n",
272+
" for key, value in params.items():\n",
273+
" wf[key] = value\n",
274+
" diagnostics[run_number] = wf.compute((ReflectivityOverZW, ThetaBins[SampleRun]))\n",
273275
"\n",
274276
"# Scale the results using the scale factors computed earlier\n",
275277
"for run_number, scale_factor in zip(reflectivity.keys(), scale_factors, strict=True):\n",
@@ -358,7 +360,7 @@
358360
"from ess.reflectometry.figures import wavelength_z_figure\n",
359361
"\n",
360362
"workflow[Filename[SampleRun]] = runs['608'][Filename[SampleRun]]\n",
361-
"workflow[SampleRotation[SampleRun]] = runs['608'][SampleRotation[SampleRun]]\n",
363+
"workflow[SampleRotationOffset[SampleRun]] = runs['608'][SampleRotationOffset[SampleRun]]\n",
362364
"wavelength_z_figure(\n",
363365
" workflow.compute(Sample),\n",
364366
" wavelength_bins=workflow.compute(WavelengthBins),\n",

docs/user-guide/amor/compare-to-eos.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"# Chopper phase value in the file is wrong, so we set it manually\n",
9797
"workflow[ChopperPhase[ReferenceRun]] = sc.scalar(-7.5, unit='deg')\n",
9898
"# The sample rotation value in the file is slightly off, so we set it manually\n",
99-
"workflow[SampleRotation[ReferenceRun]] = sc.scalar(0.65, unit='deg')\n",
99+
"workflow[SampleRotationOffset[ReferenceRun]] = sc.scalar(0.05, unit='deg')\n",
100100
"workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n",
101101
"\n",
102102
"reference_result = workflow.compute(ReducedReference)\n",
@@ -123,9 +123,9 @@
123123
"results = sc.DataGroup({'ess': sc.DataGroup(), 'psi': sc.DataGroup()})\n",
124124
"\n",
125125
"# ESS results\n",
126-
"for key, angle in mu.items():\n",
126+
"for key in mu:\n",
127127
" print(key, '... ', end='')\n",
128-
" workflow[SampleRotation[SampleRun]] = sc.scalar(angle + 0.05, unit='deg')\n",
128+
" workflow[SampleRotationOffset[SampleRun]] = sc.scalar(0.05, unit='deg')\n",
129129
" workflow[Filename[SampleRun]] = amor.data.amor_run(key)\n",
130130
" da = workflow.compute(ReflectivityOverQ).hist()\n",
131131
" da.coords['Q'] = sc.midpoints(da.coords['Q'], dim='Q')\n",

0 commit comments

Comments
 (0)