Skip to content

Commit bd03e09

Browse files
author
James Nightingale
authored
Merge pull request #593 from PyAutoLabs/feature/streaming-p1-array-free-dataset
feat(interferometer): array-free Interferometer.from_stream / from_sparse_terms (streaming phase 1, Discussion #13)
2 parents d429844 + 6a2ac92 commit bd03e09

10 files changed

Lines changed: 1038 additions & 8 deletions

File tree

‎autoarray/dataset/abstract/dataset.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def __init__(
9494

9595
self.noise_covariance_matrix = noise_covariance_matrix
9696

97-
if noise_map is None:
97+
# An array-free dataset (e.g. `Interferometer.from_stream`) carries neither data nor a
98+
# noise-map: everything its likelihood needs was reduced into a sparse operator
99+
# upstream, so there is no diagonal to take and nothing to check.
100+
if noise_map is None and data is None and noise_covariance_matrix is None:
101+
pass
102+
elif noise_map is None:
98103
try:
99104
noise_map = Array2D.no_mask(
100105
values=np.diag(noise_covariance_matrix),
@@ -174,6 +179,10 @@ def shape_slim(self):
174179
"""
175180
The 1D size of the dataset data array after masking, i.e. the number of unmasked pixels.
176181
"""
182+
# An array-free dataset has no data array; the mask's slim size is not a substitute
183+
# (for an interferometer the data is visibilities, not image pixels).
184+
if self.data is None:
185+
return None
177186
return self.data.shape_slim
178187

179188
@property

0 commit comments

Comments
 (0)