Skip to content

test: mesh magnification integration check against simulator truth (arc phase 4a) - #348

Merged
Jammy2211 merged 3 commits into
mainfrom
feature/mesh-magnification-areas
Oct 29, 2026
Merged

Jammy2211 merged 3 commits into
mainfrom
feature/mesh-magnification-areas

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Companion to PyAutoLabs/PyAutoArray#664 (PyAutoArray#659, Source & Cluster arc phase 4a). Merge after the PyAutoArray PR. The tightened tolerances need its exact areas, so smoke against released or main PyAutoArray fails until it merges.

New scripts/imaging/mesh_magnification.py, added to smoke_tests.txt (~40–60 s). For every pixelized mesh (9), it fits a simulated lensed Sersic source and an unlensed copy using the true tracer. It then checks three things:

  • the areas are finite, non-negative and sum to the area the mesh covers;
  • the recovered magnification matches the simulator's truth (lensed 14.2474, identity 1) within a per-mesh tolerance;
  • the workspace formula and the PyAutoLens magnification latent agree.

Tolerances are about 1.5× the measured error, with a 1% floor. With #664, every mesh is within 1% except RTUAdaptDensity lensed (−1.82%, tolerance 3%) and KNearestNeighbor / KNNBarycentric. Those two are known approximations whose fix is phase 4b. The per-mesh table is in the PyAutoArray PR.

🤖 Generated with Claude Code

Jammy2211 and others added 3 commits October 28, 2026 20:42
scripts/imaging/mesh_magnification.py fits a simulated Isothermal+shear lens
(and an identity, no-mass leg) with the true tracer for every mesh, and
asserts areas (finite, >=0, sum = covered domain) and recovered mu vs the
high-resolution simulator truth within measured per-mesh, per-leg
tolerances; also cross-checks the PyAutoLens magnification latent.
Registered in smoke_tests.txt (PyAutoArray#659).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NkVvJhhqNSibeGcBQ
…ar the edge (review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8NkVvJhhqNSibeGcBQ
…act areas

PyAutoArray#659 now gives the adaptive rectangular meshes exact hat-quadrature
areas over the over-sampled data's bounding box. All four recover the true
magnification within 0.61% lensed and 0.49% identity (RTUAdaptDensity lensed
stays -1.82%, unchanged by the areas). Area-sum domain updated to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 6a7990d into main Oct 29, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/mesh-magnification-areas branch October 29, 2026 21:10
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