Skip to content

feat: overlay point-source positions on a dataset image - #780

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/point-source-image-overlay
Oct 21, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/point-source-image-overlay

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

For point-source modeling (e.g. a lensed quasar), passing an image of the dataset to AnalysisPoint now gives a figure with the point positions clearly plotted over it. Before this change, AnalysisPoint(image=...) accepted the image and silently dropped it.

The new image_with_points.png shows:

  • observed positions as white markers with a black edge, which stand out on any colormap
  • after a fit, model positions as red crosses and the critical curves

Positions are placed with PyAutoArray's own overlay reflection (_overlay_yx_for_origin), so they stay registered to the image.

Closes part of #779; workspace and autolens_visualization follow-ups come next.

API Changes

  • AnalysisPoint now stores self.image. It is for visualization only and does not enter the likelihood.
  • New aplt.plot_image_with_points(image, dataset, fit=None, ...).
  • New PlotterPoint.image_with_points(...), gated by plots.yaml point_dataset.image_with_points and fit_point_dataset.image_with_points (both default true).
  • VisualizerPoint emits the figure before and after the fit, including on quick_update, whenever an image is supplied.
  • Purely additive; no migration needed.
    See full details below.

Test Plan

  • pytest test_autolens/ — 838 passed, 1 xfailed (local, worktree).
  • New tests check that the analysis stores the image, that the plot writes image_with_points.png, and that the visualizer writes it before and after the fit (with and without quick_update) only when an image is given.
  • Visual check: a render of PSF blobs at known (y,x) positions has its markers exactly on the peaks, with the critical curve overlaid.

Readiness

At ship time, Heart readiness was YELLOW (score 70):

  • workspace validation not passing (1 failed, cloud#39224774724: euclid scripts/tools/diagnose_latent.py)
  • manifest drift: workspace checkouts (manifest ↔ disk) — 1 mismatch(es) vs PyAutoMind/repos.yaml
  • release validation incomplete: no rehearsal for current source

The Heart door read RED at task start. The human authorized development to proceed on 2026-10-21 ("I override, go"). None of these reasons involve point-source code.

Full API Changes (for automation & release notes)

Added

  • autolens.plot.plot_image_with_points(image, dataset, fit=None, output_path=None, output_format=None, image_plane_lines=None, image_plane_line_colors=None, title_prefix=None) — writes image_with_points.png
  • autolens.point.model.plotter.PlotterPoint.image_with_points(image, dataset, fit=None, image_plane_lines=None, image_plane_line_colors=None)
  • plots.yaml: point_dataset.image_with_points: true, fit_point_dataset.image_with_points: true

Changed

  • AnalysisPoint.__init__ now stores image as self.image (previously accepted and discarded).

Migration

  • None.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

AnalysisPoint now stores the optional image= it already accepted. A new
plot_image_with_points draws observed positions (and model positions after
a fit) over it, emitted by VisualizerPoint before and after the fit,
including on quick_update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved rings

A source-plane fit's model data is the source centre, which must not be drawn
over the image. Observed positions become hollow white rings so the PSF peak and
faint images stay visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Follow-up commit b0ce0a3, found while rendering the autolens_visualization figures:

  • Model crosses are now drawn only for image-plane fits (AbstractFitPositionsImagePair). For FitPositionsSource, model_data is the source-plane centre, which had been drawn over the image near (0,0).
  • Observed positions are now hollow white rings, so the PSF peaks and faint images are no longer hidden under the markers.
  • New parametrised test covering image-plane vs source-plane fits.

pytest test_autolens/: 840 passed, 1 xfailed.

@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Workspace PR: PyAutoLabs/autolens_workspace#591
Visualization PR: PyAutoLabs/autolens_visualization#6

@Jammy2211
Jammy2211 merged commit e32af50 into main Oct 21, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/point-source-image-overlay branch October 21, 2026 10:26
@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.

1 participant