ivis.readers.ms_casacore

Functions

concat_visidata_slabs(slabs)

Concatenate a list of VisIData slabs (same channels, different beams) into one VisIData with all beams.

iter_blocks_chan_beam_I(ms_root[, uvmin, ...])

Stream over (block_index, c, b, I, sI, uu, vv, ww) without concatenating.

iter_blocks_chan_beam_via_slabs(ms_root[, ...])

Yield (bi, c_abs, b, I, sI, uu, vv, ww), streaming through slabs per block.

iter_blocks_channel_slabs(ms_root[, uvmin, ...])

Yield slabs for each block, or concatenated slabs if concat=True.

iter_channel_slabs(ms_dir[, uvmin, uvmax, ...])

Yield contiguous channel slabs so you can stream a big cube with low RAM.

read_ms_block_I(ms_dir[, uvmin, uvmax, ...])

Load a directory of .ms files (one per beam) into an I-only, channel-major VisIData.

read_ms_blocks_I(ms_root[, uvmin, uvmax, ...])

Load multiple blocks of observations located under ms_root, then either:

Classes

CasacoreReader(*[, prefer_weight_spectrum, ...])

Concrete Reader backed by casacore.

class ivis.readers.ms_casacore.CasacoreReader(*, prefer_weight_spectrum=True, keep_autocorr=False, n_workers=0)[source]

Bases: object

Concrete Reader backed by casacore. Delegates to the module-level functions defined above.

freq_grid(ms_dir, rest_freq)[source]
iter_channel_slabs(ms_dir, **kwargs)[source]
Return type:

Iterator[Tuple[int, int, VisIData]]

list_ms(ms_dir)[source]
Return type:

List[str]

read_blocks_I(ms_root, **kwargs)[source]
Return type:

Union[VisIData, List[VisIData]]

ivis.readers.ms_casacore.concat_visidata_slabs(slabs)[source]

Concatenate a list of VisIData slabs (same channels, different beams) into one VisIData with all beams.

Return type:

VisIData

ivis.readers.ms_casacore.iter_blocks_chan_beam_I(ms_root, uvmin=0.0, uvmax=inf, chan_sel=None, rest_freq=1420405751.77, keep_autocorr=False, prefer_weight_spectrum=True, n_workers=0, beam_sel=None)[source]

Stream over (block_index, c, b, I, sI, uu, vv, ww) without concatenating.

ivis.readers.ms_casacore.iter_blocks_chan_beam_via_slabs(ms_root, uvmin=0.0, uvmax=inf, chan_sel=None, slab=64, keep_autocorr=False, prefer_weight_spectrum=True, n_workers=0, beam_sel=None)[source]

Yield (bi, c_abs, b, I, sI, uu, vv, ww), streaming through slabs per block. c_abs is the absolute channel index in the SPW.

ivis.readers.ms_casacore.iter_blocks_channel_slabs(ms_root, uvmin=0.0, uvmax=inf, chan_sel=None, slab=64, keep_autocorr=False, prefer_weight_spectrum=True, n_workers=0, concat=False, beam_sel=None)[source]

Yield slabs for each block, or concatenated slabs if concat=True.

If concat=False:

Yields (bi, block_dir, c0, c1, visI) for each block slab.

If concat=True:

Yields (c0, c1, visI_concat) where visI_concat has all beams from all blocks for that channel range (like mode=”concat” but streaming).

ivis.readers.ms_casacore.iter_channel_slabs(ms_dir, uvmin=0.0, uvmax=inf, chan_sel=None, rest_freq=1420405751.77, slab=64, keep_autocorr=False, prefer_weight_spectrum=True, n_workers=0, beam_sel=None)[source]

Yield contiguous channel slabs so you can stream a big cube with low RAM.

Yields:

(start, stop, visI) where start/stop are absolute channel indices into the SPW (Python slice semantics), and visI is a VisIData with shape (stop-start, nbeam, nvis_max).

Return type:

Iterator[Tuple[int, int, VisIData]]

ivis.readers.ms_casacore.read_ms_block_I(ms_dir, uvmin=0.0, uvmax=inf, chan_sel=None, rest_freq=1420405751.77, keep_autocorr=False, prefer_weight_spectrum=True, n_workers=0, target_center=None, target_radius=None, beam_sel=None)[source]

Load a directory of .ms files (one per beam) into an I-only, channel-major VisIData.

Primary-beam order is preserved even if some beams are skipped: we do not remove beam slots; we simply avoid reading DATA for out-of-radius beams and leave their slots empty (nvis=0, flag=True).

Return type:

VisIData

ivis.readers.ms_casacore.read_ms_blocks_I(ms_root, uvmin=0.0, uvmax=inf, chan_sel=None, rest_freq=1420405751.77, keep_autocorr=False, prefer_weight_spectrum=True, mode='merge', n_workers=0, target_center=None, target_radius=None, center_tol_deg=1e-12, beam_sel=None)[source]

Load multiple blocks of observations located under ms_root, then either:

  • merge: concatenate vis per beam across blocks, assuming same beam order and centers

  • stack: stack beams (Nblock × beams)

  • separate: return a list of VisIData, one per block

Block discovery policy

  • If ms_root itself contains *.ms directly, it’s treated as a single block.

  • Any immediate subdirectory of ms_root that contains *.ms is also a block.

returns:
  • merge: beams equal to the number of unique centers (per order in block 0)

  • stack: beams equal to the sum of beams across blocks

  • separate: list of VisIData objects

rtype:

VisIData | list[VisIData]