self.assertTrue(all(outflag.flatten() == expected_flag.flatten()), msg='Resulting flag differ in antenna%s spw %s row %s (expected %s actual %s)'%(antenna,spw,irow,expected_flag,outflag))
from __main__ import default
from partition import partition
from testutils import copytree_ignore_subversion
from tests.testutils import copytree_ignore_subversion
@contextlib.contextmanager
def mmshelper(vis, separationaxis='auto'):
outputvis = vis.rstrip('/') + '.mms'
os.system('rm -rf {0}*'.format(outputvis))
partition(vis=vis, outputvis=outputvis, separationaxis=separationaxis)
if os.path.exists(outputvis):
os.system('rm -rf {0}*'.format(outputvis))
class sdcal_test(unittest.TestCase):
Unit test for task sdcal.
test00 --- default parameters (raises an error)
test01 --- spwmap comprising list
test02 --- spwmap comprising dictionary
test03 --- spwmap comprising others
test04 --- there is no infile
datapath=os.environ.get('CASAPATH').split()[0]+ '/data/regression/unittest/tsdcal/'
infile1 = 'uid___A002_X6218fb_X264.ms.sel'
for infile in self.infiles:
if os.path.exists(infile):
shutil.copytree(self.datapath+infile, infile)
for infile in self.infiles:
if (os.path.exists(infile)):
if os.path.exists(self.tsystable):
shutil.rmtree(self.tsystable)
def _compareOutFile(self,out,reference):
self.assertTrue(os.path.exists(out))
self.assertTrue(os.path.exists(reference),msg="Reference file doesn't exist: "+reference)
self.assertTrue(listing.compare(out,reference),'New and reference files are different. %s != %s. '%(out,reference))
"""Test00:Check the identification of TSYS_SPECTRuM and FPARAM"""
sdcal(infile=infile, calmode='tsys', outfile=self.tsystable)
compfile1=infile+'/SYSCAL'
subt1=tb.query('', sortlist='ANTENNA_ID, TIME, SPECTRAL_WINDOW_ID', columns='TSYS_SPECTRUM')
tsys1=subt1.getcol('TSYS_SPECTRUM')