Source
appendantab(vis=data_copy, outvis=append_data, antab=evn_antab, overwrite=False, append_tsys=False, append_gc=True)
#########################################################################
# test_task_appendantab.py
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA.
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
#
# Based on the requirements listed in casadocs found here:
#
#
##########################################################################
import os
import shutil
import unittest
from unittest.mock import patch
import numpy as np
from casatestutils import testhelper as th
from casatasks import appendantab
from casatools import ctsys, table
tb = table()
datapath = ctsys.resolve('unittest/appendantab')
# input data
evn_data = "idi1.ms"
evn_antab = os.path.join(datapath, "n14c3.antab")
append_data = "appendedData.ms"
evn_ref = os.path.join(datapath, "appendantab_test.ms")
data_copy = "dataCopy.ms"
'''def compare_tsys(res, ref):
compare_table = {}
result = True
# get all the cols from result
tb.open(res + "/SYSCAL")
res_cols = tb.colnames()
for col in res_cols:
if col not in compare_table:
compare_table[col] = tb.getcol(col)
tb.close()
# get all the cols from ref table
tb.open(ref + "/SYSCAL")
ref_cols = tb.colnames()
for col in ref_cols:
if col not in compare_table:
result = False
print(tb.getcol(ref) == compare_table[col])
#diff = np.all(np.isclose(tb.getcol(ref), compare_table[col]))