ngcasa.flagging.manual_flag

manual_flag(mxds, xds_idx, commands=None, cmd_filename=None)[source]

Implements the ‘manual’ flagging method (equivalent to CASA6’s flagdata manual mode).

Parameters
  • mxds (xarray.core.dataset.Dataset) – Input Dataset

  • xds_idx (int) – Index of the xarray datasets to get counts from (index in the xds’i’ attributes of mxds). This is an oversimplification (early prototyping)

  • commands (List[Dict]) – List of selection commands. Each item in the list represent one selection of data to flag. Every selection item is a dictionary. Selection is currently supported by ‘time’, ‘chan’, ‘antenna’, and ‘pol’. ‘time’, ‘chan’, and ‘pol’ correspond directly to the dimensions of FLAG and DATA varaibles in the xarray datasets. ‘antenna’ is translated to the ‘baseline’ dimension.

  • cmd_filename (filename) – Name of a file with text flagging commands, using the same format as used in the CASA6 pipelines for the “*flagonline.txt” or “*flagcmds.txt” files.

  • - Additional selection parameters / criteria (TBD) –

  • Returns

  • -------

  • xarray.core.dataset.Dataset – Dataset with flags set on the selections given in commands and/or cmd_filename