Skip to content

feat: point positions panels — solver extent, visible markers, noise circles, titles - #786

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/point-dataset-positions-panel
Oct 21, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/point-dataset-positions-panel

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Redraws the point-source "Positions" panels of dataset_point.png and the "Fit Positions" panel of fit.png (closes #785). Before, they were the bare grid scatter: tiny dots, positions clipped at the panel edge, axis labels overlapping the tick labels and no noise shown. Cluster uses the same functions and changes too.

Both panels now:

  • span the PointSolver grid extent (where the model can find images); with no solver they fall back to the fix: point-source critical curves clipped into arcs by a too-small grid #783 critical-curve square, which contains every position. If an observed position lies outside the solver grid the extent grows just enough to contain it, so nothing is ever clipped;
  • have no x (") / y (") labels, only arc-second ticks, and an equal aspect ratio;
  • draw observed positions as large filled markers, each with a circle at its true noise-map radius (never inflated, so at 0.005″ and a ±2.5″ solver grid it is sub-pixel), and always state σ in the legend: Observed (σ = 0.005″);
  • are titled Dataset Positions (point_0) / Fit Positions (point_0) (fluxes panels: Dataset Fluxes (point_0) / Fit Fluxes (point_0)).

The fit panel adds (human-approved decisions 7-10):

  • model positions as red crosses on top;
  • a thin Residual line from each observed position to the model position the fit's own pairing matches it to: Hungarian for FitPositionsImagePair, nearest for FitPositionsImagePairRepeat, the dominant (nearest) term for FitPositionsImagePairAll. Source-plane fits (FitPositionsSource) have no image-plane pairing: their model data are drawn as Model (source plane) with no lines (documented);
  • model images with no observed counterpart as hollow grey crosses (Unmatched model image);
  • critical curves, thin and light (grey tangential, olive radial), so a user without an image still sees them;
  • the centre of every mass profile in the tracer (external shear skipped) as a green + (Mass centre).

Critical curves and the solver extent. critical_curve_grid_from takes an optional solver and enlarges its square to cover the solver grid. Without that, on the cluster (solver ±40″, curve grid ±22″) the tangential curve stopped inside the panel as four broken arcs; now a curve is only ever cut by the panel frame. When the solver grid already lies inside the default square (the galaxy-scale point example) the grid is unchanged. The visualizer uses the enlarged grid for the curves only; the tracer/galaxy plots keep their grid.

API Changes

Additive and backward compatible: solver is optional everywhere.

  • subplot_dataset(..., solver=None), subplot_fit(..., solver=None) (defaults to fit.solver); subplot_fit now draws image_plane_lines and computes them itself when it is given no lines (pass [] for none).
  • PlotterPoint.dataset_point(dataset, solver=None); VisualizerPoint.visualize_before_fit passes analysis.solver.
  • critical_curve_grid_from(..., solver=None).
  • New module autolens.point.plot.positions_panel (the shared panel drawing).
    See full details below.

Test Plan

  • pytest test_autolens/point/plot test_autolens/point/model: new test_positions_panel.py covers solver extent, out-of-grid enlargement, the no-solver fallback containing every position, titles, no axis labels, the σ legend and noise-circle radii, mass centres plotted, critical curves drawn / computed when absent / suppressed with [], each class's pairing, residual lines, unmatched model images, source-plane fits without lines, and the solver-covering curve grid; plus a visualizer solver-threading test.
  • Full pytest test_autolens: 859 passed, 1 xfailed (5m43s); point/plot + point/model: 68 passed.
  • Re-rendered in autolens_visualization (point_source_image_chi_squared, point_source_source_chi_squared, cluster) and reviewed by eye; the PNGs land in the companion workspace PR.
Full API Changes (for automation & release notes)

Added

  • autolens.point.plot.positions_panel: positions_extent_from(positions, solver=None), solver_extent_from(solver), fallback_extent_from(positions, scale=2.0, buffer=0.1), sigma_label_from(noise_map), mass_centres_from(tracer), model_pairing_from(fit_positions), unmatched_model_mask_from(model, indexes), and the drawing helpers plot_observed_positions, plot_critical_curves, plot_mass_centres, plot_fit_model_positions, finish_positions_panel.
  • solver=None keyword on autolens.point.plot.point_dataset_plots.subplot_dataset, autolens.point.plot.fit_point_plots.subplot_fit, PlotterPoint.dataset_point and autolens.lens.plot.critical_curves.critical_curve_grid_from.

Changed

  • Positions panel titles: <name> Positions → Dataset Positions (<name>); <name> Fit Positions → Fit Positions (<name>); fluxes likewise.
  • subplot_fit draws critical curves on the positions panel (previously accepted but ignored) and computes them when none are passed.

Migration

  • None required.

Heart readiness at ship: YELLOW, pre-existing and unrelated, acknowledged by the human ("manifest drift: workspace checkouts — 1 mismatch vs PyAutoMind/repos.yaml"; "release validation stale: source moved since rehearsal (PyAutoArray)").

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…circles, titles (#785)

The dataset and fit "Positions" panels span the PointSolver grid extent
(fallback: the #783 critical-curve square), drop the axis labels, draw
large filled markers with true-radius noise circles and sigma in the
legend, and are titled "Dataset Positions (<name>)" / "Fit Positions
(<name>)". The fit panel adds model positions, residual lines from the
fit's own pairing, unmatched model images, critical curves and mass
centres. critical_curve_grid_from takes an optional solver and covers
its grid, so curves are never broken inside the panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 21, 2026
@Jammy2211
Jammy2211 merged commit d7a14b0 into main Oct 21, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/point-dataset-positions-panel branch October 21, 2026 13:17
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 23, 2026
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.

feat: point positions panels — solver extent, visible markers, noise circles, titles

1 participant