fix: al.FitInterferometer sparse path uses the profile-subtracted dirty image (PyAutoArray#575) - #750
Merged
Merged
Conversation
…cted visibilities (PyAutoArray#575) FitInterferometer.tracer_to_inversion passes sparse_dirty_image via autogalaxy's sparse_dirty_image_from over the tracer galaxies. Test: lens Sersic + source MGE, sparse vs dense to 1e-8, with an all-linear control. Refs PyAutoLabs/PyAutoArray#575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…T (PyAutoArray#575) tracer_to_inversion passes the cached ordinary light-profile image to autogalaxy's sparse_dirty_image_from (d~ - W~ i_p); profile_visibilities is built from the same cached image. Test asserts profile_image transforms to the fit's profile_visibilities. Refs PyAutoLabs/PyAutoArray#575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dinary light (PyAutoArray#575) profile_visibilities uses autogalaxy's Basis-aware _has_light_profile_non_linear over tracer.galaxies and returns zeros for an all-linear (e.g. MGE source, mass-only lens) tracer instead of forward-NUFFTing an all-zero image. Test: profile_visibilities are zeros and the transformer is not called. Refs PyAutoLabs/PyAutoArray#575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Added a follow-up commit (approved by the human, 2026-09-26): |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This applies the sparse-interferometer dirty-image fix from PyAutoGalaxy to
al.FitInterferometer. When the dataset has a sparse operator and the tracer has ordinary light profiles (for example a lens Sersic with a source MGE or pixelization), the inversion now forms D from the profile-subtracted data viad~ − W~ i_p. Before this fix it used the unsubtracted cached dirty image. Lens Sersic + source MGE gave logL −27.094 sparse against −24.291 dense; the test fails on the old code and passes with the fix.Stacked on PyAutoLabs/PyAutoArray#576 and PyAutoLabs/PyAutoGalaxy#629 (PyAutoArray#575); merge those first.
API Changes
al.FitInterferometer.profile_image, the tracer's ordinary-light image ongrids.lp.profile_visibilitiesis built from it.tracer_to_inversionpassessparse_dirty_image(fromautogalaxy'ssparse_dirty_image_from) to the inversion.See full details below.
Test Plan
test_autolensfull suite: 757 passed, 1 xfailedBasis, sparse vs dense to 1e-8. The no-lens-light control keeps the cached image, and a consistency check confirmsprofile_imagetransforms totracer.visibilities_from.Full API Changes (for automation & release notes)
Added
al.FitInterferometer.profile_image(cached property)Changed Behaviour
FitInterferometer.tracer_to_inversionsuppliessparse_dirty_imagewhen the dataset has a sparse operator and the tracer has ordinary light profiles.FitInterferometer.profile_visibilitiesis computed fromprofile_image. The values are unchanged.Migration
Heart RED override (development only)
The human authorized the AUTONOMY.md "Human override for Heart RED (development only)" for this task (PyAutoArray#575, branch
feature/interferometer-mge-w-tilde-route) on 2026-09-26. When asked how to proceed with the three library PRs, they chose "Override, open PRs". The override covers commit, push and opening pending-release PRs only. Merging needs a separate/prmwith every required check green. This branch does not claim to fix Heart.Exact RED reasons at ship time:
Branch gates passed: 24/24 targeted interferometer smoke scripts pass on the branch (autolens_workspace 11, autogalaxy_workspace 5, autolens_workspace_test 5, autogalaxy_workspace_test 3: MGE, pixelization, linear light profiles, sparse-operator JAX assertions and likelihood pins).
autolens_workspace_test/.../jax_likelihood/mge.pyfirst failed identically on the branch and on the mains because the local dataset was stale (2026-08-06, older than the 09-18 simulator change); after regenerating it, the script passes on both. Unit suites: PyAutoArray 1706 passed, PyAutoGalaxy 1240 passed, PyAutoLens 757 passed + 1 xfailed. My own diff review is in-session only; the human reviews at merge.🤖 Generated with Claude Code