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
20 changes: 11 additions & 9 deletions notebooks/chapter_4_pixelizations/tutorial_3_inversions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"from pathlib import Path\n",
"import autogalaxy as ag\n",
"import autogalaxy.plot as aplt\n",
"from autoarray.inversion.plot.inversion_plots import subplot_of_mapper"
"import autoarray.plot as aaplt"
],
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -146,9 +146,7 @@
"source": [
"mask = ag.Mask2D.circular(\n",
" shape_native=dataset.shape_native, pixel_scales=dataset.pixel_scales, radius=2.0\n",
")\n",
"\n",
"aplt.plot_array(array=dataset.data, title=\"Data\", mask=mask)"
")"
],
"outputs": [],
"execution_count": null
Expand All @@ -164,7 +162,9 @@
"cell_type": "code",
"metadata": {},
"source": [
"dataset = dataset.apply_mask(mask=mask)"
"dataset = dataset.apply_mask(mask=mask)\n",
"\n",
"aplt.plot_array(array=dataset.data, title=\"Data\")"
],
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -196,7 +196,7 @@
" regularization=ag.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
"aplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)"
"aaplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)"
],
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -254,8 +254,10 @@
"cell_type": "code",
"metadata": {},
"source": [
"aplt.plot_array(array=inversion.reconstruction_to_native, title=\"Reconstruction\")\n",
"subplot_of_mapper(inversion=inversion, mapper_index=0)"
"aplt.plot_array(\n",
" array=inversion.mapped_reconstructed_operated_data, title=\"Reconstruction\"\n",
")\n",
"aaplt.subplot_of_mapper(inversion=inversion, mapper_index=0)"
],
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -286,7 +288,7 @@
"\n",
"indexes = mapper.slim_indexes_for_pix_indexes(pix_indexes=pix_indexes)\n",
"\n",
"aplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)"
"aaplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)"
],
"outputs": [],
"execution_count": null
Expand Down
16 changes: 9 additions & 7 deletions scripts/chapter_4_pixelizations/tutorial_3_inversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pathlib import Path
import autogalaxy as ag
import autogalaxy.plot as aplt
from autoarray.inversion.plot.inversion_plots import subplot_of_mapper
import autoarray.plot as aaplt

"""
__Initial Setup__
Expand Down Expand Up @@ -67,13 +67,13 @@
shape_native=dataset.shape_native, pixel_scales=dataset.pixel_scales, radius=2.0
)

aplt.plot_array(array=dataset.data, title="Data", mask=mask)

"""
We now create the masked imaging, as we did in the previous tutorial.
"""
dataset = dataset.apply_mask(mask=mask)

aplt.plot_array(array=dataset.data, title="Data")

"""
we again use the rectangular pixelization to create the mapper.

Expand All @@ -93,7 +93,7 @@
regularization=ag.reg.Constant(coefficient=1.0),
)

aplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)
aaplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)

"""
__Pixelization__
Expand All @@ -118,8 +118,10 @@
It is possible for an inversion to have multiple `Mapper`'s, therefore for certain figures we specify the index
of the mapper we wish to plot. In this case, because we only have one mapper we specify the index 0.
"""
aplt.plot_array(array=inversion.reconstruction_to_native, title="Reconstruction")
subplot_of_mapper(inversion=inversion, mapper_index=0)
aplt.plot_array(
array=inversion.mapped_reconstructed_operated_data, title="Reconstruction"
)
aaplt.subplot_of_mapper(inversion=inversion, mapper_index=0)

"""
There we have it, we have successfully reconstructed the galaxy using a rectangular pixel-grid. This has reconstructed
Expand All @@ -139,7 +141,7 @@

indexes = mapper.slim_indexes_for_pix_indexes(pix_indexes=pix_indexes)

aplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)
aaplt.subplot_image_and_mapper(mapper=mapper, image=dataset.data)

"""
These mappings are known before the inversion reconstructs the galaxy, which means before this inversion is performed
Expand Down
Loading