$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $ Gain correction pipeline for glaba VLBI $ $ Hiroshi Imai 16 August 2002 (for GM041A only) $ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ 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 $VLOG should be done manually to edit the outputs. if (delch = 1) then chflag='.FLAG 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 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('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) end if (lpol=1) then dosnp (disk, expname, uvclass, uvseq, 'TY', 1, 'TSYS', 'L', 1, 0) 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('apcal'); version = tver; task 'apcal'; 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('apcal') $ runcl (expname, disk, uvclass, 1, 1, 2, '2PT', 0) $ $ 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) end end if (lpol=1) then for incif=1 to nif dosnp (disk, expname, uvclass, uvseq,'CL',2,'AMP','L',incif,incif) 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