pro uvplt

   !p.multi=[0,2,2,0,0]
   lat = 35.0*!dtor   ; Latitude
   read,'Enter E,N,U coords in m for ant 1: ',A1e,A1n,A1u
   read,'Enter E,N,U coords in m for ant 2: ',A2e,A2n,A2u
   read,'Enter source declination, in degrees: ',d0
   dec = d0*!dtor                 ; Declination in radians
   Be = (A2e-A1e)/0.06
   Bn = (A2n-A1n)/0.06
   Bu = (A2u-A1u)/0.06
   Bx = -Bn*sin(lat) + Bu*cos(lat)
   By = Be
   Bz = Bn*cos(lat) + Bu*sin(lat)
   print,bx,by,bz
   h0 = findgen(12*6+1)/6. - 6.   ; Hour angle, in hours
   ha = h0*15.*!dtor              ; Hour angle, in radians
   nh = n_elements(h0)
   u = (v = (w = fltarr(nh)))
   for i = 0, nh-1 do begin
      mat = [[sin(ha[i]),cos(ha[i]),0],[-sin(dec)*cos(ha[i]),sin(dec)*sin(ha[i]),cos(dec)],$
             [cos(dec)*cos(ha[i]),-cos(dec)*sin(ha[i]),sin(dec)]]
      uvw = reform(mat##[[Bx],[By],[Bz]])
      u[i] = uvw[0]
      v[i] = uvw[1]
      w[i] = uvw[2]
   endfor
   plot,h0,u
   plot,h0,v
   plot,h0,w
   plot,u,v
return
end
