Overview
Cluster lenses need visualization that galaxy-scale plots don't provide: arcminute fields of view, tens of mass components, multiple source planes each with their own critical curves and caustics, and per-source multiple-image identification at a glance. A prototype exists (autolens_workspace_test/scripts/cluster/visualization.py, bespoke matplotlib) and PyAutoMind's cluster tracker carries a deferred "aplt plotter promotion" item this task subsumes. Autonomy: supervised --auto, in-session one-shot ship authorization (user directive 2026-07-08); Brain research-first suggestion overridden — scope is defined by the prompt + prototype.
Plan
- New
autolens/cluster/plot/ package of module-level aplt helpers (the shipped autolens/weak/plot/ pattern), re-exported into aplt:
plot_positions_overlay(...) — full-field log-norm image, per-source coloured observed positions, lens/member markers, optional kpc scale bar.
plot_image_group_zooms(...) — per-source zoom-panel grid sized to each image group.
plot_critical_curves(...) — tangential (+ radial) critical curves for every source plane of a multi-plane tracer, per-plane colours + legend (galaxy-scale defaults assume one source plane).
plot_caustics(...) — the corresponding per-plane caustics in source-plane coordinates.
subplot_cluster_dataset(...) — combined mosaic.
- Per-plane curves computed via the existing
LensCalc multi-plane machinery (use_multi_plane=True, plane_j=j) — no new solver code; numpy-path only (critical-curve solvers are not vmap-safe; documented).
- Sensible large-FoV defaults: marching-grid resolution guidance for arcminute fields, marker sizes, line weights (from the prototype's cluster-tuned values).
- Unit tests in
test_autolens/cluster/plot/ (numpy-only, direct module imports per the weak-plot precedent, Agg backend, tmp-path outputs).
- Rewrite
autolens_workspace_test/scripts/cluster/visualization.py to consume the promoted aplt helpers, keeping its file-existence assertions (companion PR, library-first merge order).
Affected Repositories
- PyAutoLens (primary) — parallel to the frozen
dpie-lenstool-param claim (its diff = docs/api/mass.rst only; disjoint)
- autolens_workspace_test — parallel to the frozen
dpie-lenstool-param claim (its diff = scripts/cluster/lenstool_parity.py; disjoint)
Suggested branch: feature/cluster-visualization · Worktree: ~/Code/PyAutoLabs-wt/cluster-visualization/
Original Prompt
Click to expand starting prompt
$(cat PyAutoMind/feature/cluster/9_cluster_visualization.md)
Overview
Cluster lenses need visualization that galaxy-scale plots don't provide: arcminute fields of view, tens of mass components, multiple source planes each with their own critical curves and caustics, and per-source multiple-image identification at a glance. A prototype exists (
autolens_workspace_test/scripts/cluster/visualization.py, bespoke matplotlib) and PyAutoMind's cluster tracker carries a deferred "aplt plotter promotion" item this task subsumes. Autonomy: supervised--auto, in-session one-shot ship authorization (user directive 2026-07-08); Brain research-first suggestion overridden — scope is defined by the prompt + prototype.Plan
autolens/cluster/plot/package of module-level aplt helpers (the shippedautolens/weak/plot/pattern), re-exported intoaplt:plot_positions_overlay(...)— full-field log-norm image, per-source coloured observed positions, lens/member markers, optional kpc scale bar.plot_image_group_zooms(...)— per-source zoom-panel grid sized to each image group.plot_critical_curves(...)— tangential (+ radial) critical curves for every source plane of a multi-plane tracer, per-plane colours + legend (galaxy-scale defaults assume one source plane).plot_caustics(...)— the corresponding per-plane caustics in source-plane coordinates.subplot_cluster_dataset(...)— combined mosaic.LensCalcmulti-plane machinery (use_multi_plane=True, plane_j=j) — no new solver code; numpy-path only (critical-curve solvers are not vmap-safe; documented).test_autolens/cluster/plot/(numpy-only, direct module imports per the weak-plot precedent, Agg backend, tmp-path outputs).autolens_workspace_test/scripts/cluster/visualization.pyto consume the promoted aplt helpers, keeping its file-existence assertions (companion PR, library-first merge order).Affected Repositories
dpie-lenstool-paramclaim (its diff =docs/api/mass.rstonly; disjoint)dpie-lenstool-paramclaim (its diff =scripts/cluster/lenstool_parity.py; disjoint)Suggested branch:
feature/cluster-visualization· Worktree:~/Code/PyAutoLabs-wt/cluster-visualization/Original Prompt
Click to expand starting prompt
$(cat PyAutoMind/feature/cluster/9_cluster_visualization.md)