function bdots,ha,dec,geometry,uv

   ; Some parameters
   CMAS2RAD = !dtor / 3.6D6
   CMS2RAD = CMAS2RAD * 15.D
   CSLAT    = 0.79619623D         ; Cosine of OVRO latitude (37d13'53.8")
   SNLAT    = 0.60503848D         ; Sine of OVRO latitude (37d13'53.8")

   ; Convert inputs to radians

   ha1 = ha*CMS2RAD
   dec1 = dec*CMAS2RAD

   ; Determine Cosine of Zenith angle

   cosza = sin(dec1)*SNLAT + cos(dec1)*CSLAT*cos(ha1)
   tau   =   geometry.bx*cos(dec1)*cos(ha1) $
           - geometry.by*cos(dec1)*sin(ha1) $
           + geometry.bz*sin(dec1) + geometry.htdiff/cosza

   ; Calculate the u,v coordinates (this is a 5x5 array, with the upper off-diagonal
   ; elements containing u, and the lower off-diagonal elements containing v)
   uv = geometry.bx*sin(ha1) + geometry.by*cos(ha1)    ; This is just u, but v is added below
   v =   -geometry.bx*sin(dec1)*cos(ha1) $
        + geometry.by*sin(dec1)*sin(ha1) $
        + geometry.bz*cos(dec1)

   ; Get the indexes of the lower off-diagonal elements
   nant = n_elements(uv[0,*])   ; Find out how many antennas from the size of uv
   lower = nant
   for i = 2, nant-1 do begin
      for j = 0, i-1 do begin
         lower = [lower,i*nant+j]
      endfor
   endfor
   uv[lower] = v[lower]                            ; Put v in the lower elements

return,tau
end