cngi.conversion.read_ms

read_ms(infile, ddis=None, ignore=None, chunks=(400, 400, 64, 2))[source]

Read legacy format MS to xarray Visibility Dataset

The CASA MSv2 format is converted to the MSv3 schema per the specified definition here: https://drive.google.com/file/d/10TZ4dsFw9CconBc-GFxSeb2caT6wkmza/view?usp=sharing

The MS is partitioned by DDI, which guarantees a fixed data shape per partition. This results in separate xarray dataset (xds) partitions contained within a main xds (mxds). There is no DDI in MSv3, so this simply serves as a partition id for each xds.

Parameters
  • infile (str) – Input MS filename

  • ddis (list) – List of specific DDIs to read. DDI’s are integer values, or use ‘global’ string for subtables. Leave as None to read entire MS

  • ignore (list) – List of subtables to ignore (case sensitive and generally all uppercase). This is useful if a particular subtable is causing errors or is very large and slowing down reads. Default is None

  • chunks (4-D tuple of ints) – Shape of desired chunking in the form of (time, baseline, channel, polarization). Larger values reduce the number of chunks and speed up the reads at the cost of more memory. Chunk size is the product of the four numbers. Default is (400, 400, 64, 2)

Returns

Main xarray dataset of datasets for this visibility set

Return type

xarray.core.dataset.Dataset