Skip to content

feat: magnification uncertainty map from posterior draws (LEGGOS Fig. 4) - #693

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/magnification-maps-uncertainty
Nov 2, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/magnification-maps-uncertainty

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #692 (cluster arc phase 8c). Maps the fractional error of the magnification at every image-plane pixel over a set of posterior draws, with the best-fit constant-magnification contours and critical curves on top — the magnification uncertainty map published with cluster lens models (LEGGOS II, arXiv:2606.20804, figure 4). The workspace's source science scripts already draw from the posterior (phase 7b); they now store each draw's magnification map and plot this.

API Changes

Two new public functions in autogalaxy.plot: magnification_fractional_error_2d_from and plot_magnification_uncertainty_2d.
See full details below.

Test Plan

  • test_autogalaxy full suite: 1475 passed
  • Tests: constant draws give zero error; a uniform ±10% spread gives 0.068 (the 16-84 half-range); zero best-fit magnification gives inf; plot writes its file
  • Witness, full run of autolens_workspace imaging/source_science.py (100 draws): median sigma/|mu| 0.23% (|mu| 1-3), 0.50% (3-10), 2.0% (10-30), 8.8% (>30, on the critical curve) — consistent with the run's scalar errors (0.9-1.9%); map shows the low-error plane with a bright ring along the critical curve
Full API Changes (for automation & release notes)

Added

  • autogalaxy.plot.magnification_fractional_error_2d_from(magnification_list, magnification_best) -> Array2D — half the 16th-84th percentile range of |mu| over the draws / |mu_best|; inf where mu_best = 0.
  • autogalaxy.plot.plot_magnification_uncertainty_2d(magnification_list, magnification_best, grid, mass_obj=None, contour_levels=(2, 5, 10, 20, 50, 100), include_critical_curves=True, tangential_critical_curves=None, radial_critical_curves=None, vmin=0.0, vmax=None, title=..., colormap="default", output_path=None, output_filename="magnification_uncertainty_2d", output_format=None, ax=None) — vmax=None caps at the 95th percentile.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

magnification_fractional_error_2d_from gives the per-pixel fractional error
of |mu| over a list of per-draw magnification maps; plot_magnification_uncertainty_2d
maps it with the best-fit constant-mu contours and critical curves
(LEGGOS II figure 4). Arc phase 8c (#692).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Downstream: PyAutoLabs/PyAutoLens#817 → PyAutoLabs/autolens_workspace#616. Merge in that order after this.

@Jammy2211
Jammy2211 merged commit f397c6b into main Nov 2, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/magnification-maps-uncertainty branch November 2, 2026 16:51
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: magnification uncertainty map from posterior draws (arc 8c)

1 participant