Skip to content

Commit 0473653

Browse files
committed
Minor fixes
1 parent dc5aef9 commit 0473653

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

notebooks/6_scipp/1_exploring-data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"\n",
242242
"- Change the magic parameter `400` in the cell above until pixels fall cleanly into layers, either 4 layers of tubes or 12 layers of straws.\n",
243243
"- Store `layer` as a new coord in `data`.\n",
244-
"- Use `sc.groupby(data, group='layer').sum('spectrum')` to group spectra into layers.\n",
244+
"- Use `data.groupby(group='layer').sum('spectrum')` to group spectra into layers.\n",
245245
"- Inspect and understand the HTML view of the result.\n",
246246
"- Plot the result.\n",
247247
" There are two options:\n",

notebooks/6_scipp/2_working-with-masks.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
" - If something goes wrong, masks can be removed with Python's `del`, e.g., `del data.masks['wrong']`.\n",
9292
" - If you run into an error regarding a length mismatch when inserting the coordinate, remember that `'tof'` is a bin-edge coordinate, i.e., it is by 1 longer than the number of bins.\n",
9393
" Use, e.g., only the left bin edges, i.e., all but the last, to create the masks.\n",
94-
" This can be achieved using slicing, e.g., `array[dim_name, integer_index]`.\n",
94+
" This can be achieved using slicing, e.g., `array[dim_name, start_index:end_index]`.\n",
9595
"2. Use the HTML view and plot the data after masking to explore the effect.\n",
9696
"3. Pass a `dict` containing `counts` (computed above as `counts = data.sum('tof')`) and the equivalent counts computed *after* masking to `sc.plot`.\n",
9797
" Use this to verify that the prompt-pulse mask results in removal of counts.\n",
@@ -201,7 +201,7 @@
201201
"source": [
202202
"theta_edges = sc.array(dims=['theta'], unit='rad', values=np.linspace(0, 0.1, num=100))\n",
203203
"data.coords['theta'] = 0.5 * scn.two_theta(data)\n",
204-
"sc.groupby(data, group='theta', bins=theta_edges).sum('spectrum').plot()"
204+
"data.groupby(group='theta', bins=theta_edges).sum('spectrum').plot()"
205205
]
206206
},
207207
{

solutions/6_scipp/1_exploring-data.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@
481481
"\n",
482482
"- Change the magic parameter `400` in the cell above until pixels fall cleanly into layers, either 4 layers of tubes or 12 layers of straws.\n",
483483
"- Store `layer` as a new coord in `data`.\n",
484-
"- Use `sc.groupby(data, group='layer').sum('spectrum')` to group spectra into layers.\n",
484+
"- Use `data.groupby(group='layer').sum('spectrum')` to group spectra into layers.\n",
485485
"- Inspect and understand the HTML view of the result.\n",
486486
"- Plot the result.\n",
487487
" There are two options:\n",

solutions/6_scipp/2_working-with-masks.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
" - If something goes wrong, masks can be removed with Python's `del`, e.g., `del data.masks['wrong']`.\n",
9292
" - If you run into an error regarding a length mismatch when inserting the coordinate, remember that `'tof'` is a bin-edge coordinate, i.e., it is by 1 longer than the number of bins.\n",
9393
" Use, e.g., only the left bin edges, i.e., all but the last, to create the masks.\n",
94-
" This can be achieved using slicing, e.g., `array[dim_name, integer_index]`.\n",
94+
" This can be achieved using slicing, e.g., `array[dim_name, start_index:end_index]`.\n",
9595
"2. Use the HTML view and plot the data after masking to explore the effect.\n",
9696
"3. Pass a `dict` containing `counts` (computed above as `counts = data.sum('tof')`) and the equivalent counts computed *after* masking to `sc.plot`.\n",
9797
" Use this to verify that the prompt-pulse mask results in removal of counts.\n",
@@ -305,7 +305,7 @@
305305
"source": [
306306
"theta_edges = sc.array(dims=['theta'], unit='rad', values=np.linspace(0, 0.1, num=100))\n",
307307
"data.coords['theta'] = 0.5 * scn.two_theta(data)\n",
308-
"sc.groupby(data, group='theta', bins=theta_edges).sum('spectrum').plot()"
308+
"data.groupby(group='theta', bins=theta_edges).sum('spectrum').plot()"
309309
]
310310
},
311311
{

0 commit comments

Comments
 (0)