## This includes the commands and a function to plot ## bandpass table for separate antennaes ## JEH 12/05/01, modified from a script from gmoellen 01OCT29 ## Here is how it would be set up and called for a dataset ## with bcal solutions in the file n4038D.bcal: ## ================================================ # include 'table.g' # include 'pgplotter.g' # t:=table('n4038D.bcal') # gain:=t.getcol('GAIN'); # the indicies on the gain array are # [pol1,pol2,spw,channel,antenna] # pol1 and pol2 are 1 or 2, and are # meaningful for B tables only if pol1=pol2 # Nchan:=shape(gain)[4] # solok:=t.getcol('SOLUTION_OK'); # solok contains a 3D array of booleans # indicating which [spw,channel,antenna] # indicies are ok # # mypg:=pgplotter() # mypg.ask:=T; # limits:= [0,Nchan+1,0,max(abs(gain))*1.1] # plot1BP(1,limits,gain,solok) # limits := [2,125,0.5,0.7] # plot1BP(1,limits,gain,solok) ## ================================================ function plot1BP(i_ant,xylimits,gaintable,okarray) { Nchan:=shape(gaintable)[4] Npol:=shape(gaintable)[1] mypg.env(xylimits[1],xylimits[2], xylimits[3], xylimits[4], 0,0); if (any(okarray[1,,i_ant])) { for (pol in 1:Npol) { x:=seq(Nchan) # list of channel numbers, from 1..Nchan y:=abs(gain[pol,pol,1,,i_ant]) # mask out the bad channels: x:=x[okarray[1,,i_ant]]; y:=y[okarray[1,,i_ant]]; mypg.sci((i_ant+pol-1)%10+2) # use colors 2-11 mypg.pt(x,y,17) # plot y vs. x with symbol 17 #make and plot antenna labels: xtxt:= limits[1]+1; ytxt:= limits[4]*0.95+limits[3]*0.05; mypg.ptxt(xtxt,ytxt,0,0,spaste("Antenna ",i_ant)); xtxt:= limits[2]-10; if (pol==2) xtxt:=limits[2]-5; mypg.ptxt(xtxt,ytxt,0,0,spaste("IF=",pol)); } } # reset color to white: mypg.sci(1) }