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 (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
##########################################################################
#
# 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.
#
##########################################################################
import os
import sys
import shutil
import commands
import numpy
from __main__ import default
from tasks import *
from taskinit import *
import unittest
import inspect
import numpy as np
from parallel.parallel_task_helper import ParallelTaskHelper
_ia = iatool( )
_vp = vptool( )
_cb = cbtool( )
from imagerhelpers.test_imager_helper import TestHelpers
## List to be run
def suite():
return [test_onefield, test_iterbot, test_multifield,test_stokes, test_modelvis, test_cube, test_mask, test_startmodel,test_widefield,test_pbcor]
# return [test_onefield, test_iterbot, test_multifield,test_stokes,test_cube, test_widefield,test_mask, test_modelvis,test_startmodel,test_widefield_failing]
refdatapath = os.environ.get('CASAPATH').split()[0] + '/data/regression/unittest/clean/refimager/'
#refdatapath = "/export/home/riya/rurvashi/Work/ImagerRefactor/Runs/UnitData/"
#refdatapath = "/home/vega/rurvashi/TestCASA/ImagerRefactor/Runs/WFtests/"