gaincal(vis=merged_copy2, caltable=tempCal, uvrange='>0.0', field='0,1', spw='0', gaintype='G', minsnr=2.0, refant='ANT5', solint='inf', combine='')
from casatasks import gaincal, casalog, mstransform
from __main__ import default
datapath = casatools.ctsys.resolve('visibilities/vla/gaincaltest2.ms')
compCal = casatools.ctsys.resolve('caltables/gaincaltest2.ms.G0')
tCal = casatools.ctsys.resolve('caltables/gaincaltest2.ms.T0')
combinedRef = casatools.ctsys.resolve('caltables/genDataCombine.G0')
preTRef = casatools.ctsys.resolve('caltables/genDataPreT.G0')
preGRef = casatools.ctsys.resolve('caltables/genDataPreG.T0')
calModeP = casatools.ctsys.resolve('caltables/calModeTest.G0')
calModeA = casatools.ctsys.resolve('caltables/calModeTest.G1')
typeCalK = casatools.ctsys.resolve('caltables/gaintypek.G0')
typeCalSpline = casatools.ctsys.resolve('caltables/gaintypeSpline.G0')
spwMapCal = casatools.ctsys.resolve('caltables/spwMap.G0')
merged_dataset1 = casatools.ctsys.resolve('visibilities/vla/ngc5921.ms')
merged_refcal1 = casatools.ctsys.resolve('caltables/ngc5921.ref1a.gcal')
merged_refcal2 = casatools.ctsys.resolve('caltables/ngc5921.ref2a.gcal')
merged_dataset2 = casatools.ctsys.resolve('visibilities/vla/ngc4826.ms')
merged_refcal3 = casatools.ctsys.resolve('caltables/ngc4826.ref1b.gcal')
if os.path.exists(os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req'):
datapath = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/visibilities/vla/gaincaltest2.ms'
compCal = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/gaincaltest2.ms.G0'
tCal = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/gaincaltest2.ms.T0'
combinedRef = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/genDataCombine.G0'
preTRef = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/genDataPreT.G0'
preGRef = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/genDataPreG.T0'
calModeP = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/calModeTest.G0'
calModeA = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/calModeTest.G1'
typeCalK = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/gaintypek.G0'
typeCalSpline = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/gaintypeSpline.G0'
spwMapCal = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/spwMap.G0'
merged_dataset1 = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/visibilities/vla/ngc5921.ms'
merged_refcal1 = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/ngc5921.ref1a.gcal'
merged_refcal2 = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/ngc5921.ref2a.gcal'
merged_dataset2 = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/visibilities/vla/ngc4826.ms'
merged_refcal3 = os.environ.get('CASAPATH').split()[0] + '/data/casa-data-req/caltables/ngc4826.ref1b.gcal'
datapath = os.environ.get('CASAPATH').split()[0] + '/casa-data-req/visibilities/vla/gaincaltest2.ms'
compCal = os.environ.get('CASAPATH').split()[0] + '/casa-data-req/caltables/gaincaltest2.ms.G0'
tCal = os.environ.get('CASAPATH').split()[0] + '/casa-data-req/caltables/gaincaltest2.ms.T0'