stats['phase180']['spw2']=mslocal.statistics(column='MODEL',complex_value='phase',field='1',spw='2:180~190',baseline='7&13', time='2015/06/21/04:54:25.1',reportingaxes='field')['FIELD_ID=1']
from __future__ import absolute_import
from __future__ import print_function
from casatasks.private.casa_transition import is_CASA6
from casatools import ctsys, table, ms
from casatasks import setjy, partition
from casatasks.private.parallel.parallel_task_helper import ParallelTaskHelper
ctsys_resolve = ctsys.resolve
from taskinit import tbtool as table
from parallel.parallel_task_helper import ParallelTaskHelper
from casa_stack_manip import stack_frame_find
from __main__ import default
dataRoot = os.path.join(os.environ.get('CASAPATH').split()[0],'data')
def ctsys_resolve(apath):
return os.path.join(dataRoot,apath)
Unit tests for task setjy.
1. Does setjy(modimage=modelimu, fluxdensity=0) NOT scale the model image's
2. Does setjy(modimage=modelimu) scale the model image's flux density?
3. Solar system (Uranus) flux density calibration.
datapath = ctsys_resolve('regression/unittest/setjy')
if 'TEST_DATADIR' in os.environ:
DATADIR = str(os.environ.get('TEST_DATADIR'))+'/setjy'
if os.path.isdir(DATADIR):
print('setjy tests will use data from '+datapath)
if 'BYPASS_PARALLEL_PROCESSING' in os.environ:
ParallelTaskHelper.bypassParallelProcessing(1)
class SetjyUnitTestBase(unittest.TestCase):
def setUpMS(self,MS, ismms=False):
print("\nCreate a new local copy of the MS...")
os.system('cp -rH ' + os.path.join(datapath,self.inpms) + ' ' + self.inpms)
os.system('cp -rf ' + os.path.join(datapath,self.inpms) + ' ' + self.inpms)
self.createMMS(self.inpms)
if os.path.exists(self.inpms):
print("\nRemoving a local copy of MS from the previous test...")
shutil.rmtree(self.inpms)