Skip to content

feat: combined strong+weak lensing example (weak series step 8) #247

Description

@Jammy2211

Overview

Step 8 of the weak-lensing series: scripts/weak/features/strong_lensing/{simulator,fit,modeling}.py — weak shear as the large-radius complement to strong lensing of the same mass distribution (Niemiec 2020 hybrid-Lenstool; Oguri 2012 SGAS), the science mode this series targets. Everything it needs is merged: AnalysisWeak (#580), the profile/KS plotters (#582), smoke support (#584).

Plan

  • simulator.py: ONE tracer simulated into both an Imaging dataset (central arcs, no lens light) and a WeakDataset (surrounding shear field at larger radii, space-like shape noise) under dataset/weak/strong_lensing/.
  • fit.py: load both, fit with a shared tracer via FitImaging + FitWeak, show the joint log likelihood is the sum; visualize both fits + the shear profile.
  • modeling.py: joint fit via the standard AnalysisFactor/FactorGraphModel API (graph in NumPy mode — the weak factor is NumPy; imaging analysis JAX internally), Nautilus; prose teaches the complementarity (strong pins the Einstein radius/centre, weak constrains the outer profile — the hybrid-Lenstool insight).
  • Auto-simulation via should_simulate; navigator catalogue regenerated in-branch; validation via PYAUTO_TEST_MODE (+ full simulator/fit runs).

Branch: feature/weak-strong-lensing; worktree ~/Code/PyAutoLabs-wt/weak-strong-lensing/ (autolens_workspace only). Autonomy: --auto continuation 2026-07-09, effective supervised — plan-to-issue, park at ship sign-off.

Original Prompt

Click to expand

Combined strong plus weak lensing example. Add autolens_workspace/scripts/weak/features/strong_lensing/ with dedicated simulator.py, fit.py and modeling.py showing weak-lensing shear constraints combined with strong lens modeling of the same mass distribution — the science mode where weak shear is the extra large-radius signal around strong-lens clusters (Niemiec 2020 hybrid-Lenstool, arXiv:2002.04635) and strong-lens groups (Oguri 2012 Sloan Giant Arcs Survey, arXiv:1109.2594), not cosmic shear or galaxy-galaxy lensing. simulator.py simulates the SAME tracer into an imaging dataset (strong) and a surrounding WeakDataset shear field (weak); fit.py fits both with a shared tracer; modeling.py combines AnalysisImaging + AnalysisWeak via PyAutoFit analysis summing to show the joint fit constraining the mass profile better than either alone (parametric core + large-radius shear, the hybrid-Lenstool insight). Depends on AnalysisWeak from feature/weak/4_modeling.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions