Skip to content

feat: source-plane magnification maps — mesh and square-pixel - #691

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

Jammy2211 merged 1 commit into
mainfrom
feature/magnification-maps-source-plane

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Cluster arc phase 8b (PyAutoArray#673). The source-plane counterpart of 8a's image-plane map: how much the lens magnifies each region of the source, summed over all of its images.

  • plot_magnification_source_plane(mapper, mass_obj=...) — a pixelized source's mesh coloured by Mapper.mesh_magnification (log colour scale, caustics overlaid).
  • LensCalc.source_plane_magnification_from(mask, ...) + plot_magnification_source_plane_grid(mass_obj, grid, ...) — the same map on square source pixels for parametric / MGE sources: image sub-pixels are traced and their area binned per source pixel.
  • Fix: 8a's plot_magnification_2d showed the config's brightness unit ("e- s^-1") on its colour bar; all three maps now pass cb_unit="".

Depends on PyAutoLabs/PyAutoArray#674 — merge that first.

API Changes

Three new public functions (one LensCalc method, two plot functions); plot_magnification_2d's colour bar no longer shows a unit.
See full details below.

Test Plan

  • test_autogalaxy full suite: 1473 passed (with PyAutoArray#674)
  • Analytic: singular isothermal sphere, source-plane magnification at beta = 0.4/0.6/0.8 matches 2 theta_E / beta within 2% (measured ≤0.7%); area conservation to 1e-10
  • Plot output tests for both maps
  • Rendered on a simulated lens (true mass): mesh (Delaunay, rectangular) and square-pixel maps peak on the caustic with matching structure
Full API Changes (for automation & release notes)

Added

  • LensCalc.source_plane_magnification_from(mask, source_shape_native=(50, 50), source_extent=None, sub_size=16) -> Array2D
  • autogalaxy.plot.plot_magnification_source_plane(mapper, mass_obj=None, grid=None, include_caustics=True, tangential_caustics=None, radial_caustics=None, vmin=None, vmax=None, title=..., colormap="default", output_path=None, output_filename="magnification_source_plane", output_format=None, ax=None)
  • autogalaxy.plot.plot_magnification_source_plane_grid(mass_obj, grid, source_shape_native=(50, 50), source_extent=None, sub_size=16, contour_levels=(2, 5, 10, 20, 50, 100), include_caustics=True, ..., ax=None)

Changed

  • plot_magnification_2d — colour bar no longer appends the config unit.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

LensCalc.source_plane_magnification_from traces image sub-pixels and bins the
image area into square source pixels; plot_magnification_source_plane colours a
reconstruction's mesh by Mapper.mesh_magnification; plot_magnification_source_plane_grid
plots the square-pixel map with constant-mu contours. Also drops the stray
config colour-bar unit from plot_magnification_2d. Arc phase 8b
(PyAutoArray#673).

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

Copy link
Copy Markdown
Collaborator Author

Downstream: PyAutoLabs/PyAutoLens#816, workspace PyAutoLabs/autolens_workspace#615.

@Jammy2211
Jammy2211 merged commit 1800a4e into main Nov 2, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/magnification-maps-source-plane branch November 2, 2026 15:45
@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.

1 participant