Skip to content

feat: fit.png switch for the interpolated source panel - #864

Merged
Jammy2211 merged 4 commits into
mainfrom
feature/delaunay-interpolated-plot
Nov 18, 2026
Merged

Jammy2211 merged 4 commits into
mainfrom
feature/delaunay-interpolated-plot

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of PyAutoLabs/PyAutoArray#700 (Discussion PyAutoLabs/.github#46). Merge PyAutoLabs/PyAutoArray#701 first: this PR uses the interpolated= argument it adds to plot_mapper.

New plots.yaml key: fit: subplot_fit_source_interpolated, default true. It only changes the layout when the source is a Delaunay or kNN pixelization:

  • Source column (right-hand column, top to bottom): "Source Plane (Max Zoom)" (panel 3), then the middle panel (panel 7), then "Source Plane (No Zoom)" (panel 11, always bottom right).
    • With the key on and a Delaunay/kNN source, the middle panel is "Source Plane (Interpolated)": the reconstruction the likelihood uses, over the max-zoom extent, so it compares directly with panel 3.
    • Otherwise (key false, or a rectangular or parametric source) it is "Source Plane (Mid Zoom)".
  • Imaging: this applies to both fit.png and fit_log10.png.
  • Interferometer fit.png (3×4): "Dirty Signal-To-Noise Map" is removed and "Dirty Model Image" moves to panel 2, so it has the same source column as imaging, in every case. Its source panels now share one colour scale. The array-free 2×3 layout keeps zoomed + no zoom and adds the interpolated view in its empty last panel.
  • The imaging and interferometer fit plotters read the key with should_plot, including for quick updates and the per-plane fit_<i>.png.

API Changes

Added only:

  • subplot_fit(..., source_interpolated=True) in both autolens.imaging.plot.fit_imaging_plots and autolens.interferometer.plot.fit_interferometer_plots, and subplot_fit_log10(..., source_interpolated=True) for imaging;
  • interpolated=False on both _plot_source_plane helpers;
  • the new config key.

The fit.png and fit_log10.png layouts change with a Delaunay/kNN source, and the interferometer fit.png changes for every source (S/N panel removed), as described above.

See full details below.

Test Plan

  • test_autolens/imaging/plot/test_fit_source_interpolated.py: titles checked at exact panel positions for:
    • imaging fit.png and fit_log10.png: Max Zoom / Interpolated / No Zoom by default, and Max / Mid / No when the key is off or the source is rectangular;
    • interferometer: S/N panel removed, the same column on and off, rectangular and parametric sources, and one shared vmax;
    • the plots.yaml default is true.
  • Full suite against the PyAutoArray branch: python -m pytest test_autolens gives 1008 passed, 1 skipped, 1 xfailed. After the layout changes (1e212b43b): 1032 passed, 1 xfailed (laptop).
  • Laptop follow-ups (2026-11-18), details on PyAutoArray#700 (feat: Delaunay source plots — add the likelihood's interpolated view PyAutoArray#700 (comment)):
    • smoke 124/124;
    • imaging and interferometer Delaunay figures re-rendered in autolens_visualization and pixel-diffed against main: only the intended 6 figures changed, and 44 are identical;
    • figures approved by the human.

Heart: published board GREEN (2026-11-17T15:25Z).

Full API Changes (for automation & release notes)

Added

  • autolens.imaging.plot.fit_imaging_plots.subplot_fit(..., source_interpolated=True)
  • autolens.interferometer.plot.fit_interferometer_plots.subplot_fit(..., source_interpolated=True)
  • autolens.imaging.plot.fit_imaging_plots._source_has_interpolated_view(fit, plane_index) (private helper)
  • Config: visualize/plots.yaml fit.subplot_fit_source_interpolated: true. Workspace copies are mirrored in separate PRs.

Changed Behaviour

  • Imaging fit.png / fit_log10.png with a Delaunay / kNN source: panel 7 = Source Plane (Interpolated), was Mid Zoom; panel 11 = No Zoom (unchanged).
  • Interferometer fit.png, all sources: Dirty Signal-To-Noise Map removed; Dirty Model Image in panel 2; panel 3 = Source Plane (Max Zoom); panel 7 = Interpolated or Mid Zoom; panel 11 = No Zoom.
  • Imaging with a rectangular or parametric source: unchanged.

Migration

  • To show Mid Zoom instead of the interpolated panel, set fit: subplot_fit_source_interpolated: false. The interferometer S/N panel has no switch.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4

New plots.yaml key `fit: subplot_fit_source_interpolated` (default false).
When on and the source is a Delaunay / kNN pixelization, fit.png draws one
source panel as the interpolated reconstruction the likelihood uses
("Source Plane (Interpolated)") instead of flat triangles; the layout and
the other source panels are unchanged.

- imaging subplot_fit: mid-zoom panel 7.
- interferometer subplot_fit: zoomed panel 7 (panel 3 of the array-free
  2x3 layout).
- read via should_plot in the imaging and interferometer fit plotters.
- rectangular and parametric sources are unaffected.

Requires PyAutoArray#700's `interpolated=` support in plot_mapper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
…no zoom

With fit.subplot_fit_source_interpolated on (irregular-mesh source), the
three source panels become flat triangles at the mid zoom (panel 3, 'Source
Plane (Zoom)'), the likelihood's interpolant at that same zoom (panel 7,
'Source Plane (Interpolated)') and flat triangles unzoomed (panel 11). The
tight max-zoom view is dropped so triangles and interpolant compare side by
side. Switch off: unchanged (max / mid / no zoom).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
…restores mid zoom

fit.subplot_fit_source_interpolated now defaults to true. With an
irregular-mesh source, fit.png right-hand column is max zoom, no zoom (flat
triangles) and the likelihood interpolant bottom right; false (or a
rectangular / parametric source) restores max, mid and no zoom. Human
decision on PyAutoArray#700, 2026-11-17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nhQ8MtKvVD9fBkNBqcMb4
…Array#700)

No Zoom is always the bottom-right panel; the middle-right panel shows
the interpolated reconstruction for Delaunay/KNN sources, or Mid Zoom
when it is off. fit_log10.png gets the same column. Interferometer
fit.png drops Dirty Signal-To-Noise Map (Dirty Model Image moves to
panel 2) so its source column matches imaging, and its source panels
share one colour scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit a79a6b2 into main Nov 18, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/delaunay-interpolated-plot branch November 18, 2026 10:11
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 19, 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.

2 participants