Skip to content

feat(interferometer): visualizer on array-free datasets (streaming phase 3) - #640

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/streaming-p3-visualizer
Sep 30, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/streaming-p3-visualizer

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

PyAutoGalaxy half of streaming phase 3 (https://github.com/orgs/PyAutoLabs/discussions/13; epic streaming-visibilities). Pairs with PyAutoLabs/PyAutoArray#597 (issue PyAutoLabs/PyAutoArray#596) and PyAutoLabs/PyAutoLens#761. CI on this branch resolves the same-named PyAutoArray branch.

  • FitInterferometer gains model_image_natural (profile_image + inversion.mapped_reconstructed_data — the ordinary light plus every linear reconstruction, so a galaxy mixing both is complete; equals inversion.mapped_reconstructed_data on pixelization-only fits), dirty_model_image_natural (via autoarray's dirty_model_image_natural_from) and dirty_residual_map_natural — on both dataset kinds with a sparse operator.
  • On an array-free dataset subplot_fit, subplot_fit_dirty_images and the pixelization branch of subplot_fit_real_space draw the 1×3 natural set (dirty image / model / residual) under the same filenames; fits_dirty_images writes DIRTY_IMAGE_NATURAL, DIRTY_BEAM, DIRTY_MODEL_IMAGE_NATURAL, DIRTY_RESIDUAL_MAP_NATURAL. In-memory output unchanged (tested by value against fit.dirty_*).
  • interferometer/model/visualizer.py: the InversionException fallback called logger(...) (a Logger is not callable → TypeError); now logger.warning(...).

Witness: visualize_before_fit + visualize on a 1e5-visibility streamed dataset write the same 7 files as the in-memory run; array-free vs in-memory natural dirty model rel 2.0e-15; W̃ path vs transformer path rel 3.4e-14.

API Changes

Additive: FitInterferometer.model_image_natural, .dirty_model_image_natural, .dirty_residual_map_natural. Array-free datasets get natural-weighted panels/extensions under the existing filenames; in-memory unchanged. The visualizer's linear-algebra fallback now logs a warning instead of raising TypeError.
See full details below.

Test Plan

  • pytest test_autogalaxy — 1293 passed (1291 before the review fix)
  • New: array-free visualizer end to end (dataset.png, fit.png, fit_dirty_images.fits EXTNAMEs, galaxy_images.fits, inversion_0_0.png); array-free plot-function branches; model_image_natural == inversion.mapped_reconstructed_data; in-memory EXTNAMEs and arrays equal fit.dirty_*; red with the source changes stashed
  • CI green on unittest 3.12 / 3.13 / nojax + docs

Heart RED override (development only)

Heart verdict at ship: RED (2026-09-30T18:32Z): release validation FAILED (stage integrate) (unrelated release-integrate leg) plus two canonical-checkout drift reasons from another session (PyAutoLens: on branch feature/point-solver-padding-backend (not main), PyAutoLens: 2 uncommitted source change(s)) — none caused by these branches. Live human authorization in-session 2026-09-30 for issue PyAutoLabs/PyAutoArray#596 and the three feature/streaming-p3-visualizer branches ("Authorize override for #596"): commit, push and the pending-release PRs only. Branch gates: test_autoarray 1898, test_autogalaxy 1293, test_autolens 776 + 1 xfailed; red-checks on the inversion-plot fix and the array-free tests; Codex (gpt-6-astra) review: FINDINGS (1) — model_image_natural summed galaxy_image_dict, whose entries are overwritten by a galaxy's linear reconstruction, so a galaxy with both ordinary and linear light lost its ordinary component (reproduced: rel error 1.0 in ag, 1.14/1.31 in al); fixed in-branch as profile_image + inversion.mapped_reconstructed_data, with mixed-galaxy tests against an independent transformer reference from fit.model_data (rel ≤ 2e-14), red-checked. Merge needs its own explicit human command with every check green.

Full API Changes (for automation & release notes)

Added

  • FitInterferometer.model_image_natural, FitInterferometer.dirty_model_image_natural, FitInterferometer.dirty_residual_map_natural

Changed Behaviour

  • subplot_fit, subplot_fit_dirty_images, subplot_fit_real_space, fits_dirty_images — natural-weighted panels / extensions on array-free datasets
  • VisualizerInterferometer.visualize — logger.warning in the InversionException fallback (was a TypeError)

Migration

  • None.

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JZZksyZ8LTA4LLxoZjQMNF

…ase 3, PyAutoArray#596)

FitInterferometer.model_image_natural / dirty_model_image_natural /
dirty_residual_map_natural; subplot_fit, subplot_fit_dirty_images,
subplot_fit_real_space and fits_dirty_images draw the natural-weighted set on
array-free datasets under the same filenames; the visualizer's
InversionException fallback called logger(...) (TypeError) and now logs a
warning. In-memory output unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZZksyZ8LTA4LLxoZjQMNF
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

Independent review (Codex gpt-6-astra) of the three branches before PR-open

  • P2 — Natural model/residual images omit ordinary light in mixed-component galaxies. autogalaxy/interferometer/fit_interferometer.py:438, autolens/interferometer/fit_interferometer.py:356.

    On an in-memory dataset after apply_sparse_operator(), put an ordinary Sersic and a linear Gaussian—or pixelization—in the same galaxy. galaxy_image_dict replaces that galaxy’s ordinary image with its linear reconstruction. Summing its values therefore omits the ordinary component: dirty_model_image_natural is too small, and dirty_residual_map_natural contains the omitted component’s dirty image.

    Classification: the dictionary overwrite is pre-existing; using it as the complete model introduces this defect into the new properties. Assemble the model from profile_image plus inversion.mapped_reconstructed_data.

    The added tests miss this: they use pixelization-only models and construct their Fourier reference from model_image_natural itself, rather than independently from fit.model_data.

FINDINGS (1)

Disposition: FINDINGS (1) — model_image_natural summed galaxy_image_dict, whose entries are overwritten by a galaxy's linear reconstruction, so a galaxy with both ordinary and linear light lost its ordinary component (reproduced: rel error 1.0 in ag, 1.14/1.31 in al); fixed in-branch as profile_image + inversion.mapped_reconstructed_data, with mixed-galaxy tests against an independent transformer reference from fit.model_data (rel ≤ 2e-14), red-checked. Test names: test__natural_dirty_images__galaxy_with_ordinary_and_linear_light__matches_model_data[linear_light_profile|pixelization] in both repos.

🤖 Generated with Claude Code

@Jammy2211
Jammy2211 merged commit 6d522ce into main Sep 30, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/streaming-p3-visualizer branch September 30, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant