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
25 changes: 20 additions & 5 deletions autoarray/dataset/interferometer/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def __init__(
transformer_class=TransformerNUFFT,
sparse_operator: Optional[InterferometerSparseOperator] = None,
raise_error_dft_visibilities_limit: bool = True,
sparse_terms: Optional[
"inversion_interferometer_util.SparseTerms"
] = None,
sparse_terms: Optional["inversion_interferometer_util.SparseTerms"] = None,
):
"""
An interferometer dataset, containing the visibilities data, noise-map, real-space msk, Fourier transformer and
Expand Down Expand Up @@ -340,6 +338,8 @@ def from_stream(
batch_size: int = 128,
phase_centre: Optional[Tuple[float, float]] = None,
pool_noise_map: bool = False,
oversample: Optional[int] = None,
oversample_pad: float = 0.25,
) -> "Interferometer":
"""
Build an array-free `Interferometer` by accumulating a stream of visibility chunks,
Expand Down Expand Up @@ -386,6 +386,13 @@ def from_stream(
forming the terms instead of raising on unequal sigmas, logging the median and
maximum difference once (a warning when the median exceeds 25 %). See
`sparse_terms_from_chunks`.
oversample, oversample_pad
If `oversample=q` (a positive even integer) is set, also accumulate the fine
precision-operator and dirty-image grids `q` times finer than the image pixel, for
components analytic in the uv-plane (points, small Gaussians); they are carried on
`sparse_terms` (`precision_operator_fine`, `dirty_image_fine`) and need the NUFFT
transformer. Memory grows as `q^2` (~5-6 GB peak at 400 pixels, `q = 8`); see
`sparse_terms_from_chunks`, "Fine grids".

Raises
------
Expand All @@ -408,6 +415,8 @@ def from_stream(
show_progress=show_progress,
phase_centre=phase_centre,
pool_noise_map=pool_noise_map,
oversample=oversample,
oversample_pad=oversample_pad,
)

return cls.from_sparse_terms(
Expand Down Expand Up @@ -571,7 +580,11 @@ def apply_sparse_operator(
use_jax = False

self._require(
"apply_sparse_operator", "data", "noise_map", "uv_wavelengths", "transformer"
"apply_sparse_operator",
"data",
"noise_map",
"uv_wavelengths",
"transformer",
)

if pool_noise_map:
Expand Down Expand Up @@ -766,7 +779,9 @@ def apply_sparse_operator_from_chunks(
The number of source-pixel columns processed per batch by the sparse operator.
accumulator_kwargs
Passed to `sparse_terms_from_chunks` (`transformer_class`, `method`, `eps`,
`chunk_size`, `chunk_k`, `use_jax`, `show_progress`). `phase_centre` is rejected:
`chunk_size`, `chunk_k`, `use_jax`, `show_progress`, and `oversample` /
`oversample_pad`, which also accumulate the fine grids onto the returned dataset's
`sparse_terms`). `phase_centre` is rejected:
it would shift the operator's terms but not this dataset's retained `data`, so the
two would describe different phase centres; use `Interferometer.from_stream`
(array-free, no retained data) to stream with a phase-centre shift.
Expand Down
Loading
Loading