orca.flagging.flag_bad_chans

Channel flagging based on visibility amplitude statistics.

Identifies bad frequency channels by analyzing visibility amplitude and SNR distributions. Uses median filtering to detect outliers.

Originally adapted from Marin Anderson’s code (3/8/2019).

Functions

flag_bad_chans

Identify and optionally apply channel flags.

Attributes

logger

Functions

flag_bad_chans(msfile, band[, usedatacol, ...])

Flag bad channels.

main()

Module Contents

orca.flagging.flag_bad_chans.logger[source]
orca.flagging.flag_bad_chans.flag_bad_chans(msfile: str, band: str, usedatacol=False, generate_plot=False, apply_flag=False, crosshand=False, uvcut_m: float | None = None)[source]

Flag bad channels. Finds remaining bad channels and flags those in the measurement set. Also writes out text file that lists flags that were applied.

Parameters:
  • msfile – measurement set to flag.

  • band – Subband number, must be convertable to integer.

  • usedatacol – If True, uses DATA column, else use CORRECTED_DATA.

  • generate_plot – generate a plot or not.

  • apply_flag – Whether to apply the flags.

  • crosshand – If true, it will use the XY and YX correlations when determining flags. Otherwise, it will ignore the flags that are in flaglist[:,1] and flaglist[:,2].

  • uvcut_m – uvcut in meters before doing thresholding to suppress short baseline flux

orca.flagging.flag_bad_chans.main()[source]