Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ scripts/
point_source_source_chi_squared/visualization.py VisualizerPoint, FitPositionsSource
multi_galaxy/visualization.py VisualizerImaging, two lenses + extra galaxy
group/visualization.py VisualizerImaging, main lens + two extra galaxies
cluster/visualization.py PlotterPoint, multi-plane: point_<i>/{dataset,fit}.png
cluster/visualization.py VisualizerPoint, multi-plane: cluster overviews,
point_<i>/{dataset,fit,fit_image_plane}.png and extras
multi_dataset/visualization.py VisualizerImaging per band: <band>/{dataset,fit}.png
weak/visualization.py VisualizerWeak
misc/simulators/ one simulator per dataset (regenerate datasets)
Expand All @@ -66,17 +67,14 @@ the full figure set. Every other producer tracks only `dataset.png` and `fit.png
`visualize_before_fit`, then `visualize(..., quick_update=True)` with the true model, then
`_viz_cli.keep_dataset_and_fit` renames the plotter's files where they differ (point:
`dataset_point.png`; weak: `subplot_weak_dataset.png` / `subplot_fit_weak.png`) and deletes
everything else. Producers with several sub-datasets write one pair per sub-folder
(`multi_dataset` per band, the datacube per channel, `cluster` per point-source plane). Many
of these figures are the galaxy-scale plots and look poor on point / cluster / weak data —
bespoke figures are a follow-up through the Eyes dashboard. `cluster` calls the
`PlotterPoint` methods directly instead of `VisualizerPoint`, skipping the untracked tracer and
galaxy figures; the "Fit Positions" and point-solver panels still draw the critical curves, which
cost ~2 min per dataset on the 15-galaxy multi-plane lens (the PNGs match the visualizer's).
Every point-source `fit.png` (both chi-squared domains and `cluster`) also has a "Fit Source
Plane" panel — the observed positions traced to the point's own plane — whose presentation
follows the fit class: context only for an image-plane chi-squared, the chi-squared's own noise
footprint and value for a source-plane chi-squared (PyAutoLens#789).
everything else. Producers with several sub-datasets use sub-folders (`multi_dataset` per band,
the datacube per channel, `cluster` per point-source family). The cluster producer keeps the
combined figures and selected per-dataset figures from `VisualizerPoint`. Its full combined
update writes `point_<i>/fit.png` for the source-plane likelihood. A second full update with
the image-plane likelihood supplies `point_<i>/fit_image_plane.png`. Both use the simulator's
model with a 0.003 arcsec y offset to the first point source. The family fit shows the observed
positions traced to the point's own plane, along with per-image contributions from the
likelihood used.

**Point solver.** `point_source_image_chi_squared` (via `visualize(quick_update=False)`) and
`cluster` (per plane) also keep `point_solver.png`: the model's real `PointSolver` refining onto
Expand Down Expand Up @@ -127,8 +125,8 @@ are no mtimes: it is reproducible from a checkout. `--check` ignores only `gener
`rendered_with:`; any added, removed or byte-changed PNG fails it. It is the read contract of the
PyAutoEyes dashboard — change its shape only together with the organ.

Each producer pushes `config/` via `conf.instance.push` (the all-true `plots.yaml`), loads its
tracked dataset, builds the simulator's **true model** (every parameter fixed), and calls
Each producer pushes `config/` via `conf.instance.push`, loads its tracked dataset, builds a
fixed model from the simulator's model, and calls
`Visualizer*.visualize_before_fit` once and `Visualizer*.visualize` once per source type (the
imaging and interferometer `visualization.py` producers; the others are described above)
(`parametric/` = SersicCore, `delaunay/` = Overlay image-mesh + `Delaunay` + `ConstantSplit`),
Expand All @@ -154,8 +152,8 @@ The newer datasets are simulated here from `scripts/misc/simulators/<name>.py`,
from the matching `autolens_workspace` simulator (`datacube.py` from
`interferometer/features/datacube/simulator.py`) and cut down to stay small, with seeded noise.
Their true models live in `true_models/<name>.py`, imported by both the simulator and the
producer, so the fit is always of the model that made the data. Each is registered in
`_viz_cli.DATASETS` (directory, simulator stem, sentinel file); producers call
producer. The cluster producer applies its diagnostic offset only to the fit model. Each
dataset is registered in `_viz_cli.DATASETS` (directory, simulator stem, sentinel file); producers call
`ensure_dataset("<key>")`, which simulates only when the sentinel is missing.

## Adding a domain
Expand Down
18 changes: 11 additions & 7 deletions GALLERY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<!-- Generated by gallery/gallery_build.py from scripts/<domain>/images/. Do not edit by hand: rerun `bash gallery/gallery_run.sh --all`. -->

