Repository navigation
docs: explain mesh magnification and check it against truth in pixelization source_science - #606
Merged
Merged
Conversation
…ce scripts Parked behind a PyAutoArray fix: source_plane_mesh_grid is the uniform overlay for adaptive rectangular meshes (see autolens_workspace#605 comment). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…zation source_science - Magnification via Mesh: what `areas_for_magnification` is (each pixel's basis-function integral), how it is computed per mesh, its accuracy, and when to use it over the interpolation grid; points to the `magnification` latent - True Magnification: compute the simulator's true magnification from `tracer.json` and print it beside the estimates - imaging: scale the extra galaxy out of the fit (it was reconstructed as source light) - interferometer: regularization coefficient 0.1 (1.0 over-smoothed the source) - griddata fill_value=0.0 so interpolated sums are not NaN Closes #605 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The four pixelization
source_science.pyexamples computed magnifications that were far from the truth, and their prose named a non-existentmesh_areasattribute. This PR documents the mesh magnification properly and makes the examples give the right answers, checked against each simulated dataset's true magnification (arc phase 4e of epiccluster-strong-lensing, before phase 6).mapper.mesh_geometry.areas_for_magnificationis each pixel's basis-function integral, sosum(reconstruction * areas)is the source's total surface brightness; how the areas are computed per mesh (exact for rectangular + Delaunay, numerical for kNN, ~0.5% approximation for DelaunayNN); accuracy; points to themagnificationlatent. Imaging/interferometer carry the full explanation, group/multi_galaxy a short version pointing to it.tracer.jsonand prints it beside the estimates, and explains that the remaining difference is the reconstruction (regularization smoothing), not the areas.mask_extra_galaxies.fits,invert=True) — its light was being reconstructed as source light (mesh 16.6 vs truth 34.9).griddata(..., fill_value=0.0)on reconstruction interpolations, so interpolated sums are no longerNaN(noise-map interpolation keepsNaNdeliberately).Human prose ruling: describe the calculation as it stands — no "fixed"/"now exact" history; accuracy figures are fine; no PR numbers in user prose.
Upstream PR
PyAutoLabs/PyAutoArray#668 (merged) — true pixel centres for adaptive rectangular meshes (the interpolation route depends on it). The areas text also describes PyAutoArray#664/#666 (merged). All three are pending release: on PyPI 2026.10.29.1 the interpolation route and kNN/adaptive areas give the old answers.
Scripts Changed
scripts/imaging/features/pixelization/source_science.pyscripts/interferometer/features/pixelization/source_science.pyscripts/group/features/pixelization/source_science.pyscripts/multi_galaxy/features/pixelization/source_science.pyautohands generate autolens, unrelated drift reverted),llms-full.txt/workspace_index.jsoncatalogue entriesTest Plan
Full-size datasets,
PYAUTO_TEST_MODE=2, library mains (incl. #668):Before: imaging mesh 16.6 / interp 7.2; interferometer mesh 4.5; group/multi interpolation
NaN.PYAUTO_TEST_MODE=2 PYAUTO_SMALL_DATASETS=1)Heart at ship: STALE — "release validation stale: source moved since rehearsal (PyAutoFit, PyAutoArray, PyAutoGalaxy, PyAutoLens)"; acknowledged by the human, who authorized shipping and merge on green 2026-10-30.
Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code