Skip to content

Commit 5eb3557

Browse files
Jammy2211claude
authored andcommitted
feat: PreloadsInterferometer passes mesh-geometry fields through
Completes the D5 cross-dataset-type contract (PyAutoLens#599): an interferometer lead factor in a joint imaging+interferometer graph can now carry the shared source-plane mesh alongside its channel-invariant curvature matrix + mapper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f8a32d4 commit 5eb3557

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

autoarray/preloads/interferometer.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33

44
class PreloadsInterferometer(AbstractPreloads):
5-
def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None):
5+
def __init__(
6+
self,
7+
curvature_matrix=None,
8+
mapper_galaxy_dict=None,
9+
source_plane_mesh_grid=None,
10+
image_plane_mesh_grid=None,
11+
):
612
"""
713
Preloaded quantities for an interferometer fit / inversion (see `AbstractPreloads`).
814
@@ -24,5 +30,8 @@ def __init__(self, curvature_matrix=None, mapper_galaxy_dict=None):
2430
The pre-computed mapper(s) and their source association. See `AbstractPreloads`.
2531
"""
2632
super().__init__(
27-
curvature_matrix=curvature_matrix, mapper_galaxy_dict=mapper_galaxy_dict
33+
curvature_matrix=curvature_matrix,
34+
mapper_galaxy_dict=mapper_galaxy_dict,
35+
source_plane_mesh_grid=source_plane_mesh_grid,
36+
image_plane_mesh_grid=image_plane_mesh_grid,
2837
)

test_autoarray/preloads/test_preloads.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ def test__preloads_interferometer__mesh_fields_available_via_abstract():
2727
assert preloads.curvature_matrix == "F"
2828
assert preloads.source_plane_mesh_grid is None
2929
assert preloads.image_plane_mesh_grid is None
30+
31+
preloads = aa.PreloadsInterferometer(
32+
curvature_matrix="F", source_plane_mesh_grid=[["mesh"]], image_plane_mesh_grid=[["im"]]
33+
)
34+
assert preloads.source_plane_mesh_grid == [["mesh"]]
35+
assert preloads.image_plane_mesh_grid == [["im"]]

0 commit comments

Comments
 (0)