$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ Gain correction pipeline for global VLBI $ $ Hiroshi Imai 10 June 2002 $ $ 08 December 2002 for GP032 (EVNL.001) $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ dowait 1 clrtemp $ $ delete pre-existing tables $ proc tabclear uvclass='msort';uvseq=1 indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; tbfind ('TY', ii); if (ii > 0) doextd ('TY', 1, ii); tbfind ('GC', ii); if (ii > 0) doextd ('GC', 1, ii); tbfind ('SN', ii); if (ii > 0) doextd ('SN', 1, ii); tbfind ('CL', ii); if (ii >= 2) doextd ('CL', 2, ii); return; finish proc evnantab $ $ delete the outermost channels because of the bad bandpass $ Use .chflag file created for global VLBI. $ if (delch = 1) then chflag='.chflag chflag=expname!!chflag startof ('uvflg'); version = tver; task 'uvflg' inname = expname; inclass = uvclass; inseq = uvseq; indisk=disk infile=dir!!chflag; source ' '; subarr 1; selband -1; selfreq -1; freqid -1; timerang 0; bchan 1; echan 0; bif 1; eif 0; antenn 0; baseline 0; stokes ' '; flagver 0; aparm 0; opcod 'flag'; reason ' '; bdrop 0; edrop 0; dohist 0; go; endof ('uvflg') end $ antabext='.antab startof('antab'); version = tver; task 'antab' indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; infile=dir!!expname!!antabext suba 0; tyver 1; gcver 1; blver -1; sparm ' '; prtlev 0; offset=0.3; go; endof('antab') return; finish proc vlbaantab antabext='cal.vlba startof('vlog'); version = tver; task 'vlog' indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; infile=dir!!expname!!antabext;outfile=dir!!expname fqtol=-1;prtlev=1 go; endof('vlog') startof('antab'); version = tver; task 'antab' indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; suba 0; tyver 1; gcver 1; blver -1; sparm ' '; prtlev 0; offset=0.3; $ clear READ status clrstat antabext='.TSYS';infile=dir!!expname!!antabext;go;wait antabext='.vlbagain infile=dir!!expname!!antabext;go;wait endof('antab') return; finish proc yantab startof('setjy'); version = tver; task 'setjy'; indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; stokes ' '; bif=1; eif=0; freqid 1 zerosp 0;optype'calc';calcode'';aparm=0;source '' jj=0 for ii=1 to nsrc if(srclst(ii)='3C286') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='1328+307') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='3C48') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='0134+329') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='3C295') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='3C147') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='0538+498') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='3C138') then;jj=jj+1;source(jj)=srclst(ii);end if(srclst(ii)='0518+165') then;jj=jj+1;source(jj)=srclst(ii);end end go; endof('setjy') startof('antab'); version = tver; task 'antab' indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; suba 0; tyver 1; gcver 1; blver -1; sparm ' '; prtlev 0; offset=0.3; antabext='cal.y infile=dir!!expname!!antabext go;endof('antab') return; finish proc gapcal $ what polarizations are in the data set (D=dual, LL=LCP only, RR=RCP only) if (pols='') then;pols='D';end if (pols='D') then;npols=2;lpol=1;rpol=1;end if (pols='LL') then;npols=1;lpol=1;rpol=0;end if (pols='RR') then;npols=1;lpol=0;rpol=1;end if (doprint <> 0) then; tbfind ('PL', ii) if (rpol=1) then dosnp (disk, expname, uvclass, uvseq, 'TY', 1, 'TSYS', 'R', 1, 0, -1) end if (lpol=1) then dosnp (disk, expname, uvclass, uvseq, 'TY', 1, 'TSYS', 'L', 1, 0, -1) end tbfind ('PL',jj) if (jj > ii) then; doprint=-1 doplot (ii+1, jj, dir2!!expname!!'_tsys.ps'); doextd ('PL', ii+1, jj); end end $ startof('apevn'); version = tver; task 'apevn'; indisk=disk; innam=expname; inclass=uvclass; inseq=uvseq; anten 0; suba 1; stokes ' '; bif=1; eif=0; freqid 1; source ' '; timer 0; tyver 1; gcver 1; snver 1; opcode ' '; aparm 0; solint 0; prtlev 1; dotv -1; ltype 3; antabext='.WX' infile=dir!!expname!!antabext go; endof('apevn') $ runcl (expname, disk, uvclass, 1, 1, 2, '2PT', 0,-1) $ $ plot the cl table $ if (doprint <> 0) then tbfind ('PL', ii); if (rpol=1) then for incif=1 to nif dosnp (disk, expname, uvclass, uvseq,'CL',2,'AMP','R',incif,incif,-1) end end if (lpol=1) then for incif=1 to nif dosnp (disk, expname, uvclass, uvseq,'CL',2,'AMP','L',incif,incif,-1) end end $ tbfind ('PL',jj) if (jj > ii) then doplot (ii+1, jj, dir2!!expname!!'_gain.ps') doextd ('PL', ii+1, jj) end end return; finish proc gantab tabclear evnantab vlbaantab $ yantab gapcal return; finish