Source
solnorm=solnorm,minsnr=minsnr,table=caltable,append=append,fillgaps=fillgaps)
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
from casatasks.private.casa_transition import is_CASA6
if is_CASA6:
from .callibrary import *
from casatasks import casalog
from casatools import calibrater
else:
from callibrary import *
from taskinit import *
calibrater = cbtool
def bandpass(vis=None,caltable=None,
field=None,spw=None,intent=None,
selectdata=None,timerange=None,uvrange=None,antenna=None,scan=None,
observation=None,msselect=None,
solint=None,combine=None,refant=None,minblperant=None,
minsnr=None,solnorm=None,
bandtype=None,smodel=None,corrdepflags=None,
append=None,fillgaps=None,
degamp=None,degphase=None,visnorm=None,
maskcenter=None,maskedge=None,
docallib=None,callib=None,
gaintable=None,gainfield=None,interp=None,spwmap=None,
parang=None):
#Python script
casalog.origin('bandpass')
try:
mycb=calibrater()
# Revert to old VI for BPOLY
if (bandtype=='BPOLY'):
mycb.setvi(old=True,quiet=False);
if ((type(vis)==str) & (os.path.exists(vis))):
mycb.open(filename=vis,compress=False,addcorr=False,addmodel=False)
else:
raise Exception('Visibility data set not found - please verify the name')
mycb.reset()
# Do data selection according to selectdata
casalog.post("NB: bandpass automatically excludes auto-correlations.")
if (selectdata):
# insist no ACs
if len(msselect)>0:
msselect='('+msselect+') && ANTENNA1!=ANTENNA2'
else:
msselect='ANTENNA1!=ANTENNA2'
# pass all data selection parameters in as specified
mycb.selectvis(time=timerange,spw=spw,scan=scan,field=field,
intent=intent, observation=str(observation),
baseline=antenna,uvrange=uvrange,chanmode='none',
msselect=msselect);
else:
# selectdata=F, so time,scan,baseline,uvrange,msselect=''
# using spw and field specifications only