Repository navigation
Description
Overview
The point-source "Positions" panels (dataset.png, and the "Fit Positions" panel of fit.png) are still the bare grid scatter: tiny dots, points clipped at the panel edge (axes ±1.5″, images out to ~±2.2″), axis labels overlapping tick labels, and no noise shown. This task redraws both panels around the PointSolver grid extent with large markers, an honest σ noise circle, clear titles, critical curves and mass-profile centres. Cluster shares these functions and changes too.
Plan
- Panel extent = the
PointSolvergrid extent when a solver is available (dataset panel via the visualizer/plotter, fit panel viafit.solver); without one, fall back to the fix: point-source critical curves clipped into arcs by a too-small grid #783 critical-curve region so nothing is clipped. - Remove the
x (")/y (")axis labels. - Large filled markers for observed positions; model positions drawn on top.
- A circle at each position's noise-map radius (never inflated) and σ always in the legend, e.g.
Observed (σ = 0.005″). - Titles
Dataset Positions (point_0)/Fit Positions (point_0). - Fit panel: critical curves (still computed on
critical_curve_grid_from); a curve running past the solver-extent edge is clipped cleanly at the frame. Mass-profile centres of every galaxy in the tracer marked with a distinct marker and aMass centrelegend entry (decision 7). - Residual lines (decision 9): a thin line from each observed position to the model position the fit's own pairing matches it to (Hungarian for
FitPositionsImagePair, nearest forPairRepeat, dominant/nearest term forPairAll); skipped for source-plane chi-squared fits (no image-plane pairing). LegendResidual. - Unmatched model images (decision 10): model positions no observed position pairs to, drawn as hollow grey crosses, legend
Unmatched model image. Out of scope: per-position chi-squared numbers. - Keep the public API backward compatible (
solveroptional). Unit tests for extent, fallback, titles, σ legend and mass centres. - Then re-render autolens_visualization (point_source_image_chi_squared, point_source_source_chi_squared, cluster) in a follow-up workspace PR.
Detailed implementation plan
Work Classification
Both (library first: PyAutoLens; then workspace: autolens_visualization)
Affected Repositories
- PyAutoLens (primary)
- autolens_visualization
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./lens/PyAutoLens | main | clean |
| ./lens/autolens_visualization | main | clean |
Suggested branch: feature/point-dataset-positions-panel
Worktree root: ~/Code/PyAutoLabs-wt/point-dataset-positions-panel/
Implementation Steps
- Add a shared positions-panel helper (extent from solver / fallback, large markers, σ circles + legend, critical-curve overlay, mass centres, no axis labels) used by
autolens/point/plot/point_dataset_plots.pyandautolens/point/plot/fit_point_plots.py. subplot_dataset(..., solver=None);subplot_fit(..., solver=None)defaulting tofit.solver; drawimage_plane_lineson the fit panel.- Thread the solver:
PlotterPoint.dataset_point(dataset, solver=None),VisualizerPoint.visualize_before_fitpassesanalysis.solver. - Tests in
test_autolens/point/plot/andtest_autolens/point/model/. - autolens_visualization: cluster producer passes
solver=todataset_point; re-render the three domains; commit PNGs +GALLERY.md+gallery/viz_manifest.yaml.
Key Files
autolens/point/plot/point_dataset_plots.py— dataset positions panelautolens/point/plot/fit_point_plots.py— fit positions panelautolens/point/model/plotter.py,autolens/point/model/visualizer.py— solver threadingautolens_visualization/scripts/cluster/visualization.py— passes the solver
Original Prompt
Click to expand starting prompt (incl. decisions 7-10 added 2026-10-21)
Point-source positions panels: extent, markers, noise and titles
Consequence: judge
Autonomy: human-required
Issued: 2026-10-21
Issue: #785
@PyAutoLens @autolens_visualization
Origin (2026-10-21, Eyes review of the point_source_* figures in scratch)
point_source_*/visualization/dataset.png is the old bare positions plot:
- the positions are tiny dots
- points are clipped at the top and right edges (axes ±1.5″, images out to ~±2.2″)
- the
x (")/y (")axis labels overlap the tick labels - no noise is shown
The human said "I thought we fixed this but maybe not" and agreed to every point below.
Approved decisions (human, in chat)
-
Extent. The positions panel extent is the PointSolver grid's extent when a solver is available. This ties the figure to where the model can find images; zooming out is acceptable and wanted. With no solver, fall back to the fix: point-source critical curves clipped into arcs by a too-small grid #783 critical-curve region (
critical_curve_grid_from) or the data bounding box plus a margin, so nothing is clipped. -
Axis labels. Remove the
x (")/y (")labels. -
Markers. Use large filled markers for positions.
-
Noise. Draw a circle at the true positions noise-map radius (one isotropic σ per position, so a circle, not error-bar crosses), and always put σ in the legend, e.g.
Observed (σ = 0.005″). At HST noise (0.005″) and the solver extent (~±5″) the circle is sub-pixel. That is honest; never inflate it. -
Titles.
Dataset Positions (point_0); the fit panel isFit Positions (point_0). -
Fit panel. Apply the same treatment to the "Fit Positions" panel of
fit.png, with model positions drawn on top. Cluster domains share these functions and change too. -
Mass centres (scope addition, human, 2026-10-21). The "Fit Positions" panel of
fit.pngalso marks the centre of every mass profile in the fit's tracer (the image-plane lens galaxies; for cluster/group, all of them) with a distinct marker and aMass centrelegend entry, with a test that the centres are plotted. -
Critical curves on the Fit Positions panel (scope addition, human, 2026-10-21) — not only on
fit_image_with_points.png, because a user may not supply an image. Computed withcritical_curve_grid_from(fix: point-source critical curves clipped into arcs by a too-small grid #783); the same deliberate-clipping rule at the solver-extent panel edge applies. Thin and light, so they do not swamp the residual lines. -
Residual lines (scope addition, human, 2026-10-21). A thin line from each observed position to its paired/matched model position, using the pairing the fit's chi-squared actually uses (
FitPositionsImagePair/PairRepeat/PairAlleach by its own matching). Source-plane chi-squared fits have no image-plane pairing: skip the lines and say so in the docstring. Legend entryResidual. -
Unmatched model images (scope addition, human, 2026-10-21). Model positions with no observed counterpart (see
n_unmatched_model_positionsinautolens/point/fit/positions/image/pair_repeat.py) drawn in a distinct style (e.g. hollow grey crosses), legendUnmatched model image.
Explicitly out of scope: per-position chi-squared numbers. Tests cover 8-10, and they are judged visually in the scratch renders (point_source_image_chi_squared shows lines; source_chi_squared must still look right without them; cluster must stay readable).
Critical curves (#783). Keep computing them on critical_curve_grid_from. If a curve runs past the solver-extent panel edge, that clipping is informative (the curve extends beyond the solver grid), but it must look deliberate and not like broken arcs.
Shape
Library first: PyAutoLens autolens/point/plot/point_dataset_plots.py + fit_point_plots.py (+ the plotter/visualizer that knows the solver). Then an autolens_visualization re-render PR (point_source_image_chi_squared, point_source_source_chi_squared, cluster). While iterating, mirror to PYAUTO_EYES_SCRATCH (eyes/autolens/<domain>/) so the human can comment before CI.
Activity
Jammy2211 commentedon Oct 21, 2026
Library PR Created
PyAutoLens: #786 (pending-release). Full
test_autolens: 859 passed, 1 xfailed.Workspace follow-up: autolens_visualization re-render (point_source_image_chi_squared, point_source_source_chi_squared, cluster) on the same branch, plus the cluster producer passing
solver=todataset_pointand computing the fit panel's critical curves.Jammy2211 commentedon Oct 21, 2026
Shipped. Merged via /prm on 2026-10-21, library first. Every CI leg was green: #786 unit tests (3.12, 3.13, nojax) and docs. #11 lint passed on its re-run after #786 merged; the first run failed only on the new
solver=argument, against the old library main.Follow-ups filed in Mind: