Skip to content

docs: magnification at a point in every source_science.py and the guides (Source & Cluster 5b) - #598

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/point-magnification-workspace-docs
Oct 23, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/point-magnification-workspace-docs

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #596 — Source & Cluster arc phase 5b (epic cluster-strong-lensing). Users can now find magnification at a point in the workspace: every source_science.py gets a __Magnification At A Point__ section (signed mu = 1/det(A) via al.LensCalc.from_tracer(tracer).magnification_2d_via_hessian_from at chosen (y,x) coordinates, sign = image parity, distinct from the flux-ratio / area magnification already computed), guides/lens_calc.py gains the same section, guides/advanced/multi_plane.py cross-references that point fits and ResultPoint select plane_j automatically, and the point-source fit/modeling scripts print the new per-image signed/unsigned accessors from PyAutoLens#798. Coordinates are hand-chosen on the lensed arcs; no forward PointSolver call is added anywhere.

Scripts Changed

  • scripts/imaging/source_science.py, scripts/imaging/features/multi_gaussian_expansion/source_science.py, scripts/imaging/features/pixelization/source_science.py — new __Magnification At A Point__ section + contents bullet (pixelization variant also evaluates at positions.json).
  • scripts/interferometer/source_science.py, scripts/interferometer/features/pixelization/source_science.py — same.
  • scripts/group/source_science.py, scripts/group/features/multi_gaussian_expansion/source_science.py, scripts/group/features/pixelization/source_science.py — same, plus the "every mass profile in the tracer enters the Hessian" comparison against tracer_main_only.
  • scripts/multi_galaxy/source_science.py, scripts/multi_galaxy/features/multi_gaussian_expansion/source_science.py, scripts/multi_galaxy/features/pixelization/source_science.py — same (both deflectors and shear enter the Hessian; pixelization variant compares against tracer_lens_0_only).
  • scripts/guides/lens_calc.py — __Magnification At A Point__ section after __Magnification__ (after __Hessian__), contents bullet, pointer to multi_plane Trap (b).
  • scripts/guides/advanced/multi_plane.py — one paragraph: point fits / ResultPoint apply plane_j automatically.
  • scripts/point_source/fit.py — __Magnification At The Multiple Images__ printing fit.positions.signed_magnifications_at_positions / magnifications_at_positions.
  • scripts/point_source/modeling.py — __Result__ paragraph printing result.signed_magnifications_at_positions / magnifications_at_positions.
  • Regenerated notebooks/ for the 15 scripts; llms-full.txt and workspace_index.json refreshed by the navigator (check_navigator.py passes).

Upstream PR

PyAutoLabs/PyAutoLens#798 — merged, unreleased: the two point_source/ scripts use its new accessors, so this PR waits for the next PyAutoLens release (release-gate: PyAutoLens). The eleven source_science.py scripts and both guides use only released API.

Test Plan

  • All 15 edited scripts run clean via PyAutoHands run_python.py smoke profile (1.9–8.7 s each).
  • Witness greps: 11/11 source_science.py have the section and the magnification_2d_via_hessian_from call; lens_calc.py section after __Hessian__; point_source/fit.py prints both accessors.
  • Curated autolens_workspace smoke list (pyauto-heart smoke autolens): 43/43 PASS against the branch.

Validation checklist (--auto run — plan was not pre-approved)

  • Effective level: safe (header: safe, cap: docs → safe at Difficulty medium)
  • Plan: on the issue (docs: magnification at a point in every source_science.py and the guides (Source & Cluster 5b) #596), written at start, unmodified since
  • Gate: tests n/a (workspace repo, no test dir; 15/15 edited scripts run) · smoke 43/43 PASS (curated autolens list) + 15/15 edited scripts · review CLEAN (independent Fable reviewer, branch authored by Opus; claims: "sign = image parity" → basis-cited lens_calc.py:802-806 signed 1/det_A + run output; "distinct from flux-ratio magnification" → basis-cited placement/values; "Notebooks regenerated" → basis-cited 15/15 cell-source match; "runs clean in smoke mode" → basis-cited 15/15 exit 0) · Heart YELLOW 85 within launch ack (manifest drift 1 mismatch; release validation stale: source moved since rehearsal (PyAutoLens) — acknowledged by the human 2026-10-23)
  • Human: plan sound in hindsight?
  • Human: diff matches plan (no scope creep)?
  • Human: merge, amend, or reject — then log the outcome

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Add a __Magnification At A Point__ section to all eleven source_science.py
scripts (LensCalc.magnification_2d_via_hessian_from at chosen coordinates,
sign = image parity, distinct from the flux-ratio magnification), to
guides/lens_calc.py, a plane_j cross-reference in guides/advanced/multi_plane.py,
and the per-image signed/unsigned magnification accessors in point_source/fit.py
and modeling.py (PyAutoLens#798, pending release). Notebooks regenerated.

Source & Cluster arc phase 5b. Closes #596.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 0f8b4db into main Oct 23, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/point-magnification-workspace-docs branch October 23, 2026 13:06
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.

docs: magnification at a point in every source_science.py and the guides (Source & Cluster 5b)

1 participant