      subroutine multilook(t1,t2,nlinesaz,nnn,nlooks,
     .     outarray,amps)
      
c assumes range resampling was done at time of range migration

      parameter (nnnn=8192)
      complex t1(nnn,nlinesaz),t2(nnn,nlinesaz),amps(nnn/4,nlinesaz)
      complex c(nnnn),d(nnnn/4),outarray(nnn/4,nlinesaz)
      real*4  p1(nnnn),p2(nnnn),pp1(nnnn/4),pp2(nnnn/4)

      if(nnn .gt. nnnn) then
         write(*,*)'violating azimuth length assumption '
      end if
         
c     resample and form interferogram
      
      do i=1,nlinesaz
         if(mod(i,512).eq.1)write(*,*)' looking...',i

c     cross multiply
         
         do j=1,nnn
c     interpolate to get b1
            c(j)=t1(j,i)*conjg(t2(j,i))
            p1(j)=cabs(t1(j,i))**2
            p2(j)=cabs(t2(j,i))**2
         end do
c     take looks
         do j=1,nnn/nlooks
            d(j)=cmplx(0.,0.)
            pp1(j)=0.
            pp2(j)=0.
            do k=1,nlooks
               d(j)=d(j)+c((j-1)*nlooks+k)
               pp1(j)=pp1(j)+p1((j-1)*nlooks+k)
               pp2(j)=pp2(j)+p2((j-1)*nlooks+k)
            end do
         end do
c     save output line
         do j=1,nnn/nlooks
            outarray(j,i)=d(j)
            amps(j,i)=cmplx(sqrt(pp1(j)),sqrt(pp2(j)))
         end do
      end do
      
      return
      
      end
