wodenpy.wodenpy_setup¶
Methods to write visibilities to uvfits files.
git_helper¶
Functions to help with git information retrieval
- git_helper.get_commandline_output(command_list)[source]¶
Takes a command line entry separated into list entries, and returns the output from the command line as a string
- Parameters:
command_list (list of strings) – list of strings that when combined form a coherent command to input into the command line
- Returns:
output – the output result of running the command
- Return type:
string
run_setup¶
Functions to parse arguments from the command line, check validity of arguments, and read relevant information from linked files, all for run_woden.py
- run_setup.check_args(args: Namespace) Namespace[source]¶
Check that the combination of arguments parsed will work with the WODEN executable. Attempts to grab information from a metafits file if possible. Should error with helpful messages if a combination that won’t work is attempted by the user
- Parameters:
args (argparse.Namespace) – The populated arguments args = parser.parse_args()` as returned from the parser given by
get_parser()- Returns:
args – The populated arguments which will now have been checked and had information from metafits incorporated if requested
- Return type:
argparse.Namespace
- run_setup.get_antenna_order(tilenames: ndarray) ndarray[source]¶
Reorder the antennas to be consistent with hyperdrive. This is done by reordering off the tiles names tilenames from the metafits, rather than the index in the metafits. As there are two polarisations per tile, be careful to reorder both pols correctly.
- Parameters:
tilenames (np.ndarray) – As read in from the hdus[1].data[‘Tile’] from the metafits
- Returns:
Indexes to reorder the antennas
- Return type:
np.ndarray
- run_setup.get_code_version()[source]¶
Returns either the git hash if installed via a git repo, or the __version__ if installed from a release
- Returns:
version – Either the git commit or release version
- Return type:
string
- run_setup.get_parser()[source]¶
Runs the argument parser to get command line inputs - used by sphinx and argparse extension to unpack the help below into the online readthedocs documentation.
- Returns:
parser – The populated argument parser used by run_woden.py
- Return type:
argparse.ArgumentParser
- run_setup.select_argument_and_check(parser_arg: bool, parser_value: bool, metafits_arg: bool, parser_string: str, do_exit: bool = True)[source]¶
Some arguments taken from the argparse.parser should override settings from the metafits if present. If the parser argument parser_arg is defined (i.e. not False), update it to equal parser_value. If not defined, update parser_arg to metafits_arg, which is the value read in from the metafits file. If both parser_arg and metafits_arg are False, WODEN will fail, so exit with a message. Use parser_string to define which parser arguement has failed; this will be included in the error message.
- Parameters:
parser_arg (attribute of argparse.Namespace) – The option in args to update
parser_value (Expected type for parser_arg) – The value to set parser_arg to (e.g. float(parser_arg))
metafits_arg (Expected type for parser_arg) – The value read in from the metafits if using metafits; False if not
parser_string (string) – The parser option under test to be written out in the error message, e.g. “–MWA_FEE_delays”
do_exit (Boolean) – Whether to call sys.exit upon both parser_arg and metafits_arg being False. Defaults to True
- Returns:
parser_arg – The update option in args
- Return type:
attribute of argparse.Namespace
- run_setup.select_correct_enh(args)[source]¶
Depending on whether we are reading the array layout from the metafits file or a text file, read in the correct amount of east,north,height coords. Sets args.east, args.north, args.height, args.num_antennas, and args.array_layout_name.
- Parameters:
args (argparse.Namespace) – The populated arguments args = parser.parse_args()` as returned from the parser given by
get_parser()