Source
self.res = virtualconcat(vis=['part1.ms','part2-mod.ms','part3.ms'],concatvis=msname, visweightscale=[3.,2.,1.], keepcopy=True)
#############################################################################
# $Id:$
# Test Name: #
# Unit Test Script for the virtualconcat task
#
# #
#############################################################################
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import shutil
import glob
import time
import unittest
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from casatools import ctsys, calibrater, table, ms
from casatasks import virtualconcat, concat, listobs
cb = calibrater( )
tb = table( )
_ms = ms( )
else:
from __main__ import default
from tasks import *
from taskinit import *
cb = cbtool( )
# global tb is used
# use global ms as _ms
_ms = ms
myname = 'test_virtualconcat'
# name of the resulting MS
msname = 'concatenated.ms'
testmms=False
def checktable(thename, theexpectation, multims=False):
global msname, myname
if multims:
tb.open(msname+"/SUBMSS/"+thename)
else:
tb.open(msname+"/"+thename)
if thename == "":
thename = "MAIN"
for mycell in theexpectation:
print(myname, ": comparing ", mycell)
value = tb.getcell(mycell[0], mycell[1])
# see if value is array
try:
isarray = value.__len__
except:
# it's not an array
# zero tolerance?
if mycell[3] == 0:
in_agreement = (value == mycell[2])
else:
in_agreement = ( abs(value - mycell[2]) < mycell[3])
else: