Source
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']
########################################################################
# test_task_setjy.py
#
# Copyright (C) 2018
# Associated Universities, Inc. Washington DC, USA
#
# This script is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# [Add the link to the JIRA ticket here once it exists]
#
# Based on the requirements listed in plone found here:
# https://casadocs.readthedocs.io/en/stable/api/tt/casatasks.imaging.setjy.html
#
#
##########################################################################
import shutil
import unittest
import numpy as np
import os
import filecmp
import numpy
from casatools import ctsys, table, ms
from casatasks import setjy, partition
from casatasks.private.parallel.parallel_task_helper import ParallelTaskHelper
mslocal = ms()
ctsys_resolve = ctsys.resolve
"""
Unit tests for task setjy.
Features tested:
1. Does setjy(model=modelimu, fluxdensity=0) NOT scale the model image's
flux density?
2. Does setjy(model=modelimu) scale the model image's flux density?
3. Solar system (Uranus) flux density calibration.
"""
datapath = ctsys_resolve('unittest/setjy/')
#datapath = '/export/home/murasame2/casadev/vlanewmodels/'
# Pick up alternative data directory to run tests on MMSs
testmms = False
if 'TEST_DATADIR' in os.environ:
DATADIR = str(os.environ.get('TEST_DATADIR'))+'/setjy'
if os.path.isdir(DATADIR):
testmms = True
datapath = DATADIR
print('setjy tests will use data from '+datapath)
if 'BYPASS_PARALLEL_PROCESSING' in os.environ:
ParallelTaskHelper.bypassParallelProcessing(1)