Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand All @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 9 additions & 7 deletions scripts/chapter_3_pixelizations/tutorial_3_inversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Loading