|
100 | 100 | "source": [ |
101 | 101 | "workflow[Filename[ReferenceRun]] = amor.data.amor_run(614)\n", |
102 | 102 | "# 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", |
104 | 104 | "\n", |
105 | 105 | "reference_result = workflow.compute(ReducedReference)\n", |
106 | 106 | "# Set the result back onto the pipeline to cache it\n", |
|
167 | 167 | " '608': {\n", |
168 | 168 | " # The sample rotation values in the files are slightly off, so we replace\n", |
169 | 169 | " # 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", |
171 | 171 | " Filename[SampleRun]: amor.data.amor_run(608),\n", |
172 | 172 | " },\n", |
173 | 173 | " '609': {\n", |
174 | | - " SampleRotation[SampleRun]: sc.scalar(2.25, unit='deg'),\n", |
| 174 | + " SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n", |
175 | 175 | " Filename[SampleRun]: amor.data.amor_run(609),\n", |
176 | 176 | " },\n", |
177 | 177 | " '610': {\n", |
178 | | - " SampleRotation[SampleRun]: sc.scalar(3.65, unit='deg'),\n", |
| 178 | + " SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n", |
179 | 179 | " Filename[SampleRun]: amor.data.amor_run(610),\n", |
180 | 180 | " },\n", |
181 | 181 | " '611': {\n", |
182 | | - " SampleRotation[SampleRun]: sc.scalar(5.05, unit='deg'),\n", |
| 182 | + " SampleRotationOffset[SampleRun]: sc.scalar(0.05, unit='deg'),\n", |
183 | 183 | " Filename[SampleRun]: amor.data.amor_run(611),\n", |
184 | 184 | " },\n", |
185 | 185 | "}\n", |
186 | 186 | "\n", |
187 | 187 | "\n", |
188 | 188 | "reflectivity = {}\n", |
189 | 189 | "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", |
193 | 194 | "\n", |
194 | 195 | "sc.plot(reflectivity, norm='log', vmin=1e-4)" |
195 | 196 | ] |
|
267 | 268 | "# Start by computing the `ReflectivityData` for each of the files\n", |
268 | 269 | "diagnostics = {}\n", |
269 | 270 | "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", |
273 | 275 | "\n", |
274 | 276 | "# Scale the results using the scale factors computed earlier\n", |
275 | 277 | "for run_number, scale_factor in zip(reflectivity.keys(), scale_factors, strict=True):\n", |
|
358 | 360 | "from ess.reflectometry.figures import wavelength_z_figure\n", |
359 | 361 | "\n", |
360 | 362 | "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", |
362 | 364 | "wavelength_z_figure(\n", |
363 | 365 | " workflow.compute(Sample),\n", |
364 | 366 | " wavelength_bins=workflow.compute(WavelengthBins),\n", |
|
0 commit comments