" antenna='ea17' spw='0:1~2;4~11' timerange='2010/04/08/20:04:50.614~2010/04/08/20:05:07.259,2010/04/08/20:04:50.917~2010/04/08/20:04:58.403,2010/04/08/20:06:01.627~2010/04/08/20:06:05.527,2010/04/08/20:06:16.444~2010/04/08/20:06:20.656,2010/04/08/20:06:36.308~2010/04/08/20:06:40.113,2010/04/08/20:06:56.059~2010/04/08/20:06:59.095,2010/04/08/20:07:16.302~2010/04/08/20:07:19.909,2010/04/08/20:07:36.027~2010/04/08/20:07:40.325,2010/04/08/20:07:56.374~2010/04/08/20:08:00.534,2010/04/08/20:08:16.436~2010/04/08/20:08:20.406,2010/04/08/20:08:35.928~2010/04/08/20:08:39.026,2010/04/08/20:08:56.301~2010/04/08/20:08:59.788,2010/04/08/20:09:16.035~2010/04/08/20:09:20.368,2010/04/08/20:09:36.382~2010/04/08/20:09:40.741,2010/04/08/20:09:56.591~2010/04/08/20:10:00.388,2010/04/08/20:10:16.083~2010/04/08/20:10:19.120,2010/04/08/20:10:36.085~2010/04/08/20:10:39.700,2010/04/08/20:10:49.701~2010/04/08/20:11:07.582,2010/04/08/20:10:49.900~2010/04/08/20:10:57.482,2010/04/08/20:10:50.401~2010/04/08/20:10:54.665'",
Unit tests for task split.
1. Are the POLARIZATION, DATA_DESCRIPTION, and (to some extent) the
SPECTRAL_WINDOW tables correct with and without correlation selection?
2. Are the data shapes and values correct with and without correlation
3. Are the WEIGHT and SIGMA shapes and values correct with and without
4. Is a SOURCE table with bogus entries properly handled?
5. Is the STATE table properly handled?
6. Are generic subtables copied over?
7. Are CHAN_WIDTH and RESOLUTION properly handled in SPECTRAL_WINDOW when
channels are being selected and/or averaged?
8. The finer points of spw:chan selection.
Note: The time_then_chan_avg regression is a more "end-to-end" test of split.
from __future__ import absolute_import
from __future__ import print_function
from casatasks.private.casa_transition import *
sys.path.append(os.path.abspath(os.path.dirname(__file__)))
from recipes.listshapes import listshapes
from casatestutils import testhelper as th
from casatasks import cvel, flagcmd, flagdata, importasdm, listobs, partition, split
from casatools import ctsys, ms, msmetadata, table
from casatasks.private.parallel.parallel_task_helper import ParallelTaskHelper
ctsys_resolve = ctsys.resolve
from __main__ import default
from recipes.listshapes import listshapes
from casatestutils import testhelper as th
from tasks import cvel, flagcmd, flagdata, importasdm, listobs, partition, split
from taskinit import mstool as ms
from taskinit import msmdtool as msmetadata
from taskinit import tbtool as table
from parallel.parallel_task_helper import ParallelTaskHelper
from casa_stack_manip import stack_frame_find
def ctsys_resolve(apath):
dataPath = os.path.join(os.environ['CASAPATH'].split()[0],'casatestdata/')
return os.path.join(dataPath,apath)
datapath = ctsys_resolve('unittest/split/')
if 'TEST_DATADIR' in os.environ:
DATADIR = str(os.environ.get('TEST_DATADIR'))
if os.path.isdir(DATADIR):
datapath = DATADIR+'/split/'
print('split tests will use data from '+datapath)
if 'BYPASS_PARALLEL_PROCESSING' in os.environ:
ParallelTaskHelper.bypassParallelProcessing(1)
Start of old tests, which are the same as test_split.
class SplitFlags on are new tests.