orca.utils.flagutils
Flag file utilities for antenna and visibility flagging.
Provides functions for reading and writing flag data, looking up bad antennas from the flag database, and visualizing flag statistics.
Attributes
Functions
|
Return a list of bad antennas for a given date and kinds of flags. |
|
Unpacks binary flag metadata from a packed binary file into its original FLAG column shape. |
Plots the flag metadata for all polarizations in a single subplot figure. |
|
|
Get a list of bad antenna names (e.g., 'LWA-005B') using the 'development' conda environment. |
|
Module Contents
- orca.utils.flagutils.get_bad_ants(date: datetime.date, sources=['AI-VAR', 'AI-LO'])[source]
Return a list of bad antennas for a given date and kinds of flags.
- Parameters:
date – The date
sources – Sources of flags. Default is [‘AI-VAR’, ‘AI-LO’].
- Returns:
A list of bad antenna corr numbers.
- orca.utils.flagutils.unpack_flag_metadata(input_file: str, original_shape: tuple) numpy.ndarray[source]
Unpacks binary flag metadata from a packed binary file into its original FLAG column shape.
Parameters:
- input_filestr
Path to the binary file containing the packed flag data.
- original_shapetuple
The shape of the original FLAG array (e.g., (polarizations, channels, rows)).
Returns:
- np.ndarray
A Boolean array of the same shape as the original FLAG column.
- orca.utils.flagutils.plot_flag_metadata_all_polarizations_subplot(flags: numpy.ndarray, output_dir: str = None) None[source]
Plots the flag metadata for all polarizations in a single subplot figure.
Parameters:
- flagsnp.ndarray
A Boolean array of shape (polarizations, channels, rows) representing the flag data.
- output_dirstr, optional
Directory where the plot will be saved. If None, the plot is displayed interactively.