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
11 changes: 10 additions & 1 deletion notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,17 @@
"cell_type": "code",
"metadata": {},
"source": [
"# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a\n",
"# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is\n",
"# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.\n",
"mesh_shape = (\n",
" al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" else (40, 40)\n",
")\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,17 @@
"cell_type": "code",
"metadata": {},
"source": [
"# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a\n",
"# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is\n",
"# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.\n",
"mesh_shape = (\n",
" al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" else (40, 40)\n",
")\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -227,7 +236,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=0.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -300,7 +309,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=100.0),\n",
")\n",
"\n",
Expand Down Expand Up @@ -422,7 +431,7 @@
"metadata": {},
"source": [
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
11 changes: 10 additions & 1 deletion notebooks/chapter_3_pixelizations/tutorial_6_borders.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,17 @@
"cell_type": "code",
"metadata": {},
"source": [
"# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a\n",
"# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is\n",
"# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.\n",
"mesh_shape = (\n",
" al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE\n",
" else (40, 40)\n",
")\n",
"\n",
"pixelization = al.Pixelization(\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),\n",
" mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n",
" regularization=al.reg.Constant(coefficient=1.0),\n",
")\n",
"\n",
Expand Down
11 changes: 10 additions & 1 deletion scripts/chapter_3_pixelizations/tutorial_3_inversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,17 @@
giving the source galaxy a light profile, we simply pass it a `Pixelization` and regularization, and pass it to a
tracer.
"""
# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a
# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is
# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.
mesh_shape = (
al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
else (40, 40)
)

pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=1.0),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,17 @@ def perform_fit_with_source_galaxy(dataset, source_galaxy):

Okay, so lets look at our fit from the previous tutorial in more detail. we'll use a higher resolution 40 x 40 grid.
"""
# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a
# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is
# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.
mesh_shape = (
al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
else (40, 40)
)

pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=1.0),
)

Expand All @@ -126,7 +135,7 @@ def perform_fit_with_source_galaxy(dataset, source_galaxy):
1.0. If we reduce this `coefficient` to zero, the source reconstruction goes *very* weird.
"""
pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=0.0),
)

Expand Down Expand Up @@ -177,7 +186,7 @@ def perform_fit_with_source_galaxy(dataset, source_galaxy):
So, what happens if we apply a high value for the regularization coefficient?
"""
pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=100.0),
)

Expand Down Expand Up @@ -266,7 +275,7 @@ def perform_fit_with_source_galaxy(dataset, source_galaxy):
from the value above by changing these parameters, I've set you up with a code to do so below.
"""
pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=1.0),
)

Expand Down
11 changes: 10 additions & 1 deletion scripts/chapter_3_pixelizations/tutorial_6_borders.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,17 @@ def perform_fit_with_source_galaxy_mask_and_border(

Note how we control the border via the `al.Settings` object's `use_border_relocator` input.
"""
# `PYAUTO_SMALL_DATASETS=1` (the CI smoke harness) caps the data to a 16 x 16 image, where a
# 40 x 40 mesh reconstructs 1600 source pixels from a few dozen image pixels. The mesh is
# capped alongside the data; a normal full-resolution run keeps the 40 x 40 grid described above.
mesh_shape = (
al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
if dataset.shape_native == al.util.dataset.SMALL_DATASETS_SHAPE_NATIVE
else (40, 40)
)

pixelization = al.Pixelization(
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=(40, 40)),
mesh=al.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),
regularization=al.reg.Constant(coefficient=1.0),
)

Expand Down
Loading