Source
xxxxxxxxxx
report=self.th.checkall(imexist=[self.img+'1.mask', self.img+'2.mask'], imval=[(self.img+'1.mask',0.0,[50,50,0,1]),(self.img+'1.mask',1.0,[50,50,0,2]),(self.img+'1.mask',1.0,[50,50,0,10]),(self.img+'1.mask',0.0,[50,50,0,11]),(self.img+'2.mask',0.0,[50,50,0,1]),(self.img+'2.mask',1.0,[50,50,0,2]),(self.img+'2.mask',1.0,[50,50,0,10]),(self.img+'2.mask',0.0,[50,50,0,11])])
##########################################################################
##########################################################################
#
# Test programs for the refactored imager : test_refimager
#
# Each of the following categories (classes) has a set of tests within it.
#
# test_onefield # basic tests, deconvolution algorithms
# test_iterbot # iteration control options for mfs and cube
# test_multifield # multiple fields of same type and with different shapes/deconvolvers/gridders
# test_stokes # multiple stokes planes, imaging with flagged correlations..
# test_cube # all things cube. Spectral frame setup, handling empty channels, etc
# test_widefield # facets, wprojection, imagemosaic, mosaicft, awproject
# test_mask # input mask options : regridding, mask file, automasking, etc
# test_modelvis # saving models (column/otf), using starting models, predict-only (setjy)
#
# To run from within casapy :
#
# runUnitTest.main(['test_refimager']) # Run all tests
# runUnitTest.main(['test_refimager[test_onefield]']) # Run tests from test_onefield
# runUnitTest.main(['test_refimager[test_onefield_mtmfs]']) # Run one specific test
# runUnitTest.main(['test_refimager[test_onefield_mtmfs,test_onefield_hogbom]']) # Multiple specific tests
#
# To see the full list of tests : grep "\"\"\" \[" test_refimager.py
#
# These tests need data stored in data/regression/unittest/clean/refimager
#
# For a developer build, to get the datasets locally
#
# --- Get the basic data repo : svn co https://svn.cv.nrao.edu/svn/casa-data/distro data
# --- Make directories : mkdir -p data/regression/unittest/clean; cd data/regression/unittest/clean
# --- Get test datasets : svn co https://svn.cv.nrao.edu/svn/casa-data/trunk/regression/unittest/clean/refimager
#
# ########################################################################
# SKIPPED TESTS
# More tests were added to skip (as of 2019,04,26)
#
# (as of 2019.02.05 - Seven tests total)
# The following tests are currently skipped as the supports of the particular
# modes are not available in parallel mode yet
# =>
# test_multifield_both_cube_diffshape:
# test_multifield_cube_mfs
# test_multifield_cube_mtmfs
# test_cube_21
#
# The following tests in pricipal should be working but curently broken
# until fixes to test or code are properly made.
# => test_multifield_facets_mfs
# test_multifield_facets_mtmfs
# test_cube_D1
#
# Added to skip at least for 5.5
# test_cube_chanchunks
# test_cube_chanchunks_savemodel (possible race conditions)
# test_modelvis_2 (possible race conditions)
# test_modelvis_3 (possible race conditions)
# test_modelvis_5 (possible race conditions)
# test_modelvis_6 (possible race conditions)
# test_modelvis_7 (possible race conditions)
# test_modelvis_8 (possible race conditions)
# test_modelvis_9 (possible race conditions)
# test_modelvis_10 (possible race conditions)
# test_modelvis_11 (possible race conditions)
# test_startmodel_with_mask_mfs(possible race conditions)
# test_startmodel_with_mask_mtmfs(possible race conditions)
#Ressurected from skipping after some fixes
# test_mask_5
# test_iterbot_cube_2
# test_multifield_both_cube
##########################################################################
#
# Datasets
#
# refim_twochan.ms : 2 channels, one 1Jy point source with spectral index of -1.0
# refim_twopoints_twochan.ms : Two point sources, 1Jy and 5Jy, both with spectral index -1.0. For multifield tests.
# refim_point.ms : 1-2 GHz, 20 channels, 1 spw, one 1Jy point source with spectral index -1.0.
# refim_point_withline.ms : refim_point with a 'line' added into 3 channels (just topo)
# refim_mawproject.ms : Two pointing wideband mosaic with 1 point source in between the two pointings
# refim_mawproject_offcenter.ms : Two pointing wideband mosaic with 1 point source at center of one pointing
# refim_point_stokes.ms : RR=1.0, LL=0.8, RL and LR are zero. Stokes I=0.9, V=0.1, U,Q=0.0
# refim_point_linRL.ms : I=1, Q=2, U=3, V=4 in circular pol basis.
#
##########################################################################
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import shutil