Repository navigation
Description
Overview
Third slice (8c) of phase 8 of the cluster strong-lensing arc: the magnification uncertainty map of LEGGOS II figure 4. Each image-plane pixel shows the fractional error of its magnification over the posterior draws that phase 7b added to every source science script, with the best-fit constant-magnification contours on top, so a reader sees where the lens model pins the magnification down and where it does not (near the critical curves).
Plan
- PyAutoGalaxy: a function returning the per-pixel fractional magnification error from a list of per-draw magnification maps and the best-fit map, and a plot of it with the best-fit contours and critical curves (8a conventions), colour range capped because the error diverges on the critical curves.
- PyAutoLens: export through
aplt. - Workspace: in all 11
source_science.pyscripts the existing draw loop also stores each draw's magnification map, and a new section plots the uncertainty map. - Witness: one full run of the imaging example (100 draws); no full runs of the other ten.
Tier: judge — merge mode: human /prm (PyAutoGalaxy → PyAutoLens → autolens_workspace).
Detailed implementation plan
Affected Repositories
- PyAutoGalaxy (primary)
- PyAutoLens
- autolens_workspace
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoGalaxy | main | clean |
| ./PyAutoLens | main | clean |
| ./autolens_workspace | main | clean |
Suggested branch: feature/magnification-maps-uncertainty
Implementation Steps
autogalaxy/galaxy/plot/galaxies_plots.py(beside 8a'splot_magnification_2d):magnification_fractional_error_2d_from(magnification_list, magnification_best) -> Array2Dandplot_magnification_uncertainty_2d(magnification_list, magnification_best, grid, mass_obj=None, contour_levels=(2, 5, 10, 20, 50, 100), include_critical_curves=True, vmin=0.0, vmax=None, ...); export; tests (constant draws → zero error; known spread → known fraction; plot output).autolens/plot/__init__.pyexport; tracer test.- autolens_workspace, all 11
source_science.py: inside the 7b draw loop,magnification_map_list.append(lens_calc.magnification_2d_from(grid=map_grid))on a coarse grid; new__Magnification Uncertainty Map__section using the max-likelihood tracer for the best-fit map;regenerate_navigator.py autolens; smoke all 11. - Full run of
scripts/imaging/source_science.pyfor the witness.
Key Files
autogalaxy/galaxy/plot/galaxies_plots.py—plot_magnification_2d,_magnification_contoursautogalaxy/operate/lens_calc.py—magnification_2d_fromautolens_workspace/scripts/*/source_science.pyand*/features/*/source_science.py—__Posterior Draws__
Original Prompt
Click to expand starting prompt
Magnification maps 8c: LEGGOS Fig-4 fractional magnification uncertainty map
Type: feature
Target: PyAutoGalaxy
Repos:
- PyAutoGalaxy
- PyAutoLens
- autolens_workspace
Themes: - visualization
- cluster
Epic: cluster-strong-lensing
Phase: 8c
Parent: draft/feature/autolens/magnification_maps_visualization.md
Difficulty: medium
Autonomy: supervised
Priority: high
Status: formalised
Consequence: judge
Review-minutes: 25
Unattended: no
Filed: 2026-11-02
Context
Slice of phase 8. Per image pixel sigma_mu/|mu_best| over the phase-7b posterior draws (each draw → 8a mu map), with
the best-fit constant-mu contours overlaid, as LEGGOS II Fig. 4. Library helper only if the draw loop proves reusable.
Workspace: source_science scripts (start with imaging). Witness: map renders from 100 draws on imaging simple.
Original request (human, 2026-11-02)
start 8c
yes go ahead, all 11 scripts
Approved plan (2026-11-02)
- PyAutoGalaxy:
magnification_fractional_error_2d_from(magnification_list, magnification_best)(half the 16-84
percentile range of |mu| over the draws / |mu_best| per pixel) andplot_magnification_uncertainty_2d( magnification_list, magnification_best, grid, mass_obj=None, ...)— fractional-error map, colour range capped
(diverges on the critical curves), best-fit constant-mu contours via the 8a helper, optional critical curves. - PyAutoLens: aplt export + test.
- autolens_workspace: all 11 source_science.py scripts — the 7b draw loop also stores each draw's mu map (coarser
grid), new__Magnification Uncertainty Map__section; catalogue regen; smoke all 11. - Witness: one full run of imaging/source_science.py (100 draws); report fractional errors away from the critical
curves next to 7b's 1-2% scalar errors. No full runs of the other 10 (human 2026-11-02: end-to-end runs overkill).
Activity
Jammy2211 commentedon Nov 2, 2026
PRs open (judge tier, human /prm, merge in this order):
magnification_fractional_error_2d_from,plot_magnification_uncertainty_2d(test_autogalaxy 1475 passed)apltexports (1021 passed)Witness (full imaging run, 100 draws): median sigma/|mu| 0.23% / 0.50% / 2.0% / 8.8% for |mu| in 1-3 / 3-10 / 10-30 / >30. Heart STALE acknowledged by the human 2026-11-02.
Jammy2211 commentedon Nov 2, 2026
Shipped
Merged in order:
f397c6b2) —magnification_fractional_error_2d_from,plot_magnification_uncertainty_2d03ab1f82) —apltexportsLibrary PRs pending release. Next in phase 8: 8d (fit-subplot wiring + the "make them pretty" pass).
🤖 Generated with Claude Code