|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "fb973780-910e-48c0-9055-672182f300f9", |
| 5 | + "id": "0", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "# Vanadium processing\n", |
|
21 | 21 | { |
22 | 22 | "cell_type": "code", |
23 | 23 | "execution_count": null, |
24 | | - "id": "b38ce909-c9ec-4d75-8060-3b9e3094ef78", |
| 24 | + "id": "1", |
25 | 25 | "metadata": {}, |
26 | 26 | "outputs": [], |
27 | 27 | "source": [ |
|
36 | 36 | }, |
37 | 37 | { |
38 | 38 | "cell_type": "markdown", |
39 | | - "id": "bf03dd14-a096-4cf0-8f0b-c318eb507391", |
| 39 | + "id": "2", |
40 | 40 | "metadata": {}, |
41 | 41 | "source": [ |
42 | 42 | "Use the same parameters as in the main workflow except with more d-spacing bins.\n", |
|
46 | 46 | { |
47 | 47 | "cell_type": "code", |
48 | 48 | "execution_count": null, |
49 | | - "id": "01153a77-1710-41fc-a78c-20a8bae40831", |
| 49 | + "id": "3", |
50 | 50 | "metadata": {}, |
51 | 51 | "outputs": [], |
52 | 52 | "source": [ |
|
70 | 70 | }, |
71 | 71 | { |
72 | 72 | "cell_type": "markdown", |
73 | | - "id": "12ac6517-a73c-493b-b2ce-f7ffe13a2060", |
| 73 | + "id": "4", |
74 | 74 | "metadata": {}, |
75 | 75 | "source": [ |
76 | 76 | "Compute a single vanadium spectrum in d-spacing:" |
|
79 | 79 | { |
80 | 80 | "cell_type": "code", |
81 | 81 | "execution_count": null, |
82 | | - "id": "646a1117-3a71-4893-b2a2-13675cf749c7", |
| 82 | + "id": "5", |
83 | 83 | "metadata": {}, |
84 | 84 | "outputs": [], |
85 | 85 | "source": [ |
|
89 | 89 | { |
90 | 90 | "cell_type": "code", |
91 | 91 | "execution_count": null, |
92 | | - "id": "8de3d6e0-b8ec-4a25-bcb0-b0d2b19b8a61", |
| 92 | + "id": "6", |
93 | 93 | "metadata": {}, |
94 | 94 | "outputs": [], |
95 | 95 | "source": [ |
|
99 | 99 | { |
100 | 100 | "cell_type": "code", |
101 | 101 | "execution_count": null, |
102 | | - "id": "04f7f83c-8608-458d-b4a9-2f9853c09cd7", |
| 102 | + "id": "7", |
103 | 103 | "metadata": {}, |
104 | 104 | "outputs": [], |
105 | 105 | "source": [ |
|
108 | 108 | }, |
109 | 109 | { |
110 | 110 | "cell_type": "markdown", |
111 | | - "id": "84f8b41c-e3f3-4282-83c6-e0e424bc5632", |
| 111 | + "id": "8", |
112 | 112 | "metadata": {}, |
113 | 113 | "source": [ |
114 | 114 | "## Removing coherent scattering peaks\n", |
|
126 | 126 | { |
127 | 127 | "cell_type": "code", |
128 | 128 | "execution_count": null, |
129 | | - "id": "7140935e-8b32-403f-a0d8-e66293819b40", |
| 129 | + "id": "9", |
130 | 130 | "metadata": {}, |
131 | 131 | "outputs": [], |
132 | 132 | "source": [ |
|
137 | 137 | }, |
138 | 138 | { |
139 | 139 | "cell_type": "markdown", |
140 | | - "id": "6e530963-258e-475f-9128-2417bc8d7e24", |
| 140 | + "id": "10", |
141 | 141 | "metadata": {}, |
142 | 142 | "source": [ |
143 | 143 | "We need to histogram the data to perform fits:" |
|
146 | 146 | { |
147 | 147 | "cell_type": "code", |
148 | 148 | "execution_count": null, |
149 | | - "id": "d6bcd10f-130e-43e0-8231-1f0b70e8bc53", |
| 149 | + "id": "11", |
150 | 150 | "metadata": {}, |
151 | 151 | "outputs": [], |
152 | 152 | "source": [ |
|
155 | 155 | }, |
156 | 156 | { |
157 | 157 | "cell_type": "markdown", |
158 | | - "id": "1c4ff398-80d4-4452-92d7-3d3c8d1359dc", |
| 158 | + "id": "12", |
159 | 159 | "metadata": {}, |
160 | 160 | "source": [ |
161 | 161 | "The fits require a bin-center coordinate, so convert from bin-edges:" |
|
164 | 164 | { |
165 | 165 | "cell_type": "code", |
166 | 166 | "execution_count": null, |
167 | | - "id": "e661fda9-1de4-4d26-a8d7-c84cec10decd", |
| 167 | + "id": "13", |
168 | 168 | "metadata": {}, |
169 | 169 | "outputs": [], |
170 | 170 | "source": [ |
|
174 | 174 | }, |
175 | 175 | { |
176 | 176 | "cell_type": "markdown", |
177 | | - "id": "b0bbf51f-307f-43c5-8093-ff6606049a1f", |
| 177 | + "id": "14", |
178 | 178 | "metadata": {}, |
179 | 179 | "source": [ |
180 | 180 | "Perform the fits:" |
|
183 | 183 | { |
184 | 184 | "cell_type": "code", |
185 | 185 | "execution_count": null, |
186 | | - "id": "49f574d8-de6f-4c69-9704-6ce4acb9bdb3", |
| 186 | + "id": "15", |
187 | 187 | "metadata": {}, |
188 | 188 | "outputs": [], |
189 | 189 | "source": [ |
|
192 | 192 | }, |
193 | 193 | { |
194 | 194 | "cell_type": "markdown", |
195 | | - "id": "19251c69-75eb-4dd0-be97-d2272946bacd", |
| 195 | + "id": "16", |
196 | 196 | "metadata": {}, |
197 | 197 | "source": [ |
198 | 198 | "Remove the fitted peaks to obtain the incoherent scattering.\n", |
|
207 | 207 | { |
208 | 208 | "cell_type": "code", |
209 | 209 | "execution_count": null, |
210 | | - "id": "fbcde35f-8608-4ecb-9b6d-67f686d7839a", |
| 210 | + "id": "17", |
211 | 211 | "metadata": {}, |
212 | 212 | "outputs": [], |
213 | 213 | "source": [ |
|
218 | 218 | }, |
219 | 219 | { |
220 | 220 | "cell_type": "markdown", |
221 | | - "id": "6f19a754-c41a-4507-9ac5-a9f68dbab60f", |
| 221 | + "id": "18", |
222 | 222 | "metadata": {}, |
223 | 223 | "source": [ |
224 | 224 | "We can further inspect the results.\n", |
|
251 | 251 | { |
252 | 252 | "cell_type": "code", |
253 | 253 | "execution_count": null, |
254 | | - "id": "0fd4e65a-35b3-4c12-a4ee-24649bda2551", |
| 254 | + "id": "19", |
255 | 255 | "metadata": {}, |
256 | 256 | "outputs": [], |
257 | 257 | "source": [ |
|
277 | 277 | " # The actual data\n", |
278 | 278 | " fig = data.plot(c=\"C0\")\n", |
279 | 279 | " ax = fig.ax\n", |
| 280 | + " xlim = ax.get_xlim()\n", |
| 281 | + " ylim = ax.get_ylim()\n", |
280 | 282 | " removed.plot(ax=ax, c='C2')\n", |
281 | 283 | "\n", |
282 | 284 | " # Initial estimates\n", |
|
314 | 316 | " best_fit.data = result.eval_model(best_fit.coords[best_fit.dim])\n", |
315 | 317 | " best_fit.plot(ax=ax, c=\"C1\", ls=\"-\", marker=\"none\")\n", |
316 | 318 | "\n", |
| 319 | + " ax.set_xlim(xlim)\n", |
| 320 | + " # allocate extra space at the top for annotations\n", |
| 321 | + " ax.set_ylim((ylim[0], ylim[1] * 1.05))\n", |
317 | 322 | " return fig" |
318 | 323 | ] |
319 | 324 | }, |
320 | 325 | { |
321 | 326 | "cell_type": "code", |
322 | 327 | "execution_count": null, |
323 | | - "id": "bee3ae5a-ae4c-41a8-901b-b0fada19504c", |
| 328 | + "id": "20", |
324 | 329 | "metadata": {}, |
325 | 330 | "outputs": [], |
326 | 331 | "source": [ |
|
335 | 340 | { |
336 | 341 | "cell_type": "code", |
337 | 342 | "execution_count": null, |
338 | | - "id": "fa420140-073c-4104-b9aa-990190f9bd4f", |
| 343 | + "id": "21", |
339 | 344 | "metadata": {}, |
340 | 345 | "outputs": [], |
341 | 346 | "source": [ |
|
350 | 355 | }, |
351 | 356 | { |
352 | 357 | "cell_type": "markdown", |
353 | | - "id": "6bab60d1-1ea9-4481-9f5c-1d55423766c7", |
| 358 | + "id": "22", |
354 | 359 | "metadata": {}, |
355 | 360 | "source": [ |
356 | 361 | "The resulting data array `incoherent` can be saved and used in the main workflow [POWGEN_data_reduction](./POWGEN_data_reduction.rst) to replace `FocussedDataDspacing[VanadiumRun]`." |
|
0 commit comments