From 817d59e3aefdb6d3d959d742b1522f97cab61ca0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 20:21:36 +0000 Subject: [PATCH] Rectangular mesh split API update: RectangularAdapt* -> RectangularBilinearAdapt* The HowToGalaxy leg of the mesh-split rollout (PyAutoArray#462 / PyAutoGalaxy#579), mirroring HowToLens#74: chapter-3 scripts + notebooks move to the RectangularBilinearAdapt* workspace defaults, tutorial_5_bayesian_formalism's module-path import of overlay_grid_from follows the file rename to rectangular_rtu_adapt_density, and the prior configs are renamed with RTU twins added (same priors; renamed files normalized to LF). Full local run_smoke.py sweep: 32/32 passed against current library mains. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_015GsUfbCwPd4XC8kpsiUJp7 --- ...> rectangular_bilinear_adapt_density.yaml} | 40 +++++----- ... => rectangular_bilinear_adapt_image.yaml} | 78 +++++++++---------- .../mesh/rectangular_rtu_adapt_density.yaml | 21 +++++ .../mesh/rectangular_rtu_adapt_image.yaml | 40 ++++++++++ .../tutorial_1_pixelizations.ipynb | 16 ++-- .../tutorial_2_mappers.ipynb | 2 +- .../tutorial_3_inversions.ipynb | 4 +- .../tutorial_4_bayesian_regularization.ipynb | 8 +- .../tutorial_5_bayesian_formalism.ipynb | 4 +- .../tutorial_6_model_fit.ipynb | 8 +- .../tutorial_1_pixelizations.py | 16 ++-- .../tutorial_2_mappers.py | 2 +- .../tutorial_3_inversions.py | 4 +- .../tutorial_4_bayesian_regularization.py | 8 +- .../tutorial_5_bayesian_formalism.py | 4 +- .../tutorial_6_model_fit.py | 8 +- 16 files changed, 162 insertions(+), 101 deletions(-) rename config/priors/mesh/{rectangular_adapt_density.yaml => rectangular_bilinear_adapt_density.yaml} (88%) rename config/priors/mesh/{rectangular_adapt_image.yaml => rectangular_bilinear_adapt_image.yaml} (91%) create mode 100644 config/priors/mesh/rectangular_rtu_adapt_density.yaml create mode 100644 config/priors/mesh/rectangular_rtu_adapt_image.yaml diff --git a/config/priors/mesh/rectangular_adapt_density.yaml b/config/priors/mesh/rectangular_bilinear_adapt_density.yaml similarity index 88% rename from config/priors/mesh/rectangular_adapt_density.yaml rename to config/priors/mesh/rectangular_bilinear_adapt_density.yaml index e78308a..903f963 100755 --- a/config/priors/mesh/rectangular_adapt_density.yaml +++ b/config/priors/mesh/rectangular_bilinear_adapt_density.yaml @@ -1,21 +1,21 @@ -RectangularAdaptDensity: - shape_0: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - limits: - lower: 3.0 - upper: inf - shape_1: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - limits: - lower: 3.0 +RectangularBilinearAdaptDensity: + shape_0: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + shape_1: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 upper: inf \ No newline at end of file diff --git a/config/priors/mesh/rectangular_adapt_image.yaml b/config/priors/mesh/rectangular_bilinear_adapt_image.yaml similarity index 91% rename from config/priors/mesh/rectangular_adapt_image.yaml rename to config/priors/mesh/rectangular_bilinear_adapt_image.yaml index e8878be..f147e0e 100755 --- a/config/priors/mesh/rectangular_adapt_image.yaml +++ b/config/priors/mesh/rectangular_bilinear_adapt_image.yaml @@ -1,40 +1,40 @@ -RectangularAdaptImage: - shape_0: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - limits: - lower: 3.0 - upper: inf - shape_1: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - limits: - lower: 3.0 - upper: inf - weight_power: - type : Uniform - lower_limit: 0.0 - upper_limit: 10.0 - width_modifier: - type: Absolute - value: 2.0 - limits: - lower: -100.0 - upper: 100.0 - weight_floor: - type: LogUniform - lower_limit: 0.00001 - upper_limit: 1.0 - width_modifier: - type: Absolute - limits: - lower: 0.0 +RectangularBilinearAdaptImage: + shape_0: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + shape_1: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + weight_power: + type : Uniform + lower_limit: 0.0 + upper_limit: 10.0 + width_modifier: + type: Absolute + value: 2.0 + limits: + lower: -100.0 + upper: 100.0 + weight_floor: + type: LogUniform + lower_limit: 0.00001 + upper_limit: 1.0 + width_modifier: + type: Absolute + limits: + lower: 0.0 upper: inf \ No newline at end of file diff --git a/config/priors/mesh/rectangular_rtu_adapt_density.yaml b/config/priors/mesh/rectangular_rtu_adapt_density.yaml new file mode 100644 index 0000000..2bfdb49 --- /dev/null +++ b/config/priors/mesh/rectangular_rtu_adapt_density.yaml @@ -0,0 +1,21 @@ +RectangularRTUAdaptDensity: + shape_0: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + shape_1: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf \ No newline at end of file diff --git a/config/priors/mesh/rectangular_rtu_adapt_image.yaml b/config/priors/mesh/rectangular_rtu_adapt_image.yaml new file mode 100644 index 0000000..c8ae45d --- /dev/null +++ b/config/priors/mesh/rectangular_rtu_adapt_image.yaml @@ -0,0 +1,40 @@ +RectangularRTUAdaptImage: + shape_0: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + shape_1: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + limits: + lower: 3.0 + upper: inf + weight_power: + type : Uniform + lower_limit: 0.0 + upper_limit: 10.0 + width_modifier: + type: Absolute + value: 2.0 + limits: + lower: -100.0 + upper: 100.0 + weight_floor: + type: LogUniform + lower_limit: 0.00001 + upper_limit: 1.0 + width_modifier: + type: Absolute + limits: + lower: 0.0 + upper: inf \ No newline at end of file diff --git a/notebooks/chapter_3_pixelizations/tutorial_1_pixelizations.ipynb b/notebooks/chapter_3_pixelizations/tutorial_1_pixelizations.ipynb index 3b417d9..596e005 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_1_pixelizations.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_1_pixelizations.ipynb @@ -102,7 +102,7 @@ "There are multiple `Mesh`'s available in **PyAutoGalaxy**. For now, we'll keep it simple and use a rectangular\n", "grid, whose `shape` defines its $(y,x)$ dimensions. We will make it the same shape as the 2D grid.\n", "\n", - "The `RectangularAdaptDensity` mesh adapts its pixels to the density of the masked image-plane\n", + "The `RectangularBilinearAdaptDensity` mesh adapts its pixels to the density of the masked image-plane\n", "grid via the ray-guided transformed uniform (RTU) grid formulation of Enzi et al. (2026)\n", "(https://arxiv.org/abs/2606.30620), which should be cited in published work using this mesh.\n", "Note that whereas that paper pairs the RTU grid with a Gaussian-process prior, **PyAutoGalaxy**\n", @@ -113,7 +113,7 @@ "cell_type": "code", "metadata": {}, "source": [ - "mesh = ag.mesh.RectangularAdaptDensity(shape=(100, 100))" + "mesh = ag.mesh.RectangularBilinearAdaptDensity(shape=(100, 100))" ], "outputs": [], "execution_count": null @@ -186,7 +186,7 @@ "metadata": {}, "source": [ "plot_mapper(\n", - " mapper=mapper, title=\"Fairly Boring Grid2D of RectangularAdaptDensity Pixels\"\n", + " mapper=mapper, title=\"Fairly Boring Grid2D of RectangularBilinearAdaptDensity Pixels\"\n", ")" ], "outputs": [], @@ -204,11 +204,11 @@ "cell_type": "code", "metadata": {}, "source": [ - "print(\"RectangularAdaptDensity Grid2D Pixel Centre 1:\")\n", + "print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 1:\")\n", "print(mapper.source_plane_mesh_grid[0])\n", - "print(\"RectangularAdaptDensity Grid2D Pixel Centre 2:\")\n", + "print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 2:\")\n", "print(mapper.source_plane_mesh_grid[1])\n", - "print(\"RectangularAdaptDensity Grid2D Pixel Centre 3:\")\n", + "print(\"RectangularBilinearAdaptDensity Grid2D Pixel Centre 3:\")\n", "print(mapper.source_plane_mesh_grid[2])\n", "print(\"etc.\")" ], @@ -271,13 +271,13 @@ "plot_mapper(\n", " mapper=mapper,\n", " mesh_grid=mapper.source_plane_data_grid,\n", - " title=\"Even less Boring Grid2D of RectangularAdaptDensity Pixels\",\n", + " title=\"Even less Boring Grid2D of RectangularBilinearAdaptDensity Pixels\",\n", ")\n", "\n", "plot_mapper(\n", " mapper=mapper,\n", " mesh_grid=mapper.source_plane_data_grid,\n", - " title=\"Zoomed Grid2D of RectangularAdaptDensity Pixels\",\n", + " title=\"Zoomed Grid2D of RectangularBilinearAdaptDensity Pixels\",\n", ")" ], "outputs": [], diff --git a/notebooks/chapter_3_pixelizations/tutorial_2_mappers.ipynb b/notebooks/chapter_3_pixelizations/tutorial_2_mappers.ipynb index d126e91..3dbba70 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_2_mappers.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_2_mappers.ipynb @@ -163,7 +163,7 @@ "cell_type": "code", "metadata": {}, "source": [ - "mesh = ag.mesh.RectangularAdaptDensity(\n", + "mesh = ag.mesh.RectangularBilinearAdaptDensity(\n", " shape=(dataset.shape_native[0] / 2, dataset.shape_native[1] / 2)\n", ")\n", "\n", diff --git a/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb b/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb index ae38c66..d75c2bd 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_3_inversions.ipynb @@ -182,7 +182,7 @@ "cell_type": "code", "metadata": {}, "source": [ - "mesh = ag.mesh.RectangularAdaptDensity(shape=(25, 25))\n", + "mesh = ag.mesh.RectangularBilinearAdaptDensity(shape=(25, 25))\n", "\n", "pixelization = ag.Pixelization(mesh=mesh)\n", "\n", @@ -332,7 +332,7 @@ "metadata": {}, "source": [ "pixelization = ag.Pixelization(\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=(25, 25)),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(25, 25)),\n", " regularization=ag.reg.Constant(coefficient=1.0),\n", ")\n", "\n", diff --git a/notebooks/chapter_3_pixelizations/tutorial_4_bayesian_regularization.ipynb b/notebooks/chapter_3_pixelizations/tutorial_4_bayesian_regularization.ipynb index daf9ab3..a86fd46 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_4_bayesian_regularization.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_4_bayesian_regularization.ipynb @@ -182,7 +182,7 @@ "metadata": {}, "source": [ "pixelization = ag.Pixelization(\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)),\n", " regularization=ag.reg.Constant(coefficient=1.0),\n", ")\n", "\n", @@ -213,7 +213,7 @@ "metadata": {}, "source": [ "pixelization = ag.Pixelization(\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)),\n", " regularization=ag.reg.Constant(coefficient=0.01),\n", ")\n", "\n", @@ -260,7 +260,7 @@ "metadata": {}, "source": [ "pixelization = ag.Pixelization(\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)),\n", " regularization=ag.reg.Constant(coefficient=100.0),\n", ")\n", "\n", @@ -382,7 +382,7 @@ "metadata": {}, "source": [ "pixelization = ag.Pixelization(\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)),\n", " regularization=ag.reg.Constant(coefficient=1.0),\n", ")\n", "\n", diff --git a/notebooks/chapter_3_pixelizations/tutorial_5_bayesian_formalism.ipynb b/notebooks/chapter_3_pixelizations/tutorial_5_bayesian_formalism.ipynb index 22e869b..c892263 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_5_bayesian_formalism.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_5_bayesian_formalism.ipynb @@ -239,7 +239,7 @@ "to 20 x 20 = 400 mesh pixels.\n", "\n", "We use the `RectangularUniform` mesh, where all rectangular mesh pixels have the same size, rather than the\n", - "`RectangularAdaptDensity` mesh used in the previous tutorials. The uniform mesh keeps the geometry simple, and every\n", + "`RectangularBilinearAdaptDensity` mesh used in the previous tutorials. The uniform mesh keeps the geometry simple, and every\n", "equation below applies unchanged to the adaptive meshes -- only the mesh pixel centres move.\n", "\n", "By default, mesh pixels at the edge of the mesh are forced to solutions of zero flux by the linear algebra solver.\n", @@ -326,7 +326,7 @@ "cell_type": "code", "metadata": {}, "source": [ - "from autoarray.inversion.mesh.mesh.rectangular_adapt_density import overlay_grid_from\n", + "from autoarray.inversion.mesh.mesh.rectangular_rtu_adapt_density import overlay_grid_from\n", "\n", "mesh_grid = overlay_grid_from(\n", " shape_native=mesh_shape, grid=masked_dataset.grids.pixelization\n", diff --git a/notebooks/chapter_3_pixelizations/tutorial_6_model_fit.ipynb b/notebooks/chapter_3_pixelizations/tutorial_6_model_fit.ipynb index 5d9dfe6..d9e2b6b 100644 --- a/notebooks/chapter_3_pixelizations/tutorial_6_model_fit.ipynb +++ b/notebooks/chapter_3_pixelizations/tutorial_6_model_fit.ipynb @@ -243,7 +243,7 @@ "\n", " - The galaxy's disk is an `Exponential` [0 parameters: parameters fixed from search 1].\n", "\n", - " - Residual galaxy structure is reconstructed using a `RectangularAdaptDensity` mesh with a fixed 28 x 28\n", + " - Residual galaxy structure is reconstructed using a `RectangularBilinearAdaptDensity` mesh with a fixed 28 x 28\n", " shape [0 parameters].\n", "\n", " - This pixelization is regularized using a `GaussianKernel` scheme [2 parameters].\n", @@ -260,7 +260,7 @@ "source": [ "pixelization = af.Model(\n", " ag.Pixelization,\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n", " regularization=ag.reg.GaussianKernel,\n", ")\n", "\n", @@ -305,7 +305,7 @@ "\n", " - The galaxy's disk is an `Sersic` [7 parameters: priors initialized from search 1].\n", "\n", - " - Residual galaxy structure uses a `RectangularAdaptDensity` mesh with a fixed 28 x 28 shape [0 parameters].\n", + " - Residual galaxy structure uses a `RectangularBilinearAdaptDensity` mesh with a fixed 28 x 28 shape [0 parameters].\n", "\n", " - This pixelization is regularized using a `GaussianKernel` scheme [2 parameters].\n", "\n", @@ -332,7 +332,7 @@ "\n", "pixelization = af.Model(\n", " ag.Pixelization,\n", - " mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape),\n", + " mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape),\n", " regularization=ag.reg.GaussianKernel,\n", ")\n", "\n", diff --git a/scripts/chapter_3_pixelizations/tutorial_1_pixelizations.py b/scripts/chapter_3_pixelizations/tutorial_1_pixelizations.py index becc81e..39501bf 100644 --- a/scripts/chapter_3_pixelizations/tutorial_1_pixelizations.py +++ b/scripts/chapter_3_pixelizations/tutorial_1_pixelizations.py @@ -37,13 +37,13 @@ There are multiple `Mesh`'s available in **PyAutoGalaxy**. For now, we'll keep it simple and use a rectangular grid, whose `shape` defines its $(y,x)$ dimensions. We will make it the same shape as the 2D grid. -The `RectangularAdaptDensity` mesh adapts its pixels to the density of the masked image-plane +The `RectangularBilinearAdaptDensity` mesh adapts its pixels to the density of the masked image-plane grid via the ray-guided transformed uniform (RTU) grid formulation of Enzi et al. (2026) (https://arxiv.org/abs/2606.30620), which should be cited in published work using this mesh. Note that whereas that paper pairs the RTU grid with a Gaussian-process prior, **PyAutoGalaxy** instead uses its own regularization schemes, introduced later in this chapter. """ -mesh = ag.mesh.RectangularAdaptDensity(shape=(100, 100)) +mesh = ag.mesh.RectangularBilinearAdaptDensity(shape=(100, 100)) """ We now pass the mesh to a `Pixelization`. @@ -72,18 +72,18 @@ By plotting our mapper, we now see our `Pixelization`. Its a fairly boring grid of rectangular pixels. """ plot_mapper( - mapper=mapper, title="Fairly Boring Grid2D of RectangularAdaptDensity Pixels" + mapper=mapper, title="Fairly Boring Grid2D of RectangularBilinearAdaptDensity Pixels" ) """ However, the `Mapper` does contain lots of interesting information about our `Pixelization`, for example its pixelization_grid tells us where the pixel centers are located. """ -print("RectangularAdaptDensity Grid2D Pixel Centre 1:") +print("RectangularBilinearAdaptDensity Grid2D Pixel Centre 1:") print(mapper.source_plane_mesh_grid[0]) -print("RectangularAdaptDensity Grid2D Pixel Centre 2:") +print("RectangularBilinearAdaptDensity Grid2D Pixel Centre 2:") print(mapper.source_plane_mesh_grid[1]) -print("RectangularAdaptDensity Grid2D Pixel Centre 3:") +print("RectangularBilinearAdaptDensity Grid2D Pixel Centre 3:") print(mapper.source_plane_mesh_grid[2]) print("etc.") @@ -113,13 +113,13 @@ plot_mapper( mapper=mapper, mesh_grid=mapper.source_plane_data_grid, - title="Even less Boring Grid2D of RectangularAdaptDensity Pixels", + title="Even less Boring Grid2D of RectangularBilinearAdaptDensity Pixels", ) plot_mapper( mapper=mapper, mesh_grid=mapper.source_plane_data_grid, - title="Zoomed Grid2D of RectangularAdaptDensity Pixels", + title="Zoomed Grid2D of RectangularBilinearAdaptDensity Pixels", ) """ diff --git a/scripts/chapter_3_pixelizations/tutorial_2_mappers.py b/scripts/chapter_3_pixelizations/tutorial_2_mappers.py index 3f45623..9cf4fd4 100644 --- a/scripts/chapter_3_pixelizations/tutorial_2_mappers.py +++ b/scripts/chapter_3_pixelizations/tutorial_2_mappers.py @@ -71,7 +71,7 @@ We will make its pixelization resolution half that of the grid above. """ -mesh = ag.mesh.RectangularAdaptDensity( +mesh = ag.mesh.RectangularBilinearAdaptDensity( shape=(dataset.shape_native[0] / 2, dataset.shape_native[1] / 2) ) diff --git a/scripts/chapter_3_pixelizations/tutorial_3_inversions.py b/scripts/chapter_3_pixelizations/tutorial_3_inversions.py index 0bfb324..1341621 100644 --- a/scripts/chapter_3_pixelizations/tutorial_3_inversions.py +++ b/scripts/chapter_3_pixelizations/tutorial_3_inversions.py @@ -79,7 +79,7 @@ (Ignore the regularization input below for now, we will cover this in the next tutorial). """ -mesh = ag.mesh.RectangularAdaptDensity(shape=(25, 25)) +mesh = ag.mesh.RectangularBilinearAdaptDensity(shape=(25, 25)) pixelization = ag.Pixelization(mesh=mesh) @@ -174,7 +174,7 @@ galaxies. """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(25, 25)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(25, 25)), regularization=ag.reg.Constant(coefficient=1.0), ) diff --git a/scripts/chapter_3_pixelizations/tutorial_4_bayesian_regularization.py b/scripts/chapter_3_pixelizations/tutorial_4_bayesian_regularization.py index 90234a1..6ba2aef 100644 --- a/scripts/chapter_3_pixelizations/tutorial_4_bayesian_regularization.py +++ b/scripts/chapter_3_pixelizations/tutorial_4_bayesian_regularization.py @@ -91,7 +91,7 @@ def perform_fit_with_galaxy(dataset, galaxy): Okay, so lets look at our fit from the previous tutorial in more detail. """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)), regularization=ag.reg.Constant(coefficient=1.0), ) @@ -111,7 +111,7 @@ def perform_fit_with_galaxy(dataset, galaxy): 1.0. If we reduce this `coefficient` to 0.01, the galaxy reconstruction goes *very* weird. """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)), regularization=ag.reg.Constant(coefficient=0.01), ) @@ -147,7 +147,7 @@ def perform_fit_with_galaxy(dataset, galaxy): So, what happens if we apply a high value for the regularization coefficient? """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)), regularization=ag.reg.Constant(coefficient=100.0), ) @@ -236,7 +236,7 @@ def perform_fit_with_galaxy(dataset, galaxy): from the value above by changing these parameters, I've set you up with a code to do so below. """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(50, 50)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(50, 50)), regularization=ag.reg.Constant(coefficient=1.0), ) diff --git a/scripts/chapter_3_pixelizations/tutorial_5_bayesian_formalism.py b/scripts/chapter_3_pixelizations/tutorial_5_bayesian_formalism.py index 3ad56f8..bf53cab 100644 --- a/scripts/chapter_3_pixelizations/tutorial_5_bayesian_formalism.py +++ b/scripts/chapter_3_pixelizations/tutorial_5_bayesian_formalism.py @@ -141,7 +141,7 @@ to 20 x 20 = 400 mesh pixels. We use the `RectangularUniform` mesh, where all rectangular mesh pixels have the same size, rather than the -`RectangularAdaptDensity` mesh used in the previous tutorials. The uniform mesh keeps the geometry simple, and every +`RectangularBilinearAdaptDensity` mesh used in the previous tutorials. The uniform mesh keeps the geometry simple, and every equation below applies unchanged to the adaptive meshes -- only the mesh pixel centres move. By default, mesh pixels at the edge of the mesh are forced to solutions of zero flux by the linear algebra solver. @@ -190,7 +190,7 @@ We compute these by overlaying a uniform rectangular grid over the masked image grid, sized so the mesh fully contains the masked region without wasted edge pixels beyond it. """ -from autoarray.inversion.mesh.mesh.rectangular_adapt_density import overlay_grid_from +from autoarray.inversion.mesh.mesh.rectangular_rtu_adapt_density import overlay_grid_from mesh_grid = overlay_grid_from( shape_native=mesh_shape, grid=masked_dataset.grids.pixelization diff --git a/scripts/chapter_3_pixelizations/tutorial_6_model_fit.py b/scripts/chapter_3_pixelizations/tutorial_6_model_fit.py index de01cec..adb1a22 100644 --- a/scripts/chapter_3_pixelizations/tutorial_6_model_fit.py +++ b/scripts/chapter_3_pixelizations/tutorial_6_model_fit.py @@ -146,7 +146,7 @@ - The galaxy's disk is an `Exponential` [0 parameters: parameters fixed from search 1]. - - Residual galaxy structure is reconstructed using a `RectangularAdaptDensity` mesh with a fixed 28 x 28 + - Residual galaxy structure is reconstructed using a `RectangularBilinearAdaptDensity` mesh with a fixed 28 x 28 shape [0 parameters]. - This pixelization is regularized using a `GaussianKernel` scheme [2 parameters]. @@ -158,7 +158,7 @@ """ pixelization = af.Model( ag.Pixelization, - mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape), regularization=ag.reg.GaussianKernel, ) @@ -197,7 +197,7 @@ - The galaxy's disk is an `Sersic` [7 parameters: priors initialized from search 1]. - - Residual galaxy structure uses a `RectangularAdaptDensity` mesh with a fixed 28 x 28 shape [0 parameters]. + - Residual galaxy structure uses a `RectangularBilinearAdaptDensity` mesh with a fixed 28 x 28 shape [0 parameters]. - This pixelization is regularized using a `GaussianKernel` scheme [2 parameters]. @@ -219,7 +219,7 @@ pixelization = af.Model( ag.Pixelization, - mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape), regularization=ag.reg.GaussianKernel, )