Skip to content

Honor operated_mapping_matrix_override in interferometer inversions - #460

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/interferometer-operated-override
Aug 21, 2026
Merged

Honor operated_mapping_matrix_override in interferometer inversions#460
Jammy2211 merged 1 commit into
mainfrom
feature/interferometer-operated-override

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Closes #459.

The interferometer inversion's operated_mapping_matrix_list never read LinearObj.operated_mapping_matrix_override — it unconditionally transformed the raw mapping_matrix, so an override that works for imaging fits was silently ignored for interferometer fits.

Changes

  • inversion/interferometer/abstract.pyoperated_mapping_matrix_list now honors the override consistently with imaging: it bypasses the data's operators entirely and is placed directly in the list. For an interferometer dataset the override must therefore be in visibility space, with (complex) shape [total_visibilities, params] (e.g. computed via an analytic Fourier transform). A wrong-shaped override (e.g. a real-space [mask_pixels, params] matrix) raises an informative InversionException instead of being silently ignored.
  • inversion/interferometer/sparse.py — the sparse (w-tilde) formalism constructs its linear algebra without an explicit operated mapping matrix and cannot apply an override, so it now raises clearly when passed an override-carrying linear object.
  • inversion/linear_obj/linear_obj.py — the operated_mapping_matrix_override docstring now documents the per-dataset contract (imaging: real [total_mask_pixels, params]; interferometer: complex [total_visibilities, params]).
  • Tests: override honored (including mixed with a non-override linear object), wrong-shape raises, sparse-path raises.

All quantities of InversionInterferometerMapping (data vector, curvature matrix, mapped reconstructed visibilities) flow through this one property, so the override propagates everywhere.

Companion PRs

  • PyAutoGalaxy: LightProfileLinearObjFuncList.operated_mapping_matrix_override returns None when psf is None — required because interferometer fits construct it with psf=None, and its image-space PSF-based override does not apply (and would crash) once this PR starts reading the property. Merge together with this PR.
  • autogalaxy_workspace / autolens_workspace: interferometer operated_light_profile example packages (pending-release; merge after the library PRs).

Test results

test_autoarray/: 1090 passed; the only 3 failures are pre-existing pynufft environment failures that reproduce identically on an unmodified checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lv2LDovvSQydk8biNMSAPL


Generated by Claude Code

…459)

The interferometer inversion's operated_mapping_matrix_list never read
LinearObj.operated_mapping_matrix_override, silently transforming the raw
mapping_matrix instead — the override worked for imaging fits only.

The override is now honored consistently with imaging: it bypasses the
data's operators entirely, so for an interferometer dataset it must be in
visibility space with shape [total_visibilities, params]. A real-space
shaped override raises an informative InversionException instead of being
silently ignored, as does passing an override-carrying linear object to
the sparse (w-tilde) formalism, which has no explicit operated mapping
matrix to override.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lv2LDovvSQydk8biNMSAPL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

operated_mapping_matrix_override is silently ignored for Interferometer

2 participants