Source
xxxxxxxxxx
gaincal(vis=datacopy,caltable=caltab,field='1',spw='1,2,3',solint='inf',refant='5',smodel=[1,0,0,0],minsnr=0.0)
##########################################################################
# test_task_polfromgain.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.calibration.polfromgain.html
#
#
##########################################################################
import os
import unittest
import shutil
import time
from casatestutils import generate_weblog
from casatestutils import stats_dict
from casatestutils import add_to_dict
from casatestutils.compare import compare_caltables
from casatestutils.compare import compare_dictionaries
import casatools
from casatasks import polfromgain,gaincal
tb = casatools.table()
import sys
import os
import numpy as np
# DATA #
# these are not data appropriate for polfromgain and are no longer needed (gmoellen 2023Dec18):
#datapath = casatools.ctsys.resolve('unittest/polfromgain/ngc5921.ms/')
#caldata = casatools.ctsys.resolve('unittest/polfromgain/ngcgain.G0/')
#refcal = casatools.ctsys.resolve('unittest/polfromgain/polfromgainCalCompare.cal')
# The following should be mad a soft link within unittest/polfromgain:
datapath = casatools.ctsys.resolve('unittest/polfromgain/polcal_LINEAR_BASIS.ms/')
datacopy = 'polfromgaintest.ms'
caltab = 'polfromgaintest.G'
outcaltab = 'polfromgaintest.Gcor'
class polfromgain_test(unittest.TestCase):
def setUp(self):
shutil.copytree(datapath, datacopy)
def tearDown(self):
shutil.rmtree(datacopy)