Honor operated_mapping_matrix_override in interferometer inversions - #460
Merged
Conversation
…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
This was referenced Aug 21, 2026
Merged
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.
Closes #459.
The interferometer inversion's
operated_mapping_matrix_listnever readLinearObj.operated_mapping_matrix_override— it unconditionally transformed the rawmapping_matrix, so an override that works for imaging fits was silently ignored for interferometer fits.Changes
inversion/interferometer/abstract.py—operated_mapping_matrix_listnow 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 informativeInversionExceptioninstead 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— theoperated_mapping_matrix_overridedocstring now documents the per-dataset contract (imaging: real[total_mask_pixels, params]; interferometer: complex[total_visibilities, params]).All quantities of
InversionInterferometerMapping(data vector, curvature matrix, mapped reconstructed visibilities) flow through this one property, so the override propagates everywhere.Companion PRs
LightProfileLinearObjFuncList.operated_mapping_matrix_overridereturnsNonewhenpsf is None— required because interferometer fits construct it withpsf=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.operated_light_profileexample 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