diff --git a/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb b/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb index 952769c..ae3629b 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb @@ -139,7 +139,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Lets create an annular mask which traces the strongly lensed source's ring of light." + "Lets create an annular mask which traces the strongly lensed source's ring of light, and apply it to the dataset." ] }, { @@ -153,8 +153,24 @@ " outer_radius=2.8,\n", ")\n", "\n", - "\n", - "aplt.plot_array(array=dataset.data, title=\"Data\")" + "dataset = dataset.apply_mask(mask=mask)" + ], + "outputs": [], + "execution_count": null + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now the mask is applied, plotting the data draws it over the image, letting us check the annulus traces the ring of\n", + "lensed source light." + ] + }, + { + "cell_type": "code", + "metadata": {}, + "source": [ + "aplt.plot_array(array=dataset.data, title=\"Image Data With Mask Applied\")" ], "outputs": [], "execution_count": null @@ -170,8 +186,6 @@ "cell_type": "code", "metadata": {}, "source": [ - "dataset = dataset.apply_mask(mask=mask)\n", - "\n", "lens_galaxy = al.Galaxy(\n", " redshift=0.5,\n", " mass=al.mp.Isothermal(\n", @@ -355,11 +369,10 @@ " outer_radius=3.2,\n", ")\n", "\n", - "\n", - "aplt.plot_array(array=dataset.data, title=\"Data\")\n", - "\n", "dataset = dataset.apply_mask(mask=mask)\n", "\n", + "aplt.plot_array(array=dataset.data, title=\"Image Data With Mask Applied\")\n", + "\n", "lens_galaxy = al.Galaxy(\n", " redshift=0.5,\n", " mass=al.mp.Isothermal(\n", diff --git a/scripts/chapter_3_pixelizations/tutorial_3_inversions.py b/scripts/chapter_3_pixelizations/tutorial_3_inversions.py index d84d4dc..0e06b3b 100644 --- a/scripts/chapter_3_pixelizations/tutorial_3_inversions.py +++ b/scripts/chapter_3_pixelizations/tutorial_3_inversions.py @@ -64,7 +64,7 @@ ) """ -Lets create an annular mask which traces the strongly lensed source's ring of light. +Lets create an annular mask which traces the strongly lensed source's ring of light, and apply it to the dataset. """ mask = al.Mask2D.circular_annular( shape_native=dataset.shape_native, @@ -73,14 +73,17 @@ outer_radius=2.8, ) +dataset = dataset.apply_mask(mask=mask) -aplt.plot_array(array=dataset.data, title="Data") +""" +Now the mask is applied, plotting the data draws it over the image, letting us check the annulus traces the ring of +lensed source light. +""" +aplt.plot_array(array=dataset.data, title="Image Data With Mask Applied") """ We now create the masked source-plane grid via the tracer, as we did in the previous tutorial. """ -dataset = dataset.apply_mask(mask=mask) - lens_galaxy = al.Galaxy( redshift=0.5, mass=al.mp.Isothermal( @@ -187,11 +190,10 @@ outer_radius=3.2, ) - -aplt.plot_array(array=dataset.data, title="Data") - dataset = dataset.apply_mask(mask=mask) +aplt.plot_array(array=dataset.data, title="Image Data With Mask Applied") + lens_galaxy = al.Galaxy( redshift=0.5, mass=al.mp.Isothermal(