diff --git a/notebooks/6_scipp/1_exploring-data.ipynb b/notebooks/6_scipp/1_exploring-data.ipynb index e7e6a54..99bf750 100644 --- a/notebooks/6_scipp/1_exploring-data.ipynb +++ b/notebooks/6_scipp/1_exploring-data.ipynb @@ -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", diff --git a/notebooks/6_scipp/2_working-with-masks.ipynb b/notebooks/6_scipp/2_working-with-masks.ipynb index a6e88ce..a4c4c75 100644 --- a/notebooks/6_scipp/2_working-with-masks.ipynb +++ b/notebooks/6_scipp/2_working-with-masks.ipynb @@ -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", @@ -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()" ] }, { diff --git a/solutions/6_scipp/1_exploring-data.ipynb b/solutions/6_scipp/1_exploring-data.ipynb index e045280..9f701b7 100644 --- a/solutions/6_scipp/1_exploring-data.ipynb +++ b/solutions/6_scipp/1_exploring-data.ipynb @@ -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", diff --git a/solutions/6_scipp/2_working-with-masks.ipynb b/solutions/6_scipp/2_working-with-masks.ipynb index fddf1ac..3c4bb26 100644 --- a/solutions/6_scipp/2_working-with-masks.ipynb +++ b/solutions/6_scipp/2_working-with-masks.ipynb @@ -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", @@ -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()" ] }, {