!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
if (uv%nvisi.gt.1) then
   message e p_uvspectrum "More than one visibility in the UV buffer"
   return base
endif
!
gtvl\clear
!
define integer nc
let nc uv%nchan
define double uvfreq[uv%nchan] uvreal[uv%nchan] uvimag[uv%nchan] uvweig[uv%nchan]
for ic 1 to nc
   let uvreal[ic] uv['5+ic*3',1]
   let uvimag[ic] uv['6+ic*3',1]
   let uvweig[ic] uv['7+ic*3',1]
next ic
let uvfreq[ic] (ic-uv%convert[1,1])*uv%convert[3,1]+uv%convert[2,1]
!
greg1\set box_location 0.1*page_x 0.9*page_x 0.65*page_y 0.90*page_y
greg1\limits /var uvfreq uvreal
greg1\box n o
greg1\histogram uvfreq uvreal
greg1\label "Real part" /y 5.5
greg1\label "[Jansky]"  /y 4.0
!
greg1\set box_location 0.1*page_x 0.9*page_x 0.40*page_y 0.65*page_y
greg1\limits /var uvfreq uvimag
greg1\box n o
greg1\histogram uvfreq uvimag
greg1\label "Imaginary part" /y 5.5
greg1\label "[Jansky]"       /y 4.0
!
greg1\set box_location 0.1*page_x 0.9*page_x 0.15*page_y 0.40*page_y
greg1\limits /var uvfreq uvweig
greg1\box
greg1\histogram uvfreq uvweig
greg1\label "Weight" /y 5.5
greg1\label "[???]"  /y 4.0
greg1\label "Frequency [MHz]" /x
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
