orca.flagging.flag_bad_chans ============================ .. py:module:: orca.flagging.flag_bad_chans .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: orca.flagging.flag_bad_chans.logger Functions --------- .. autoapisummary:: orca.flagging.flag_bad_chans.flag_bad_chans orca.flagging.flag_bad_chans.main Module Contents --------------- .. py:data:: logger .. py:function:: flag_bad_chans(msfile: str, band: str, usedatacol=False, generate_plot=False, apply_flag=False, crosshand=False, uvcut_m: Optional[float] = None) 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. :param msfile: measurement set to flag. :param band: Subband number, must be convertable to integer. :param usedatacol: If True, uses DATA column, else use CORRECTED_DATA. :param generate_plot: generate a plot or not. :param apply_flag: Whether to apply the flags. :param 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]. :param uvcut_m: uvcut in meters before doing thresholding to suppress short baseline flux .. py:function:: main()