#################################################################################################
def appendantab(vis=None, outvis=None, antab=None,
overwrite=False, append_tsys=True, append_gc=True):
# disallow writing to the input vis
print("Please provide a path for outvis different to the input vis")
# Require an outvis to be specified
print('Please provide an outvis name to write to')
ant_names = msmd.antennastations()
n_band = len(msmd.bandwidths())
spws = msmd.spwfordatadesc()
# get start time and end time from ms
times = tb.getcol('TIME')
# remove existing data copy
if os.path.exists(outvis) and overwrite:
print("REMOVING EXISTING COPY")
elif os.path.exists(outvis) and not overwrite:
print("File ", outvis, " already exists, set overwrite=True or change outvis name")
# Check if the outvis already exists
if os.path.exists(outvis):
print("File ", outvis, " already exists, change outvis name")
# run the antab parsing and table filling
shutil.copytree(vis, outvis)
interpreter = AntabInterp(vis, outvis, antab, ant_names, n_band, spws,
append_tsys, append_gc, overwrite)
#antab_interp(vis, outvis, antab, ant_names, n_band, spws,
# append_tsys, append_gc, overwrite)
interpreter.antab_interp()