Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion autoarray/dataset/abstract/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ def __init__(

self.noise_covariance_matrix = noise_covariance_matrix

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

@property
Expand Down
Loading
Loading