Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

autolens_visualization

Browse the gallery → GALLERY.md

The permanent, rendered gallery of every figure PyAutoLens writes during a model-fit — the lens visualization project repo of the PyAutoLabs organism.

This repo owns the lens figures: the producer scripts, the simulators and datasets, the all-on plots.yaml, the instrument presets, the tracked PNGs, GALLERY.md and the render harness. The organ PyAutoEyes is the cross-project visualization dashboard: it reads this repo's tracked figure manifest (gallery/viz_manifest.yaml) and links to the PNGs here — it never renders or copies them. Other libraries get sibling <lib>_visualization project repos in the same shape.

Vision

Until now, the only way to see what a PyAutoLens figure looks like was to run a modelling script and open its output/ folder. This repo keeps the most up-to-date rendering of every visualizer output in git — on realistic HST-scale imaging and SMA-scale interferometer data — so there is one place to see every figure, judge it, and improve it (by hand or in an AI chat pointed at the plotting source) without re-running anything.

Every PyAutoLens dataset type has one folder under scripts/ with one visualization.py, mirroring autolens_workspace (a variant gets its own folder):

Domain Producer Figures
imaging visualization.py full set: parametric + Delaunay source
interferometer visualization.py full set: parametric + Delaunay source
interferometer_datacube visualization.py dataset.png + fit.png per channel
point_source_image_chi_squared visualization.py dataset.png + fit.png + image-with-points pair + point_solver.png; teaching/point_solver.png + .gif (coarse grid)
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 Combined cluster figures and per-source figures, including fit.png (source-plane family fit), fit_image_plane.png and point_solver.png
cluster_pandora visualization.py Four cluster overviews and seven source-plane family fits on the registered Abell 2744 HST cutout
cluster_macs_j0416 visualization.py Nine MACS J0416 family diagnostics, including catalogue-labelled source-plane fits and published image-plane offsets
multi_dataset visualization.py dataset.png + fit.png per band
weak visualization.py dataset.png + fit.png

The simulated examples show what the visualizers (VisualizerImaging, VisualizerInterferometer, 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. 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. Pandora uses the measured positions and a fixed starting mass model.

Render locally

source activate.sh                  # library checkouts on PYTHONPATH (see the file)
bash gallery/gallery_run.sh --all   # run every producer, rebuild GALLERY.md + manifest, --check

Set PYAUTO_EYES_SCRATCH to also mirror each re-rendered domain to $PYAUTO_EYES_SCRATCH/autolens/<domain>/ for review before any PR (see AGENTS.md).

Or one domain: python scripts/imaging/visualization.py, then python gallery/gallery_build.py. Commit the regenerated PNGs under scripts/<domain>/images/ together with GALLERY.md and gallery/viz_manifest.yaml (every figure's producer, domain, source type, path, byte size and sha256, plus the stack versions it was rendered with). On every PyAutoLens release, render.yml re-renders with the released stack, commits the result and pings PyAutoEyes (repository_dispatch: eyes-refresh) to refresh its dashboard.

Add a domain

  • Put the true model in true_models/<name>.py, add a simulator under scripts/misc/simulators/ that builds the dataset from it, register it in _viz_cli.DATASETS and track its dataset under dataset/<domain>/<name>/.
  • Add a flat producer scripts/<domain>/visualization.py modelled on scripts/imaging/visualization.py. One folder per dataset type, each with exactly one visualization.py; a variant gets its own top-level folder (e.g. point_source_image_chi_squared, interferometer_datacube).
  • Run bash gallery/gallery_run.sh --all and commit the PNGs + GALLERY.md + gallery/viz_manifest.yaml.

Improve a figure

Three edit surfaces, from cheapest to deepest:

  • Config — config/visualize/plots.yaml: which figures are written at all.
  • Plot API — the plotting code in the libraries: PyAutoLens/autolens/**/plot/, PyAutoGalaxy/autogalaxy/**/plot/, PyAutoArray/autoarray/plot/. Change it there (normal library workflow), then re-render here.
  • Script — the producer in scripts/<domain>/visualization.py (dataset, model, source types).

The Brain Eyes agent runs the review loop on this repo: bin/pyauto-brain eyes survey lens/autolens_visualization.

Related repos

  • PyAutoEyes — the organ: the cross-project visualization dashboard that aggregates this repo (reads gallery/viz_manifest.yaml, links to the PNGs here).
  • autolens_workspace — user-facing science scripts and tutorials.
  • autolens_workspace_test — visualization tests (file / FITS-HDU assertions) and the gallery harness this one was adapted from.
  • autolens_profiling — likelihood timing; the source of this repo's instrument presets, simulators and HST dataset.

Community & Contributing

PyAutoLens is built in the open by its users: everyone is welcome to ask questions, share what they have made with it, and contribute.

Questions, ideas and bug reports: the PyAutoLabs Discussions. Chat with us on Slack.

Community-built tools and tutorials, and how to contribute: the PyAutoLens community page.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages