Skip to content

feat: Mapper.mesh_magnification — source-plane magnification per mesh pixel - #674

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

Closes #673 (cluster arc phase 8b, with PyAutoGalaxy / PyAutoLens / autolens_workspace PRs to follow). A pixelized source's mesh now gives the magnification of every pixel: the image-plane area that maps to it divided by its source-plane area (phase 4's areas_for_magnification), i.e. how much the lens magnifies that region of the source summed over all its images. It is what PyAutoGalaxy's new plot_magnification_source_plane colours the mesh by.

API Changes

Mapper.data_pixel_area_for_pix_from() was a stub returning None; it now returns the image-plane area per mesh pixel. New Mapper.mesh_magnification property. plot_inversion_reconstruction gains an optional cb_unit.
See full details below.

Test Plan

  • test_autoarray full suite: 2287 passed, 4 xfailed
  • New test_mesh_magnification.py (identity lens, every mesh): image areas sum to the mask area (1e-10) and sum(mesh_magnification * areas) gives it back; interior pixels have mu ~ 1 within per-mesh tolerances set ~2x the measured value (documented in the module, e.g. Delaunay 2.9e-3, RectangularUniform 9.1e-4; DelaunayNN 9.2e-2 is a documented approximation — dual areas vs Sibson weights); zero-area pixels give zero
  • No-JAX leg emulated locally (KNN cases skip)
  • Witness (simulated lens, true mass, scratch script): mesh mu vs forward-traced square-pixel truth averaged over each mesh pixel's area — median per-pixel agreement 1.2% (RectangularBilinearAdaptDensity) and 3.9% (Delaunay), median ratio 0.99 (no bias); totals exact
Full API Changes (for automation & release notes)

Added

  • Mapper.mesh_magnification (property) — data_pixel_area_for_pix_from() / mesh_geometry.areas_for_magnification, zero where either is zero.
  • plot_inversion_reconstruction(..., cb_unit=None) — unit on the middle colour-bar label; "" shows none.

Changed

  • Mapper.data_pixel_area_for_pix_from() — implemented (was pass): column sums of mapping_matrix times the image pixel area.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

data_pixel_area_for_pix_from (previously a stub) returns the image-plane area
mapping to each pixel; mesh_magnification divides it by the mesh's
areas_for_magnification. plot_inversion_reconstruction gains cb_unit.
Arc phase 8b (#673).

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

Copy link
Copy Markdown
Collaborator Author

Downstream: PyAutoLabs/PyAutoGalaxy#691 → PyAutoLabs/PyAutoLens#816 → PyAutoLabs/autolens_workspace#615. Merge in that order after this.

@Jammy2211
Jammy2211 merged commit c012fa6 into main Nov 2, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/magnification-maps-source-plane branch November 2, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: source-plane magnification maps per mesh pixel (arc 8b)

1 participant