Repository navigation
Description
Overview
Sum overlapping galaxy contributions in Galaxy and Lens. Verify mixed-galaxy images, saved output and adaptive-image consumers for in-memory and array-free fits. Check the imaging equivalent.
Approved plan
Reproduce on main and fix on feature/mixed-galaxy-light. Run the regression checks below. Leave PRs open for maintainer review.
Original prompt
Development details and acceptance criteria
Interferometer galaxy_image_dict drops a mixed galaxy's ordinary light (dict merge overwrites)
Type: bug
Target: PyAutoGalaxy
Repos:
- PyAutoGalaxy
- PyAutoLens
Themes: - interferometer
- adapt-images
Autonomy: supervised
Priority: medium
Status: draft
Filed: 2026-10-01
Difficulty: small
Consequence: judge
Witness: for one galaxy withbulge=ag.lp.Sersic(intensity=0.1)anddisk=ag.lp_linear.Gaussian(sigma=1.0)fitted tointerferometer_7(in-memory and array-free),fit.galaxy_image_dict[galaxy]equals the bulge image plus the linear reconstruction (rel 1e-8 tofit.model_image_naturalfor a single-galaxy fit),fits_galaxy_imageswrites that sum, andResultInterferometer.adapt_images_from()receives it; theFitImagingmirror is checked and either confirmed correct or fixed the same way.
Review-minutes: 4
Unattended: ready
Lane: any
Source: Codex gpt-6-astra review of the streaming P4 branch (feat: array-free fits with ordinary light profiles via the data-term identity (streaming P4) PyAutoArray#598), 2026-10-01 — three independent runs, same finding; pre-existing on main, newly reachable for array-free ordinary-light fits.
What
ag.FitInterferometer.galaxy_image_dict (autogalaxy/interferometer/fit_interferometer.py ~L537-540) and the
al.FitInterferometer mirror (autolens/interferometer/fit_interferometer.py ~L388) build the per-galaxy image dict
by unpacking the ordinary-light dict and the linear-object dict: {**galaxy_image_dict, **galaxy_linear_dict}
(or equivalent). A galaxy that appears in both — an ordinary profile plus a linear light profile, Basis/MGE or
pixelization — has its ordinary image replaced by the linear reconstruction instead of summed. For images
p (ordinary) and s (linear) the dict holds s, not p + s.
Consumers: ResultInterferometer.adapt_images_from() via model_image_galaxy_dict (adaptive meshes/regularisation
get incomplete morphology), fits_galaxy_images output. model_image_natural (P3) is unaffected because it sums
profile_image + mapped_reconstructed_data directly — the P3 Codex finding fixed only that path.
Plan
- Reproduce with the witness galaxy on main (in-memory): assert
galaxy_image_dict[g] == bulge image + linear image
fails; checkFitImaging.galaxy_model_image_dictfor the same merge. - Fix: sum per galaxy when a key is in both dicts (
dictcomprehension over the union of keys), both libraries. - Tests: mixed-galaxy
galaxy_image_dictin ag and al interferometer fit tests (in-memory and array-free), plus
an adapt-images test if cheap.
Activity
Jammy2211 commentedon Nov 22, 2026
Open for maintainer review:
Mixed ordinary plus linear images now agree with the total, including saved images and adaptive inputs. The latest Galaxy and Lens sources passed 107 and 75 focused tests. The broad local suites ran before the final cache migration and Lens helper refactoring. The Galaxy change also repairs old mixed-light caches.
Jammy2211 commentedon Nov 22, 2026
Shipped
Imaging and interferometer per-galaxy images now add ordinary and reconstructed light. Saved images and adaptive images receive the sum. Obsolete mixed-light caches refresh. Dense, array-free and imaging witnesses passed in both libraries.