Repository navigation
Description
Overview
For point-source modeling (e.g. a lensed quasar), passing an image of the dataset should give a figure with the observed (and model) point positions clearly plotted over it. Today AnalysisPoint(image=...) silently drops the image and no point plot can draw a background. This task adds an image_with_points.png figure. It makes the workspace and visualization simulators produce realistic point images (delta-function lp.PointSource + PSF). It then surfaces the figure on the PyAutoEyes board for point_source_image_chi_squared and point_source_source_chi_squared.
Heart RED at start (unrelated PyAutoFit/smoke failures). The human invoked the development override on 2026-10-21.
Plan
- PyAutoLens:
AnalysisPointstoresimage. A newimage_with_points.pngfigure draws the image with observed positions (high-contrast markers), model positions (red crosses, post-fit) and optional critical curves.VisualizerPointemits it before and after the fit (incl.quick_update) when an image is given. - autolens_workspace: the point simulator builds the image from
lp.PointSourcecomponents at each multiple-image position (intensity ∝ flux × |magnification|, image-plane galaxy, PSF-convolved). The modeling/fluxes/extra_galaxies scripts passimage=data, and the misleading docstring is fixed. - autolens_visualization: the point simulator writes
data.fits/psf.fitswith the same recipe. Both producers pass the image, the keep-helper retainsimage_with_points.png, and the manifest and GALLERY.md are rebuilt. - PyAutoEyes: the board is re-rendered after the viz PR merges, so the third PNG appears. No Eyes code change.
- Order: library → workspace → visualization → Eyes re-render.
Tier: judge — merge mode: human /prm
Detailed implementation plan
Affected Repositories
- PyAutoLens (primary)
- autolens_workspace
- autolens_visualization
- PyAutoEyes (board re-render only)
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| lens/PyAutoLens | main | clean |
| lens/autolens_workspace | main | untracked root dataset.fits (not ours, left alone) |
| lens/autolens_visualization | main | clean |
Suggested branch: feature/point-source-image-overlay
Implementation Steps
autolens/point/model/analysis.py: setself.image = image(currently accepted at :63 but dropped). Document it as visualization-only.autolens/point/plot/fit_point_plots.py: addplot_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). It callsplot_array(array=image), overlaysdataset.positions(white fill, black edge, s≈60) and, whenfitis given,fit.positions.model_data(redx). It adds a legend and savesimage_with_points.png. Export it viaautolens/plot/__init__.autolens/point/model/plotter.py: addPlotterPoint.image_with_points(...), gated byplots.yamlpoint_dataset.image_with_points/fit_point_dataset.image_with_points. Add the default config keys (true).autolens/point/model/visualizer.py: whenanalysis.image is not None, call it invisualize_before_fit(observed only) and invisualize(with model positions; also onquick_update=True).- Tests in
test_autolens/point/: the image is stored, the plot writes its file, and the visualizer emits it only when an image is given. - autolens_workspace
scripts/point_source/simulator.py__Imaging__: replace the tinyExponentialCorearcs withal.lp.PointSourceat each solved image position on an image-plane (lens-redshift) galaxy, alongside the lens light. Use a Gaussian PSF viaSimulatorImaging, add prose on why the points live in the image plane, and regeneratedataset/point_source/simple/data.fits. Pattern:autogalaxy_workspace/scripts/imaging/features/point_source/simulator.py. - autolens_workspace
modeling.py,features/fluxes.py,features/extra_galaxies/modeling.py(and_image/_sourcesplits if present): passimage=dataand fix the docstrings. Smoke-run. - autolens_visualization
scripts/misc/simulators/point_source.py: also writedata.fits+psf.fitswith the same recipe. Producersscripts/point_source_{image,source}_chi_squared/visualization.pypassimage=._viz_cli.keep_dataset_and_fitgains anextra_pngskeep-list. Run the producers, thengallery/gallery_build.py, and commit the PNGs +viz_manifest.yaml+GALLERY.md. - PyAutoEyes: after the viz PR merges, re-render the board and run its check.
Key Files
autolens/point/model/{analysis,plotter,visualizer}.pyautolens/point/plot/fit_point_plots.py,autolens/analysis/plotter.py(image_with_positionsprecedent)autolens_workspace/scripts/point_source/{simulator,modeling}.pyautolens_visualization/scripts/misc/simulators/point_source.py,scripts/_viz_cli.py,gallery/gallery_build.py
Original Prompt
Click to expand starting prompt
For point source modeling in general I also expect that when a user passes an image of the dataset (e.g. of the lensed quasar)
The points are clearly plotted over the top. I want to implement this (I think the workspace has some inputs descriptions for it).
I want our PyAutoEyes dashboard images for point_source_image_chi_squared and point_source_source_chi_squared to include
this image in addition to dataset.png and fit.png. This also means the workspace needs to simulate an image with what
look like actual point components (e.g. delta function point sources of slight with PSF convolution)? Lets scop this
out and do this, getting to the point where the image is in PyautoEyes.
Activity
Jammy2211 commentedon Oct 21, 2026
Library PR Created: #780 (commit 0975509). Full
test_autolens/suite: 838 passed, 1 xfailed. Heart readiness is YELLOW (workspace validation 1 failed on euclid diagnose_latent.py; manifest drift 1 mismatch; no rehearsal for current source). The human authorized development on 2026-10-21 ("I override, go"); nothing in that list involves point-source code. Next: workspace (simulator withlp.PointSourceimages; modeling passesimage=data), then autolens_visualization.Jammy2211 commentedon Oct 21, 2026
Workspace PRs created (judge tier: human /prm, library first):
image_with_points.png; gallery --check passes; manifest 64 → 66)Remaining: after #6 merges, re-render the PyAutoEyes board so the figure appears. Follow-up, not in scope: the critical curve draws as 4 disconnected arcs (pre-existing).
Jammy2211 commentedon Oct 21, 2026
Shipped — 2026-10-21
All merged by human
/prm, library first:AnalysisPointkeepsimage. Newaplt.plot_image_with_points/image_with_points.pngdraws observed positions as hollow rings and, for image-plane fits only, model positions as red crosses, plus critical curves. Emitted before and after the fit, including onquick_update. Pending release.lp.PointSourceimages; six scripts passimage=data; notebooks regenerated.image_with_points.png. Lint was re-run after feat: overlay point-source positions on a dataset image #780 merged (it had been red only because CI builds against PyAutoLens main).Follow-up, not in scope: the critical curve renders as 4 disconnected arcs on the 100×100, 0.05" grid (pre-existing).