wodenpy.wodenpy_setup

Methods to write visibilities to uvfits files.

git_helper

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

git_helper.make_gitdict()[source]

Makes a dictionary containing key git information about the repo by running specific commands on the command line

Returns:

git_dict – A dictionary containing git information with keywords: describe, date, branch

Return type:

dictionary

git_helper.retrieve_gitdict()[source]

Attempt to recover the git information that was created during pip install. If found, return the git dictionary. If not, return False

Returns:

git_dict – A dictionary containing git information with keywords: describe, date, branch

Return type:

dictionary

run_setup

run_setup.check_args(args)[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.Namespacer

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, parser_value, metafits_arg, parser_string, do_exit=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()