hsd_blflag

Note

Parameters set to None will use intelligent defaults from the pipeline context. Pass explicit values to override context defaults.

hsd_blflag(iteration=None, edge=None, flag_tsys=None, tsys_thresh=None, flag_prfre=None, prfre_thresh=None, flag_pofre=None, pofre_thresh=None, flag_prfr=None, prfr_thresh=None, flag_pofr=None, pofr_thresh=None, flag_prfrm=None, prfrm_thresh=None, prfrm_nmean=None, flag_pofrm=None, pofrm_thresh=None, pofrm_nmean=None, plotflag=None, parallel=None, infiles=None, antenna=None, field=None, spw=None, pol=None)[source]

Flag spectra based on post-baseline quality criteria for single-dish data.

Flags spectra using up to five criteria evaluated on both pre-fit and post-fit spectra:

  • Expected RMS (flag_prfre / flag_pofre): flag based on the expected RMS calculated from the radiometer equation.

  • Calculated RMS (flag_prfr / flag_pofr): flag based on the RMS computed directly from the spectrum.

  • Running mean (flag_prfrm / flag_pofrm): flag based on a running mean comparison for pre-fit and post-fit spectra.

  • Tsys flagging (flag_tsys): flag based on the Tsys values.

The WebLog shows the percentage of flagged data per MS and detailed per-criterion plots; clicking Plots displays figures evaluating each criterion as a function of rows, with flagged data in red and unflagged data in blue.

Parameters:
  • iteration (str | int | None) --

    Number of iterations to perform sigma clipping to calculate threshold value of flagging.

    Default: None (equivalent to 5.0)

  • edge (str | int | list[int] | None) --

    Number of channels to be dropped from the edge. The value must be a list of integer with length of one or two. If list length is one, same number will be applied both side of the band.

    Example: [10,20], [10]

    Default: None (equivalent to [0, 0])

  • flag_tsys (str | bool | None) -- Activate (True) or deactivate (False) Tsys flag. Default is None which is equivalent to True.

  • tsys_thresh (str | int | float | None) -- Threshold value for Tsys flag. Default is None which sets 3.0 as a threshold.

  • flag_prfre (str | bool | None) -- Activate (True) or deactivate (False) flag by expected rms of pre-fit spectra. Default is None which is equivalent to True.

  • prfre_thresh (str | int | float | None) -- Threshold value for flag by expected rms of pre-fit spectra. Default is None which sets 3.0 to a threshold.

  • flag_pofre (str | bool | None) -- Activate (True) or deactivate (False) flag by expected rms of post-fit spectra. Default is None which is equivalent to True.

  • pofre_thresh (str | int | float | None) -- Threshold value for flag by expected rms of post-fit spectra. Default is None which sets 1.333 to a threshold.

  • flag_prfr (str | bool | None) -- Activate (True) or deactivate (False) flag by rms of pre-fit spectra. Default is None which is equivalent to True.

  • prfr_thresh (str | int | float | None) -- Threshold value for flag by rms of pre-fit spectra. Default is None which sets 4.5 to a threshold.

  • flag_pofr (str | bool | None) -- Activate (True) or deactivate (False) flag by rms of post-fit spectra. Default is None which is equivalent to True.

  • pofr_thresh (str | int | float | None) -- Threshold value for flag by rms of post-fit spectra. Default is None which sets 4.0 to a threshold.

  • flag_prfrm (str | bool | None) -- Activate (True) or deactivate (False) flag by running mean of pre-fit spectra. Default is None which is equivalent to True.

  • prfrm_thresh (str | int | float | None) -- Threshold value for flag by running mean of pre-fit spectra. Default is None which sets 5.5 to a threshold.

  • prfrm_nmean (str | int | None) -- Number of channels for running mean of pre-fit spectra. Default is None which sets 5 channels for running mean.

  • flag_pofrm (str | bool | None) -- Activate (True) or deactivate (False) flag by running mean of post-fit spectra. Default is None which is equivalent to True.

  • pofrm_thresh (str | int | float | None) -- Threshold value for flag by running mean of post-fit spectra. Default is None which sets 5.0 to a threshold.

  • pofrm_nmean (str | int | None) -- Number of channels for running mean of post-fit spectra. Default is None which sets 5 channels for running mean.

  • plotflag (str | bool | None) -- True to plot result of data flagging. Default is None which is equivalent to True.

  • parallel (bool | str | None) --

    Execute using CASA HPC functionality, if available.

    Options: 'automatic', 'true', 'false', True, False

    Default: None (equivalent to 'automatic')

  • infiles (str | list[str] | None) --

    ASDM or MS files to be processed. This parameter behaves as data selection parameter. The name specified by infiles must be registered to context before you run hsd_blflag.

    Default: None (process all registered data)

  • antenna (str | list[str] | None) --

    Data selection by antenna names or ids.

    Example: 'PM03,PM04', '' (all antennas)

    Default: None (process all antennas)

  • field (str | list[str] | None) --

    Data selection by field names or ids.

    Example: '*Sgr*,M100', '' (all fields)

    Default: None (process all science fields)

  • spw (str | list[str] | None) --

    Data selection by spw ids.

    Example: '3,4' (spw 3 and 4), '' (all spws)

    Default: None (process all science spws)

  • pol (str | list[str] | None) --

    Data selection by polarizations.

    Example: 'XX,YY' (correlation XX and YY), '' (all polarizations)

    Default: None (process all polarizations)

Return type:

ResultsList[Results]

Notes

QA scoring (per source per spw):

  • QA = 1.0 if additional flagging is 0%-5%.

  • QA = 1.0-0.5 if additional flagging is 5%-50%.

  • QA = 0.0 if additional flagging > 50%.

Examples

  1. Run all flagging rules:

>>> hsd_blflag()