Skip to content

docs: explain jacobian source-plane default; Lenstool example is image-plane - #593

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/positions-source-jacobian-default
Oct 21, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/positions-source-jacobian-default

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

These are the workspace updates for PyAutoLens#792, where FitPositionsSource now defaults to the "jacobian" source-plane weighting.

The scripts now explain the default:

  • What it is: each residual is the distance of the traced point from the source centre, measured in the image-plane noise ellipse via Bᵢ = Aᵢ⁻ᵀΘᵢAᵢ⁻¹.
  • Why it is the default: it is the correct linearised likelihood (Gravity.jl Eq. 46), it stays robust near critical curves, and it costs nothing extra over μ.
  • When to opt into "magnification": only to reproduce analyses that used the scalar form, given its radial bias of about μ² near critical curves.

The full explanation is a new "Source-plane weighting" section in guides/point_source_pairing.py; the other scripts are brief and point to it.

The Lenstool example is also corrected. The Mahler SMACS0723 fit it reproduces uses forme -1, an image-plane χ², so it now uses al.FitPositionsImagePairRepeat. Lenstool's tensor source-plane mode (forme 8) equals our "jacobian"; Lenstool's code never uses the scalar μ² form the old prose attributed to it.

Refs PyAutoLens#791.

Scripts Changed

  • scripts/guides/point_source_pairing.py: new "Source-plane weighting" section (jacobian default, magnification opt-in, Lenstool modes); the option table no longer calls the scalar form "Lenstool's default".
  • scripts/point_source/fit.py: free-centre demo prose describes the jacobian default and points to the guide.
  • scripts/point_source/modeling.py: the tensor-vs-scalar prose is updated for the new default.
  • scripts/cluster/likelihood_function.py: the step-by-step walkthrough is rewritten to the jacobian form (δᵀA⁻ᵀA⁻¹δ/σ², normalisation Σ log((2π)²σ⁴)) so it again matches the library (Match: True); adds an opt-in magnification block.
  • scripts/cluster/lenstool/modeling.py and README.md: switched to al.FitPositionsImagePairRepeat (image-plane, matching forme -1), with corrected Lenstool prose.
  • notebooks/…, llms-full.txt and workspace_index.json: regenerated from the scripts.

Upstream PR

PyAutoLabs/PyAutoLens#792 (merged)

Test Plan

  • Smoke runs of every changed script pass (6/6): fit.py, modeling.py, the pairing guide, likelihood_function.py, lenstool data.py and modeling.py.
  • likelihood_function.py prints Match: True for the source-plane walkthrough.

Not changed here: the image-plane manual check in cluster/likelihood_function.py already disagreed with the library before this PR (manual 26.2 vs library −1.5e5). It is to be filed separately.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LeyZFQHWT1xR4KpejmL4FV

…e-plane

Follow-up to PyAutoLens#792. New 'Source-plane weighting' section in the
pairing guide; likelihood_function walkthrough rewritten to the jacobian form;
lenstool example uses FitPositionsImagePairRepeat (Mahler fit is forme -1).
Notebooks + catalogue regenerated.

Refs PyAutoLabs/PyAutoLens#791

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeyZFQHWT1xR4KpejmL4FV
@Jammy2211
Jammy2211 merged commit e2b5ffc into main Oct 21, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/positions-source-jacobian-default branch October 21, 2026 20:24
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