add_woden_uvfits.py

Helper script to add visibilities inside of two sets of uvfits files. Useful for example if you have a set of 21cm signal visibilities that you want to add different types of foregrounds to; you only have to run the 21cm simulation once, then run different foregrounds with the same observational settings, and just add the foregrounds on top as visibilities are additive.

Warning

This script is pretty dumb, so as long as the data have the same shape it will add the contents - it does NOT check if they have the same phase centre, frequencies, time stamps, etc. etc. use at your own risk

Command line running options

Sum the visibilities in a set of uvfits. There are two modes to add uvfits as decribed here. Mode 1: Assumes that the uvfits still end in ‘*{num}.uvfits’, and so iterates over a given number of bands, so if you have 8 bands to combine, you end up with 8 summed uvfits files.Mode 1 uses the –num_bands, –uvfits_prepend1, –uvfits_prepend2, –output_name_prepend arguments. Mode 2: This just adds two specific uvfits files together via –uvfits1, –uvfits2 and –output_name DISCLAIMER - only very minimal checks are made that the two sets of visibilities make sense to be summed. Add uvfits at your own discretion.

usage: add_woden_uvfits.py [-h] [--uvfits_prepend1 UVFITS_PREPEND1]
                           [--uvfits_prepend2 UVFITS_PREPEND2]
                           [--output_name_prepend OUTPUT_NAME_PREPEND]
                           [--num_bands NUM_BANDS] [--uvfits1 UVFITS1]
                           [--uvfits2 UVFITS2] [--output_name OUTPUT_NAME]

ADDING COARSE BAND UVFITS

--uvfits_prepend1

Prepend for the first set of uvfits files e.g. ./data/uvdump_

Default: False

--uvfits_prepend2

Prepend for the second set of uvfits files e.g. ./data2/uvdump_

Default: False

--output_name_prepend

Name for output summed uvfits file, default: combined_band

Default: “combined_band”

--num_bands

How many pairs of files to combine - default is 24

Default: 24

ADDING SINGLE PAIR OF UVFITS

--uvfits1

Name of the first uvfits file to sum e.g. uvfits1.uvfits

Default: False

--uvfits2

Name of the second uvfits file to sum e.g. uvfits2.uvfits

Default: False

--output_name

Name for output summed uvfits file, default: combined.uvfits

Default: “combined.uvfits”

Function documentation

add_woden_uvfits.check_args(args)[source]

Check that the args returned by

add_woden_uvfits.check_same_dimensions(hdu1, hdu2)[source]

Bear minimum check that the uvfits data sections are the same size

add_woden_uvfits.combine_uvfits(uvfits1, uvfits2, outname)[source]

Opens uvfits1, uvfits2, reads in the visibilities from both, and sums them. Saves the result using the hdu of uvfits1, and leaves the weights of uvfits1 in the outputs. So output data have the array layout of uvfits1, u,v,w of uvfits1 etc, only visibilities are changed

add_woden_uvfits.combine_uvfits_bands(uvfits_prepend1, uvfits_prepend2, num_bands, output_name)[source]

Runs combine_uvfits on multiple pairs of uvfits, with names generated by adding {band}.uvfits onto the end of uvfits_prepend1 and uvfits_prepend2

add_woden_uvfits.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 add_woden_uvfits.py

Return type:

argparse.ArgumentParser

add_woden_uvfits.main()[source]

Runs all the things