Skip to content

Show per-family cluster diagnostics in the fitted plane - #884

Merged
Jammy2211 merged 4 commits into
mainfrom
feature/cluster-family-fit-figures
Nov 24, 2026
Merged

Jammy2211 merged 4 commits into
mainfrom
feature/cluster-family-fit-figures

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A cluster fit now writes a diagnostic figure for each multiply imaged source. The cluster overview and ranked contributions identify the family and image driving a poor fit. The upper-right panels show what the likelihood measures at each image’s own coordinates. The lower-right panel shows where every observation traces back relative to the fitted source centre.

The two whole-cluster fit maps use the same square sky field and family marker shapes. The observed-image map uses the same grayscale stretch as the family diagnostics. Both maps keep critical curves and show each family’s redshift and fitted statistic above the field. The dataset maps use the same field, legend position and family symbols. For twenty families the legend uses four columns and retains all forty observed-image labels in the two-image-per-family example.

The Simple gallery exercises this with the same five-image family in the source plane and image plane. A 0.003″ source offset gives position χ² totals of 88.22 and 86.80, respectively.

Part of the Cluster usability epic. Tracks PyAutoLens #883.

The cluster plotting walkthrough also shares this styling across its positions overlay, image zooms, dataset subplot, critical curves and caustics. Single-analysis visualizers can take an explicit family index for cluster diagnostics.

Standalone point-source overlays use grayscale and share the cluster’s amber observed-position circles. Their linear and wide-field logarithmic stretches retain their previous limits, orientation and coordinates. The per-image χ² and source-plane panels keep their image colours.

API Changes

The combined visualizer writes <family>/fit.png on a full update. For families with more than six observations, further pages are named fit_page_02.png and onward. Set fit_point_dataset.family_fit_single_panel to true for a shared angular detail panel. The cluster positions overlay, zooms and dataset subplot accept optional datasets= metadata for family names and redshifts. See full details below.

Test Plan

  • Rendered the two standalone likelihood examples with grayscale backgrounds and outlined amber observed positions. They refresh ten PNGs and the solver teaching GIF. Both per-image diagnostic PNGs reproduce byte for byte against the previous renderer with the same inputs. A repeat render reproduced all changed gallery assets.

  • Render all four cluster maps for twenty source families and verify forty image IDs, twenty legend entries and non-overlapping legend text. Compare Simple and Abell 2744 walkthrough figures.

  • Full PyAutoLens suite passed with 1,108 passes and one expected failure. The final focused run passed both standalone and cluster marker regressions.

  • The latest targeted downstream smoke passed the multi-dataset plotting workspace script. The cluster Lenstool modeling script passed on the preceding cluster update.

  • Verify source and image positions, per-image statistics for hard and mixture pairings, missing predictions, and the unmatched-model penalty.

  • Compare each new overview against its previous render. Confirm all seven Simple image IDs, the source-plane family scores (88.21557756 and 0.76312077), the matched ±30″ field and reproducible PNG output.

  • Exercise six- and seven-image families, repeated full rankings, and the shared view. Draw the interactive output for both planes through Matplotlib’s show path under Agg.

  • Generate Simple examples from the production combined visualizer and compare both families against the reviewed statistics.

The scoped Heart development gate passed. Its informational findings included the active feature checkout and seven unstaged source changes at the pre-commit check, PyAutoFit five and PyAutoGalaxy two commits behind their respective origins, two workspace manifest discrepancies, a missing current-source release rehearsal, and a 51-hour-old release-push credential check. Gallery readiness comes from its own PR checks.

Full API Changes (for automation & release notes)

Added

  • fit_point_dataset.family_fit_single_panel selects one shared detail panel in the fitted plane. The default is false.

  • PlotterPoint.fit_per_image(..., image=None) accepts an optional image for the cluster overview.

  • Single-analysis VisualizerPoint callbacks accept an optional family_index for cluster-aware rendering. Generic factor-graph child callbacks receive no sibling index and retain their standalone styling. The combined callbacks obtain family identity from their ordered analyses.

Changed behaviour

  • The full and quick combined update now coordinate the framing of fit.png and fit_image_with_points.png. When an observed image is available, PlotterPoint.fit_point_combined and plot_fit_positions accept its optional image_extent to set the map centre and scale. Observed and model positions expand the frame when necessary.

  • VisualizerPoint.visualize_combined uses per-family paths for detailed figures. At most six image zooms appear per page. Multi-page families use descending contributions and stable image IDs.

  • Dataset and fit overviews share the image extent when the image is available. Both fitted overviews report the individual fitted statistic for every family, including the continuous redshift colour scale above eight families. Image-pair mixtures show a log-likelihood statistic.

  • Each combined update reuses one native image-plane solver result per fixed family.

Migration

Read <family>/fit.png for a combined fit previously read from the top-level fit_per_image.png or its split output directory. The existing fit_per_image_combined toggle controls the new files.

Generated by the PyAutoLabs agent workflow.

@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 24, 2026
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_visualization#20

@Jammy2211
Jammy2211 merged commit 7f7ba02 into main Nov 24, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/cluster-family-fit-figures branch November 24, 2026 17:24
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 25, 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.

1 participant