From 0b45229e9da9d56b6c54d6b1511a234c61c44a9f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 17:11:09 +0000 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20rectangular=20mesh=20split=20?= =?UTF-8?q?=E2=80=94=20Bilinear=20default=20(imaging),=20RTU=20advanced/in?= =?UTF-8?q?terferometer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workspace follow-up to PyAutoArray#462 (issue PyAutoArray#461), mirroring the autolens_workspace sweep: - Imaging/multi_dataset examples: RectangularAdaptDensity/AdaptImage -> RectangularBilinearAdaptDensity/AdaptImage (fast CPU default). - Interferometer examples: -> RectangularRTUAdaptDensity/AdaptImage (pure rename of the previous kernel-CDF behaviour). - Mesh-variants docs incl. the Enzi et al. 2026 (arXiv:2606.30620) RTU citation and gradient guidance added to the pixelization likelihood_function.py and README. - Prior configs: rectangular_adapt_*.yaml -> rectangular_rtu_adapt_*.yaml plus new rectangular_bilinear_adapt_*.yaml (same priors). Scripts and configs only — notebooks regenerate at release. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01WtMqU3JfmyJh8GvB7jT4Et --- ...> 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 ++++++++++ .../linear_light_profiles/modeling.py | 2 +- .../imaging/features/pixelization/README.md | 10 +++ scripts/imaging/features/pixelization/fit.py | 4 +- .../pixelization/galaxy_reconstruction.py | 2 +- .../pixelization/likelihood_function.py | 20 +++-- .../imaging/features/pixelization/modeling.py | 10 +-- scripts/imaging/features/pixelization/plot.py | 2 +- .../linear_light_profiles/modeling.py | 2 +- .../pixelization/likelihood_function.py | 2 +- .../features/pixelization/modeling.py | 4 +- 14 files changed, 159 insertions(+), 78 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 e78308a3..903f9637 100644 --- 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 e8878be7..f147e0ec 100644 --- 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 00000000..2bfdb496 --- /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 00000000..c8ae45d6 --- /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/scripts/imaging/features/linear_light_profiles/modeling.py b/scripts/imaging/features/linear_light_profiles/modeling.py index 85657f3e..d7c93ebe 100644 --- a/scripts/imaging/features/linear_light_profiles/modeling.py +++ b/scripts/imaging/features/linear_light_profiles/modeling.py @@ -324,7 +324,7 @@ many light profiles combined in a `Basis` (e.g. `lp_basis.Basis`). - `Mapper`: The linear object used by a `Pixelization` to reconstruct data via an `Inversion`. The `Mapper` - is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularAdaptDensity` + is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularBilinearAdaptDensity` mesh). In this example, the model uses one linear `Sersic` for the galaxy's bulge and one linear `Exponential` for diff --git a/scripts/imaging/features/pixelization/README.md b/scripts/imaging/features/pixelization/README.md index b25f54a3..331f52f4 100644 --- a/scripts/imaging/features/pixelization/README.md +++ b/scripts/imaging/features/pixelization/README.md @@ -18,6 +18,16 @@ the pixelization absorbs whatever the Sersic cannot describe on a flexible pixel - `galaxy_reconstruction`: How to export the pixelized galaxy reconstruction to a .csv file which can be loaded to analyse the reconstruction without PyAutoGalaxy. - `plot`: How to plot pixelized galaxy reconstructions, mappers and mesh grids. +# Rectangular Mesh Variants + +The default adaptive rectangular mesh is `RectangularBilinearAdaptDensity` (with `RectangularBilinearAdaptImage` +its adapt-image counterpart): it warps the grid via the empirical rank CDF of the traced points — no extra +parameters and the fastest rectangular mesh on CPUs. The advanced `RectangularRTUAdaptDensity` / +`RectangularRTUAdaptImage` meshes use a smooth kernel-density CDF instead — the ray-guided transformed uniform +(RTU) grid formulation of Enzi et al. (2026), https://arxiv.org/abs/2606.30620, which should be cited when using +them. Use RTU on GPUs, for gradient-based (JAX) samplers (the Bilinear likelihood has zero gradients at the +default `over_sample_size_pixelization=1` — set it >= 4 or use RTU), and for interferometer gradient fitting. + # Results These scripts only give a brief overview of how to analyse and interpret the results of a pixelization fit. diff --git a/scripts/imaging/features/pixelization/fit.py b/scripts/imaging/features/pixelization/fit.py index e288dd97..d4a03907 100644 --- a/scripts/imaging/features/pixelization/fit.py +++ b/scripts/imaging/features/pixelization/fit.py @@ -187,7 +187,7 @@ of the noise in the data and an unrealistically complex and structured solution. Regularization smooths the reconstruction by penalizing solutions where neighboring pixels have large flux differences. """ -mesh = ag.mesh.RectangularAdaptDensity(shape=mesh_shape) +mesh = ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape) regularization = ag.reg.Constant(coefficient=1.0) pixelization = ag.Pixelization(mesh=mesh, regularization=regularization) @@ -320,7 +320,7 @@ (e.g. `lp_linear.Sersic`) or many light profiles combined in a `Basis` (e.g. `lp_basis.Basis`). - `Mapper`: The linear object used by a `Pixelization` to reconstruct data via an `Inversion`, where the `Mapper` -is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularAdaptDensity` mesh). +is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularBilinearAdaptDensity` mesh). In this example, the bulge is a non-linear `lp.Sersic` so it does not enter the `Inversion`. The only linear object used to fit the data is therefore the pixelization `Mapper`, and `linear_obj_list` contains just one entry: diff --git a/scripts/imaging/features/pixelization/galaxy_reconstruction.py b/scripts/imaging/features/pixelization/galaxy_reconstruction.py index 6c81e7cd..6c507224 100644 --- a/scripts/imaging/features/pixelization/galaxy_reconstruction.py +++ b/scripts/imaging/features/pixelization/galaxy_reconstruction.py @@ -81,7 +81,7 @@ pixelization = af.Model( ag.Pixelization, - mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape), regularization=ag.reg.MaternKernel, ) diff --git a/scripts/imaging/features/pixelization/likelihood_function.py b/scripts/imaging/features/pixelization/likelihood_function.py index 938bbad7..6538ab09 100644 --- a/scripts/imaging/features/pixelization/likelihood_function.py +++ b/scripts/imaging/features/pixelization/likelihood_function.py @@ -2,7 +2,7 @@ __Log Likelihood Function: Pixelization__ This script provides a step-by-step guide of the **PyAutoGalaxy** `log_likelihood_function` which is used to fit -`Imaging` data with a pixelization (specifically a `RectangularAdaptDensity` mesh and `Constant` regularization +`Imaging` data with a pixelization (specifically a `RectangularBilinearAdaptDensity` mesh and `Constant` regularization scheme). The dataset is the `clumpy` galaxy used throughout the pixelization package — a smooth central bulge plus @@ -183,7 +183,7 @@ to reconstruct its star forming clumps. """ pixelization = ag.Pixelization( - mesh=ag.mesh.RectangularAdaptDensity(shape=(30, 30)), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=(30, 30)), regularization=ag.reg.Constant(coefficient=1.0), ) @@ -192,7 +192,7 @@ """ __Galaxy Pixelization and Regularization__ -The galaxy is reconstructed using a pixel-grid, in this example a `RectangularAdaptDensity` mesh, which accounts for +The galaxy is reconstructed using a pixel-grid, in this example a `RectangularBilinearAdaptDensity` mesh, which accounts for irregularities and asymmetries in the galaxy's surface brightness — exactly the kind of clumpy structure visible in this dataset. @@ -333,14 +333,24 @@ We can briefly consider how this step differs for other mesh types. Above, we simply overlaid a uniform rectangular grid to define the reconstruction pixel centres and then mapped image pixels to these reconstruction pixels. -The `RectangularAdaptDensity` mesh pretty much works exactly the same, its just that a calculation (which we don't +The `RectangularBilinearAdaptDensity` mesh pretty much works exactly the same, its just that a calculation (which we don't describe here) works out how to make a grid of rectangular pixels that adapt to the data density and thus vary in size. -There is also a `RectangularAdaptImage` mesh which uses the image of the galaxy to adapt +There is also a `RectangularBilinearAdaptImage` mesh which uses the image of the galaxy to adapt the rectangular pixel sizes. This often puts even smaller pixels in the brightest regions of the galaxy, even if it lies offset or away from the caustic. +The adaptive rectangular meshes come in two variants which differ only in the transform used to warp the +uniform grid: the default `RectangularBilinear` meshes use the empirical rank CDF of the traced points (a sort +and a cumulative sum — no extra parameters, fastest on CPUs), whereas the advanced `RectangularRTU` meshes use +a smooth kernel-density CDF — the ray-guided transformed uniform (RTU) grid formulation of Enzi et al. (2026), +https://arxiv.org/abs/2606.30620, which should be cited when using those meshes (the paper pairs the RTU grid +with a Gaussian-process source prior, whereas these examples use PyAutoGalaxy's own regularization schemes such +as `reg.Constant` / `reg.Adapt`). The RTU meshes are recommended on GPUs and for gradient-based (JAX) samplers: +the Bilinear likelihood is exactly piecewise-constant at the default `over_sample_size_pixelization=1` (zero +gradients) — gradient users set `over_sample_size_pixelization >= 4` or use RTU. + There is also a `Delaunay` mesh which uses a Delaunay triangulation to define an irregular grid of reconstruction pixels. This is described fully in the `delaunay` example including a likelihood function guide. diff --git a/scripts/imaging/features/pixelization/modeling.py b/scripts/imaging/features/pixelization/modeling.py index 538ae2b0..a72a209e 100644 --- a/scripts/imaging/features/pixelization/modeling.py +++ b/scripts/imaging/features/pixelization/modeling.py @@ -10,7 +10,7 @@ - **Asymmetric clumpy star formation** spread irregularly across the galaxy, which no parametric profile (or even a combination of profiles) can fit cleanly. -We therefore use a hybrid model: a linear `Sersic` for the bulge, and a pixelization (with a `RectangularAdaptDensity` +We therefore use a hybrid model: a linear `Sersic` for the bulge, and a pixelization (with a `RectangularBilinearAdaptDensity` mesh and `GaussianKernel` regularization scheme) for the clumpy component. The Sersic captures the smooth bulge with just a handful of parameters; the pixelization reconstructs whatever the Sersic cannot fit on a flexible pixel grid. @@ -128,7 +128,7 @@ - The galaxy's smooth central bulge is fit with a linear `Sersic` light profile. - The galaxy's asymmetric clumpy star formation is reconstructed using a pixelization with a - `RectangularAdaptDensity` mesh and `GaussianKernel` regularization scheme. + `RectangularBilinearAdaptDensity` mesh and `GaussianKernel` regularization scheme. __Start Here Notebook__ @@ -235,7 +235,7 @@ `intensity` is solved for via the same linear inversion that solves for the pixelization reconstruction, removing one non-linear parameter and avoiding the bulge/pixelization brightness degeneracy. - - The galaxy's asymmetric **clumpy star formation** is reconstructed with a 28 x 28 `RectangularAdaptDensity` mesh + - The galaxy's asymmetric **clumpy star formation** is reconstructed with a 28 x 28 `RectangularBilinearAdaptDensity` mesh [0 parameters], regularized with a `GaussianKernel` scheme that smooths the reconstruction [2 parameters]. The number of free parameters and therefore the dimensionality of non-linear parameter space is N=8. @@ -246,7 +246,7 @@ """ pixelization = af.Model( ag.Pixelization, - mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape), regularization=ag.reg.GaussianKernel, ) @@ -366,7 +366,7 @@ """ pixelization = af.Model( ag.Pixelization, - mesh=ag.mesh.RectangularAdaptDensity(shape=mesh_shape), + mesh=ag.mesh.RectangularBilinearAdaptDensity(shape=mesh_shape), regularization=ag.reg.GaussianKernel, ) diff --git a/scripts/imaging/features/pixelization/plot.py b/scripts/imaging/features/pixelization/plot.py index 982870f4..b2c8f598 100644 --- a/scripts/imaging/features/pixelization/plot.py +++ b/scripts/imaging/features/pixelization/plot.py @@ -70,7 +70,7 @@ dataset = dataset.apply_mask(mask=mask) 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/interferometer/features/linear_light_profiles/modeling.py b/scripts/interferometer/features/linear_light_profiles/modeling.py index ef6af3e9..8ea96070 100644 --- a/scripts/interferometer/features/linear_light_profiles/modeling.py +++ b/scripts/interferometer/features/linear_light_profiles/modeling.py @@ -365,7 +365,7 @@ many light profiles combined in a `Basis` (e.g. `lp_basis.Basis`). - `Mapper`: The linear object used by a `Pixelization` to reconstruct data via an `Inversion`. The `Mapper` - is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularAdaptDensity` + is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularRTUAdaptDensity` mesh). In this example, the model uses one linear `Sersic` for the galaxy's bulge and one linear `Exponential` for diff --git a/scripts/interferometer/features/pixelization/likelihood_function.py b/scripts/interferometer/features/pixelization/likelihood_function.py index 73fa2196..c4452cbf 100644 --- a/scripts/interferometer/features/pixelization/likelihood_function.py +++ b/scripts/interferometer/features/pixelization/likelihood_function.py @@ -327,7 +327,7 @@ describe here) works out how to make a grid of rectangular pixels that adapt to the data density and thus vary in size. -There is also a `RectangularAdaptImage` mesh which uses the image of the galaxy to adapt +There is also a `RectangularRTUAdaptImage` mesh which uses the image of the galaxy to adapt the rectangular pixel sizes. This often puts even smaller pixels in the brightest regions of the galaxy, even if it lies offset or away from the caustic. diff --git a/scripts/multi_dataset/features/pixelization/modeling.py b/scripts/multi_dataset/features/pixelization/modeling.py index ac3fccde..fca47345 100644 --- a/scripts/multi_dataset/features/pixelization/modeling.py +++ b/scripts/multi_dataset/features/pixelization/modeling.py @@ -144,7 +144,7 @@ We compose our galaxy model using `Model` objects, which represent the galaxies we fit to our data. In this example we fit a galaxy model where: - - The galaxy's light uses a `RectangularAdaptDensity` meshwhose resolution is free to vary [2 parameters]. + - The galaxy's light uses a `RectangularBilinearAdaptDensity` meshwhose resolution is free to vary [2 parameters]. - This pixelization is regularized using a `Constant` scheme which smooths every pixel equally, where its `regularization_coefficient` varies across the datasets [2 parameter]. @@ -153,7 +153,7 @@ """ pixelization = af.Model( ag.Pixelization, - mesh=af.Model(ag.mesh.RectangularAdaptDensity, shape=mesh_shape), + mesh=af.Model(ag.mesh.RectangularBilinearAdaptDensity, shape=mesh_shape), regularization=ag.reg.Constant, ) From 31b6c43e1cc35e9240ca73737bb2bee7ad93e33e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 17:47:05 +0000 Subject: [PATCH 2/3] chore: regenerate navigator catalogue for the mesh rename llms-full.txt / workspace_index.json regenerated with autohands/regenerate_navigator.py autogalaxy after the Bilinear/RTU class-name sweep (navigator staleness CI check). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01WtMqU3JfmyJh8GvB7jT4Et --- llms-full.txt | 2 +- workspace_index.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llms-full.txt b/llms-full.txt index af19965d..d9b7a7bd 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -61,7 +61,7 @@ AUTO-GENERATED by PyAutoHands — do not edit by hand; regenerate with generate. - Contents: Advantages & Disadvantages, Positive Only Solver, Dataset & Mask, Mesh Shape, Pixelization, Fit, Mask Extra Galaxies, Linear Objects / Grids / Reconstruction - [Pixelization: Galaxy Reconstruction](scripts/imaging/features/pixelization/galaxy_reconstruction.py): A common pixelization use-case is to reconstruct the irregular component of a galaxy's surface brightness on a pixelization mesh, and then export that reconstruction to perform scientific analysis. - Contents: Model Fit, Dataset Auto-Simulation, Reconstruction CSV -- [__Log Likelihood Function: Pixelization__](scripts/imaging/features/pixelization/likelihood_function.py): This script provides a step-by-step guide of the **PyAutoGalaxy** `log_likelihood_function` which is used to fit `Imaging` data with a pixelization (specifically a `RectangularAdaptDensity` mesh and `Constant` regularization scheme). +- [__Log Likelihood Function: Pixelization__](scripts/imaging/features/pixelization/likelihood_function.py): This script provides a step-by-step guide of the **PyAutoGalaxy** `log_likelihood_function` which is used to fit `Imaging` data with a pixelization (specifically a `RectangularBilinearAdaptDensity` mesh and `Constant` regularization scheme). - Contents: Mesh Shape, Dataset, Dataset Auto-Simulation, Mask, Over Sampling, Masked Image Grid, Galaxy, Galaxy Pixelization and Regularization, Interpolation, Mapper, Over Sampling, Alternative Meshes, Mapping Matrix, Blurred Mapping Matrix ($f$), Data Vector (D), Curvature Matrix (F), Regularization Matrix (H), F + Lamdba H, Galaxy Reconstruction (s), Image Reconstruction, Likelihood Function, Chi Squared, Regularization Term, Complexity Terms, Noise Normalization Term, Calculate The Log Likelihood, Fit, Galaxy Modeling, Log Likelihood Function: Pixelization With Light Profile, Wrap Up - [Features: Pixelization Modeling](scripts/imaging/features/pixelization/modeling.py): This is the canonical example of when (and why) you should reach for a pixelization in **PyAutoGalaxy**. - Contents: Advantages & Disadvantages, Positive Only Solver, Dataset & Mask, Pixelization, Model, Search & Analysis, Run Time, Model-Fit, Result, Chaining, Result (Advanced), Wrap Up diff --git a/workspace_index.json b/workspace_index.json index 357344af..64496c06 100644 --- a/workspace_index.json +++ b/workspace_index.json @@ -1496,7 +1496,7 @@ ], "notebook": "notebooks/imaging/features/pixelization/likelihood_function.ipynb", "path": "scripts/imaging/features/pixelization/likelihood_function.py", - "summary": "This script provides a step-by-step guide of the **PyAutoGalaxy** `log_likelihood_function` which is used to fit `Imaging` data with a pixelization (specifically a `RectangularAdaptDensity` mesh and `Constant` regularization scheme).", + "summary": "This script provides a step-by-step guide of the **PyAutoGalaxy** `log_likelihood_function` which is used to fit `Imaging` data with a pixelization (specifically a `RectangularBilinearAdaptDensity` mesh and `Constant` regularization scheme).", "title": "__Log Likelihood Function: Pixelization__" }, { From d3a348f35e6bdc48bc823b700fe1538759d3b461 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 18:39:59 +0000 Subject: [PATCH 3/3] feat: interferometer examples also default to the Bilinear mesh No normal-workspace example uses RTU (user decision): interferometer examples switch to the RectangularBilinear* default, matching imaging; RTU stays documentation-only (gradient/GPU advanced option). Navigator catalogue regenerated. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01WtMqU3JfmyJh8GvB7jT4Et --- .../interferometer/features/linear_light_profiles/modeling.py | 2 +- .../interferometer/features/pixelization/likelihood_function.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/interferometer/features/linear_light_profiles/modeling.py b/scripts/interferometer/features/linear_light_profiles/modeling.py index 8ea96070..f452ae8a 100644 --- a/scripts/interferometer/features/linear_light_profiles/modeling.py +++ b/scripts/interferometer/features/linear_light_profiles/modeling.py @@ -365,7 +365,7 @@ many light profiles combined in a `Basis` (e.g. `lp_basis.Basis`). - `Mapper`: The linear object used by a `Pixelization` to reconstruct data via an `Inversion`. The `Mapper` - is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularRTUAdaptDensity` + is specific to the `Pixelization`'s `Mesh` (e.g. a `RectangularMapper` is used for a `RectangularBilinearAdaptDensity` mesh). In this example, the model uses one linear `Sersic` for the galaxy's bulge and one linear `Exponential` for diff --git a/scripts/interferometer/features/pixelization/likelihood_function.py b/scripts/interferometer/features/pixelization/likelihood_function.py index c4452cbf..c40fa525 100644 --- a/scripts/interferometer/features/pixelization/likelihood_function.py +++ b/scripts/interferometer/features/pixelization/likelihood_function.py @@ -327,7 +327,7 @@ describe here) works out how to make a grid of rectangular pixels that adapt to the data density and thus vary in size. -There is also a `RectangularRTUAdaptImage` mesh which uses the image of the galaxy to adapt +There is also a `RectangularBilinearAdaptImage` mesh which uses the image of the galaxy to adapt the rectangular pixel sizes. This often puts even smaller pixels in the brightest regions of the galaxy, even if it lies offset or away from the caustic.