Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeybrock committed Sep 30, 2021
1 parent dc5aef9 commit 0473653
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion notebooks/6_scipp/1_exploring-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"\n",
"- 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",
"- Store `layer` as a new coord in `data`.\n",
"- Use `sc.groupby(data, group='layer').sum('spectrum')` to group spectra into layers.\n",
"- Use `data.groupby(group='layer').sum('spectrum')` to group spectra into layers.\n",
"- Inspect and understand the HTML view of the result.\n",
"- Plot the result.\n",
" There are two options:\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/6_scipp/2_working-with-masks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
" - If something goes wrong, masks can be removed with Python's `del`, e.g., `del data.masks['wrong']`.\n",
" - 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",
" Use, e.g., only the left bin edges, i.e., all but the last, to create the masks.\n",
" This can be achieved using slicing, e.g., `array[dim_name, integer_index]`.\n",
" This can be achieved using slicing, e.g., `array[dim_name, start_index:end_index]`.\n",
"2. Use the HTML view and plot the data after masking to explore the effect.\n",
"3. Pass a `dict` containing `counts` (computed above as `counts = data.sum('tof')`) and the equivalent counts computed *after* masking to `sc.plot`.\n",
" Use this to verify that the prompt-pulse mask results in removal of counts.\n",
Expand Down Expand Up @@ -201,7 +201,7 @@
"source": [
"theta_edges = sc.array(dims=['theta'], unit='rad', values=np.linspace(0, 0.1, num=100))\n",
"data.coords['theta'] = 0.5 * scn.two_theta(data)\n",
"sc.groupby(data, group='theta', bins=theta_edges).sum('spectrum').plot()"
"data.groupby(group='theta', bins=theta_edges).sum('spectrum').plot()"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion solutions/6_scipp/1_exploring-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
"\n",
"- 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",
"- Store `layer` as a new coord in `data`.\n",
"- Use `sc.groupby(data, group='layer').sum('spectrum')` to group spectra into layers.\n",
"- Use `data.groupby(group='layer').sum('spectrum')` to group spectra into layers.\n",
"- Inspect and understand the HTML view of the result.\n",
"- Plot the result.\n",
" There are two options:\n",
Expand Down
4 changes: 2 additions & 2 deletions solutions/6_scipp/2_working-with-masks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
" - If something goes wrong, masks can be removed with Python's `del`, e.g., `del data.masks['wrong']`.\n",
" - 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",
" Use, e.g., only the left bin edges, i.e., all but the last, to create the masks.\n",
" This can be achieved using slicing, e.g., `array[dim_name, integer_index]`.\n",
" This can be achieved using slicing, e.g., `array[dim_name, start_index:end_index]`.\n",
"2. Use the HTML view and plot the data after masking to explore the effect.\n",
"3. Pass a `dict` containing `counts` (computed above as `counts = data.sum('tof')`) and the equivalent counts computed *after* masking to `sc.plot`.\n",
" Use this to verify that the prompt-pulse mask results in removal of counts.\n",
Expand Down Expand Up @@ -305,7 +305,7 @@
"source": [
"theta_edges = sc.array(dims=['theta'], unit='rad', values=np.linspace(0, 0.1, num=100))\n",
"data.coords['theta'] = 0.5 * scn.two_theta(data)\n",
"sc.groupby(data, group='theta', bins=theta_edges).sum('spectrum').plot()"
"data.groupby(group='theta', bins=theta_edges).sum('spectrum').plot()"
]
},
{
Expand Down

0 comments on commit 0473653

Please sign in to comment.