Rendered with PyAutoLens `2026.10.23.1` · 85 figures.
Rendered with PyAutoLens `2026.8.17.1` · 86 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.
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 from the simulation models. For the Simple cluster, the first point source is offset by 0.003 arcsec in y. See [README.md](README.md) for how to improve one.

## Contents

- [cluster](#cluster)
- [visualization](#cluster--visualization) (17 figures)
- [visualization](#cluster--visualization) (18 figures)
- [top level](#cluster--visualization--top-level)
- [point_0/](#cluster--visualization--point_0)
- [point_1/](#cluster--visualization--point_1)
Expand Down Expand Up @@ -67,10 +67,6 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis

![fit_image_with_points](scripts/cluster/images/visualization/fit_image_with_points.png)

##### fit_per_image

![fit_per_image](scripts/cluster/images/visualization/fit_per_image.png)

##### image_with_points

![image_with_points](scripts/cluster/images/visualization/image_with_points.png)
Expand All @@ -85,6 +81,10 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis

![fit](scripts/cluster/images/visualization/point_0/fit.png)

##### fit_image_plane

![fit_image_plane](scripts/cluster/images/visualization/point_0/fit_image_plane.png)

##### fit_image_with_points

![fit_image_with_points](scripts/cluster/images/visualization/point_0/fit_image_with_points.png)
Expand All @@ -111,6 +111,10 @@ Every figure below is what the PyAutoLens visualizers (`VisualizerImaging`, `Vis

![fit](scripts/cluster/images/visualization/point_1/fit.png)

##### fit_image_plane

![fit_image_plane](scripts/cluster/images/visualization/point_1/fit_image_plane.png)

##### fit_image_with_points

![fit_image_with_points](scripts/cluster/images/visualization/point_1/fit_image_with_points.png)
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ mirroring `autolens_workspace` (a variant gets its own folder):
| `point_source_source_chi_squared` | `visualization.py` | `dataset.png` + `fit.png` |
| `multi_galaxy` | `visualization.py` | `dataset.png` + `fit.png` |
| `group` | `visualization.py` | `dataset.png` + `fit.png` |
| `cluster` | `visualization.py` | `dataset.png` + `fit.png` + `point_solver.png` per point-source plane |
| `cluster` | `visualization.py` | Combined cluster figures and per-source figures, including `fit.png` (source-plane family fit), `fit_image_plane.png` and `point_solver.png` |
| `multi_dataset` | `visualization.py` | `dataset.png` + `fit.png` per band |
| `weak` | `visualization.py` | `dataset.png` + `fit.png` |

Each figure is exactly what the visualizers (`VisualizerImaging`, `VisualizerInterferometer`,
`VisualizerPoint`, `VisualizerWeak`) write to a fit's `image/` folder, rendered with the
simulator's true model, with every toggle in
[`config/visualize/plots.yaml`](config/visualize/plots.yaml) switched on. Imaging and
interferometer render every figure; the other types track just the dataset and fit figures for
now (several reuse galaxy-scale plots — bespoke point, cluster and weak figures come next).
`VisualizerPoint`, `VisualizerWeak`) write to a fit's `image/` folder. The producers use the
simulation models and enable the figure settings in
[`config/visualize/plots.yaml`](config/visualize/plots.yaml). Imaging and
interferometer render every figure. Other types track a subset, as shown above. The Simple
cluster model offsets the `point_0` source y coordinate by 0.003 arcsec to demonstrate how a
small model error affects the individual images. Both family figures use this same model and
the tracked simulated positions.

## Render locally

Expand Down
2 changes: 1 addition & 1 deletion config/visualize/plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fit_point_dataset: # Settings for plots of fits to point
fit_image_with_points: true # The observed image with observed and model positions and critical curves over it (fit_image_with_points.png)?
subplot_point_solver: true # PointSolver refinement steps at the best fit (point_solver.png); off by default in the library.
subplot_fit_combined: true # Multi-dataset (e.g. cluster) fits: every source's fit in one panel, curves at each source's redshift (fit.png)?
fit_per_image_combined: true # Multi-dataset (e.g. cluster) fits: fit_per_image.png for every source, ranking range shared across sources?
fit_per_image_combined: true # Multi-dataset (e.g. cluster) fits: a family fit in <name>/fit.png for every source?
fit_image_with_points_combined: true # Multi-dataset (e.g. cluster) fits: the observed image with every source's positions, model and curves (fit_image_with_points.png)?

weak_dataset: # Settings for plots of weak lensing shear catalogues (e.g. PlotterWeak).
Expand Down
3 changes: 2 additions & 1 deletion gallery/gallery_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ def render_markdown(manifest: dict, version: str) -> str:
"",
"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. "
"model-fit's `image/` folder, rendered on this repo's datasets from the simulation models. "
"For the Simple cluster, the first point source is offset by 0.003 arcsec in y. "
"See [README.md](README.md) for how to improve one.",
"",
"## Contents",
Expand Down
Loading
Loading