Source
##########################################################################
# test_task_blcal.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:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.calibration.blcal.html
#
#
##########################################################################
import sys
import os
import unittest
import shutil
import numpy as np
import casatools
from casatasks import blcal, mstransform, casalog
tb = casatools.table()
# Data Path using new data repo
rootpath = casatools.ctsys.resolve('unittest/blcal/')
datapath = rootpath + 'gaincaltest2.ms'
refpath = rootpath + 'gaincaltest2.ms.G0'
calout = 'blcal.cal'
datacopy = 'blcaltestcopy.ms'
def getparam(caltable, colname='CPARAM'):
tb.open(caltable)
outtable = tb.getcol(colname)
tb.close()
return outtable
class blcal_test(unittest.TestCase):
def setUpClass(cls):
pass
def setUp(self):
shutil.copytree(datapath, datacopy)
def tearDown(self):
if os.path.exists(calout):
shutil.rmtree(calout)
if os.path.exists(datacopy):
shutil.rmtree(datacopy)