orca.flagging package

Submodules

orca.flagging.flag_bad_ants module

orca.flagging.flag_bad_ants.concat_dada2ms(dadafile_dir: str, BCALdadafile: str, outputdir: str)[source]

Concatenate spws using dada2ms into single ms file. For passing to flag_bad_ants.

orca.flagging.flag_bad_ants.flag_ants_from_postcal_autocorr(msfile: str, tavg: bool = False, thresh: float = 4) → Optional[str][source]

Generates a text file containing the bad antennas. DOES NOT ACTUALLY APPLY FLAGS. CURRENTLY SHOULD ONLY BE RUN ON SINGLE SPW MSs.

Parameters
  • msfile

  • tavg – If set to True, will time average before evaluating flags.

  • thresh – Threshold to use for flagging. Default is 4.

Returns

Path to the text file with the list of antennas to flag.

orca.flagging.flag_bad_ants.flag_bad_ants(msfile: str) → str[source]

Generates a text file containing the bad antennas. DOES NOT ACTUALLY APPLY FLAGS.

Parameters

msfile – msfile to generate

Returns

Path to the text file with list of antennas to flag.

orca.flagging.flag_bad_ants.main()[source]
orca.flagging.flag_bad_ants.plot_autos(msfile: str)[source]

Plot autocorrelations, grouped by ARX board.

orca.flagging.flag_bad_chans module

Copy from Marin Anderson 3/8/2019

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)[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 – spectral window.

  • 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]

orca.flagging.flag_bls module

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

orca.flagging.flagoperations module

Copy from Marin Anderson 3/8/2019

orca.flagging.flagoperations.flag_bls(msfile: str, blfile: str) → str[source]

Input: msfile, .bl file Applies baseline flags to FLAG column.

orca.flagging.flagoperations.merge_flags(ms1: str, ms2: str) → Tuple[str, str][source]
orca.flagging.flagoperations.merge_group_flags(ms_list: List[str]) → List[str][source]
orca.flagging.flagoperations.save_to_flag_npy(ms: str, flag_npy: str) → str[source]
orca.flagging.flagoperations.write_to_flag_column(ms: str, flag_npy: str) → str[source]

Module contents