diff --git a/GALLERY.md b/GALLERY.md index ffbbc12..fb44959 100644 --- a/GALLERY.md +++ b/GALLERY.md @@ -2,7 +2,7 @@ -Rendered with PyAutoLens `2026.8.17.1` · 66 figures. +Rendered with PyAutoLens `2026.8.17.1` · 68 figures. Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `VisualizerInterferometer`, `VisualizerPoint`, `VisualizerWeak`) write to a model-fit's `image/` folder, rendered on this repo's datasets with the true model. See [README.md](README.md) for how to improve one. @@ -38,10 +38,10 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis - [visualization](#multi_galaxy--visualization) (2 figures) - [top level](#multi_galaxy--visualization--top-level) - [point_source_image_chi_squared](#point_source_image_chi_squared) - - [visualization](#point_source_image_chi_squared--visualization) (3 figures) + - [visualization](#point_source_image_chi_squared--visualization) (4 figures) - [top level](#point_source_image_chi_squared--visualization--top-level) - [point_source_source_chi_squared](#point_source_source_chi_squared) - - [visualization](#point_source_source_chi_squared--visualization) (3 figures) + - [visualization](#point_source_source_chi_squared--visualization) (4 figures) - [top level](#point_source_source_chi_squared--visualization--top-level) - [weak](#weak) - [visualization](#weak--visualization) (2 figures) @@ -351,6 +351,10 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis ![fit](scripts/point_source_image_chi_squared/images/visualization/fit.png) +##### fit_image_with_points + +![fit_image_with_points](scripts/point_source_image_chi_squared/images/visualization/fit_image_with_points.png) + ##### image_with_points ![image_with_points](scripts/point_source_image_chi_squared/images/visualization/image_with_points.png) @@ -369,6 +373,10 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis ![fit](scripts/point_source_source_chi_squared/images/visualization/fit.png) +##### fit_image_with_points + +![fit_image_with_points](scripts/point_source_source_chi_squared/images/visualization/fit_image_with_points.png) + ##### image_with_points ![image_with_points](scripts/point_source_source_chi_squared/images/visualization/image_with_points.png) diff --git a/_viz_cli.py b/_viz_cli.py index 06f3ce6..647cc76 100644 --- a/_viz_cli.py +++ b/_viz_cli.py @@ -181,8 +181,8 @@ def keep_dataset_and_fit( plotter's ``dataset_point.png``); they are renamed to ``dataset.png`` / ``fit.png``. Every other file (other PNGs, FITS, CSV, JSON) and any sub-folder is deleted, so the newer domains track only the two figures. ``extra_pngs`` names further figures to keep under their - own names (e.g. the point plotter's ``image_with_points.png``). Raises if any expected figure - is missing. + own names (e.g. the point plotter's ``image_with_points.png`` and + ``fit_image_with_points.png``). Raises if any expected figure is missing. """ image_dir = Path(image_dir) kept = [] diff --git a/gallery/viz_manifest.yaml b/gallery/viz_manifest.yaml index dfdaa45..a263650 100644 --- a/gallery/viz_manifest.yaml +++ b/gallery/viz_manifest.yaml @@ -8,7 +8,7 @@ rendered_with: autogalaxy: 2026.8.17.1 autoarray: 2026.8.17.1 autofit: 2026.8.17.1 -figure_count: 66 +figure_count: 68 figures: - file: scripts/cluster/images/visualization/point_0/dataset.png producer: scripts/cluster/visualization.py @@ -370,12 +370,18 @@ figures: source: '' bytes: 28952 sha256: 6b52412bb75eab16a3dc4ae4e0a4925d5f23c2ff7ed8bb9a6199f406f201cfed +- file: scripts/point_source_image_chi_squared/images/visualization/fit_image_with_points.png + producer: scripts/point_source_image_chi_squared/visualization.py + domain: point_source_image_chi_squared + source: '' + bytes: 78338 + sha256: 76b4b2b2ce69bcc2f3d3740c901d04d86ba245f217e5f026f1bbdfc3b9db39bd - file: scripts/point_source_image_chi_squared/images/visualization/image_with_points.png producer: scripts/point_source_image_chi_squared/visualization.py domain: point_source_image_chi_squared source: '' - bytes: 78200 - sha256: 5972b44e38db7c42e93a108d53530b83a1103cde5a06989c5947eb9e86871114 + bytes: 66518 + sha256: 2653419882e5f55d2afe24b067e8d5c9865081aee51517dc05520a12d1787468 - file: scripts/point_source_source_chi_squared/images/visualization/dataset.png producer: scripts/point_source_source_chi_squared/visualization.py domain: point_source_source_chi_squared @@ -388,12 +394,18 @@ figures: source: '' bytes: 28823 sha256: caf49de216f6f80553e6c79b03231fd51ee626bd5939dd6864489e56a134320c +- file: scripts/point_source_source_chi_squared/images/visualization/fit_image_with_points.png + producer: scripts/point_source_source_chi_squared/visualization.py + domain: point_source_source_chi_squared + source: '' + bytes: 75775 + sha256: 4fee595525a08c3f70f79c7d5e4395b69734c3582d3ddd4343b64a5c210a4f23 - file: scripts/point_source_source_chi_squared/images/visualization/image_with_points.png producer: scripts/point_source_source_chi_squared/visualization.py domain: point_source_source_chi_squared source: '' - bytes: 75639 - sha256: 76c6fa188a4bb9ca4d66fe95e42429ec7d9c900df85de0e00bae345be68146a0 + bytes: 66518 + sha256: 2653419882e5f55d2afe24b067e8d5c9865081aee51517dc05520a12d1787468 - file: scripts/weak/images/visualization/dataset.png producer: scripts/weak/visualization.py domain: weak diff --git a/scripts/misc/simulators/point_source.py b/scripts/misc/simulators/point_source.py index 1a5505d..9fb517c 100644 --- a/scripts/misc/simulators/point_source.py +++ b/scripts/misc/simulators/point_source.py @@ -6,7 +6,8 @@ of one point source (``point_0``) behind an isothermal lens — and writes ``point_dataset.json`` (the ``PointDataset``, positions only) and ``tracer.json`` into ``dataset/point_source/simple/``, plus the accompanying imaging (``data.fits``, ``psf.fits``, -``noise_map.fits``) the producers plot the positions over (``image_with_points.png``). +``noise_map.fits``) the producers plot the positions over (``image_with_points.png`` and +``fit_image_with_points.png``). The imaging places one unlensed ``al.lp.PointSource`` per noisy image position on an image-plane galaxy at the lens redshift (a delta function is not lensed: its multiple images diff --git a/scripts/point_source_image_chi_squared/images/visualization/fit_image_with_points.png b/scripts/point_source_image_chi_squared/images/visualization/fit_image_with_points.png new file mode 100644 index 0000000..cdc1bf9 Binary files /dev/null and b/scripts/point_source_image_chi_squared/images/visualization/fit_image_with_points.png differ diff --git a/scripts/point_source_image_chi_squared/images/visualization/image_with_points.png b/scripts/point_source_image_chi_squared/images/visualization/image_with_points.png index 85f639f..28becf5 100644 Binary files a/scripts/point_source_image_chi_squared/images/visualization/image_with_points.png and b/scripts/point_source_image_chi_squared/images/visualization/image_with_points.png differ diff --git a/scripts/point_source_image_chi_squared/visualization.py b/scripts/point_source_image_chi_squared/visualization.py index f406636..496c31f 100644 --- a/scripts/point_source_image_chi_squared/visualization.py +++ b/scripts/point_source_image_chi_squared/visualization.py @@ -12,12 +12,14 @@ scripts/point_source_image_chi_squared/images/visualization/ dataset.png <- visualize_before_fit (the plotter writes dataset_point.png; renamed) fit.png <- visualize(quick_update=True) - image_with_points.png <- visualize(quick_update=True): the observed positions and the - model's positions + critical curves over ``data.fits`` + image_with_points.png <- visualize_before_fit: the observed positions over + ``data.fits`` (dataset only, no model) + fit_image_with_points.png <- visualize(quick_update=True): the observed + positions, the model's positions and critical curves over + ``data.fits`` -Every other file the visualizer writes is deleted: this domain tracks only these three -figures. ``image_with_points.png`` is written before and after the fit to the same file; -the kept one is the after-fit version, with the model positions. +Every other file the visualizer writes is deleted: this domain tracks only these four +figures. Dataset: ``dataset/point_source/simple`` (four image-plane positions, 5 mas noise; shared by both point-source chi-squared producers), from @@ -70,8 +72,8 @@ def _repo_root() -> Path: dataset = al.from_json(file_path=dataset_path / "point_dataset.json") """ -The accompanying imaging, used only for visualization (``image_with_points.png``), not in the -likelihood. +The accompanying imaging, used only for visualization (``image_with_points.png``, +``fit_image_with_points.png``), not in the likelihood. """ data = al.Array2D.from_fits( file_path=dataset_path / "data.fits", hdu=0, pixel_scales=tm.IMAGE_PIXEL_SCALES @@ -130,7 +132,9 @@ def _repo_root() -> Path: quick_update=True, ) keep_dataset_and_fit( - image_path, dataset_png="dataset_point.png", extra_pngs=("image_with_points.png",) + image_path, + dataset_png="dataset_point.png", + extra_pngs=("image_with_points.png", "fit_image_with_points.png"), ) print(f"visualize: {time.perf_counter() - t0:.1f}s") print( diff --git a/scripts/point_source_source_chi_squared/images/visualization/fit_image_with_points.png b/scripts/point_source_source_chi_squared/images/visualization/fit_image_with_points.png new file mode 100644 index 0000000..e4a61f0 Binary files /dev/null and b/scripts/point_source_source_chi_squared/images/visualization/fit_image_with_points.png differ diff --git a/scripts/point_source_source_chi_squared/images/visualization/image_with_points.png b/scripts/point_source_source_chi_squared/images/visualization/image_with_points.png index 4ae6fa4..28becf5 100644 Binary files a/scripts/point_source_source_chi_squared/images/visualization/image_with_points.png and b/scripts/point_source_source_chi_squared/images/visualization/image_with_points.png differ diff --git a/scripts/point_source_source_chi_squared/visualization.py b/scripts/point_source_source_chi_squared/visualization.py index 44b8550..e717bb7 100644 --- a/scripts/point_source_source_chi_squared/visualization.py +++ b/scripts/point_source_source_chi_squared/visualization.py @@ -12,12 +12,14 @@ scripts/point_source_source_chi_squared/images/visualization/ dataset.png <- visualize_before_fit (the plotter writes dataset_point.png; renamed) fit.png <- visualize(quick_update=True) - image_with_points.png <- visualize(quick_update=True): the observed positions and the - model's positions + critical curves over ``data.fits`` + image_with_points.png <- visualize_before_fit: the observed positions over + ``data.fits`` (dataset only, no model) + fit_image_with_points.png <- visualize(quick_update=True): the observed + positions and critical curves over ``data.fits`` (a + source-plane fit has no image-plane model positions) -Every other file the visualizer writes is deleted: this domain tracks only these three -figures. ``image_with_points.png`` is written before and after the fit to the same file; -the kept one is the after-fit version, with the model positions. +Every other file the visualizer writes is deleted: this domain tracks only these four +figures. Dataset: ``dataset/point_source/simple`` (four image-plane positions, 5 mas noise; shared by both point-source chi-squared producers), from @@ -70,8 +72,8 @@ def _repo_root() -> Path: dataset = al.from_json(file_path=dataset_path / "point_dataset.json") """ -The accompanying imaging, used only for visualization (``image_with_points.png``), not in the -likelihood. +The accompanying imaging, used only for visualization (``image_with_points.png``, +``fit_image_with_points.png``), not in the likelihood. """ data = al.Array2D.from_fits( file_path=dataset_path / "data.fits", hdu=0, pixel_scales=tm.IMAGE_PIXEL_SCALES @@ -131,7 +133,9 @@ def _repo_root() -> Path: quick_update=True, ) keep_dataset_and_fit( - image_path, dataset_png="dataset_point.png", extra_pngs=("image_with_points.png",) + image_path, + dataset_png="dataset_point.png", + extra_pngs=("image_with_points.png", "fit_image_with_points.png"), ) print(f"visualize: {time.perf_counter() - t0:.1f}s") print(