-
Notifications
You must be signed in to change notification settings - Fork 0
Self Cal: Sample Script
cmoeckel91 edited this page Mar 6, 2018
·
5 revisions
# Setting the variables
vis_previous = 'kband_SC_i1v5.ms'
vis = 'kband_SC_i2v5.ms'
caltable = 'table_i2v5.cal'
# Splitting out only the corrected data
split(vis=vis_previous,outputvis=vis,keepmms=True,field="",spw="",
scan="",antenna="",correlation="",timerange="",intent="",
array="",uvrange="",observation="",feed="",datacolumn="corrected",
keepflags=True,width="1",timebin="0s",combine="")
# Inserting a model into the model column.
#model = 'ldmodel_T132_S3000'
ft(vis=vis,field="",spw="",model=model,nterms=1,
reffreq="",complist="",incremental=False,usescratch=False)
# Running the gain cal
solint = '60s'
uvrange= '0~15000m'
refant = 'ea19'
gaincal(vis=vis,caltable=caltable,field="",spw="",intent="",
selectdata=True,timerange="",uvrange=uvrange,antenna="",scan="",
observation="",msselect="",solint=solint,combine="",preavg=-1.0,
refant=refant,refantmode="flex",minblperant=4,minsnr=3.0,solnorm=False,
gaintype="T",smodel=[],calmode="p",append=False,splinetime=3600.0,
npointaver=3,phasewrap=180.0,docallib=False,callib="",gaintable=[],
gainfield=[],interp=[],spwmap=[],parang=False)
# Checking if the solutions have a recognizable trend
plotcal(caltable=caltable,xaxis="time",yaxis="phase",poln="",field="",
antenna="",spw="",timerange="",subplot=441,overplot=False,
clearpanel="Auto",iteration="antenna",plotrange=[],showflags=False,plotsymbol="o",
plotcolor="blue",markersize=5.0,fontsize=10.0,showgui=True,figfile="")
# If the solutions are good, apply them to the measurement set.
applycal(vis="kband_SC_i1v5.ms",field="",spw="",intent="",selectdata=True,
timerange="",uvrange="",antenna="",scan="",observation="",
msselect="",docallib=False,callib="",gaintable=caltable,gainfield=[],
interp=[],spwmap=[],calwt=[True],parang=False,applymode="",
flagbackup=True)
# Run Tclean to obtain an image
imagename = 'kband_SC_i1_S3000v5_dirty' #Imagename
niter = 1 # Number of iterations
imsize = [3000]
cell=['0.14arcsec']
scales=[0, 3, 50, 10, 20]
tclean(vis=vis,selectdata=False,field="",spw="",timerange="",
uvrange="",antenna="",scan="",observation="",intent="",
datacolumn="corrected",imagename=imagename,imsize=imsize,cell=cell,phasecenter="",
stokes="I",projection="SIN",startmodel="ldmodel_T132_S3000",specmode="mfs",reffreq="",
nchan=-1,start="",width="",outframe="LSRK",veltype="radio",
restfreq=[],interpolation="linear",gridder="standard",facets=1,chanchunks=1,
wprojplanes=1,vptable="",aterm=True,psterm=False,wbawp=True,
conjbeams=False,cfcache="",computepastep=360.0,rotatepastep=360.0,pblimit=0.2,
normtype="flatnoise",deconvolver="multiscale",scales=scales,nterms=2,smallscalebias=0.6,
restoration=True,restoringbeam=[],pbcor=False,outlierfile="",weighting="briggs",
robust=0.75,npixels=0,uvtaper=[],niter=niter,gain=0.1,
threshold=0.0,cycleniter=-1,cyclefactor=1.0,minpsffraction=0.05,maxpsffraction=0.8,
interactive=True,usemask="user",mask="",pbmask=0.0,maskthreshold="",
maskresolution="",nmask=0,sidelobethreshold=3.0,noisethreshold=5.0,lownoisethreshold=1.5,
negativethreshold=0.0,smoothfactor=1.0,minbeamfrac=0.3,cutthreshold=0.01,growiterations=75,
restart=True,savemodel="none",calcres=True,calcpsf=True,parallel=False)