module OW_image_areal
!
! Imaging Condition -- crosscorrelation
!

use OW_type
use OW_parms_areal

implicit none

contains
!----------------------------------------------------------
subroutine owimage(ws,wr,GG) 

integer					:: ish, ihso, ixw
complex					:: GG(:,:),wr(:),ws(:)

do ish=1,img%sh%n
   ihso=nint(((ish-1)*img%sh%d+img%sh%o)/(img%xm%d))
   do ixw=1,rec%h%n
      if (ixw-ihso > 1 .and. ixw-ihso < rec%h%n .and. ixw+ihso > 1 .and. ixw+ihso < rec%h%n) then
          GG(ish,ixw)=GG(ish,ixw)+conjg(ws(ixw-ihso))*(wr(ixw+ihso))
      end if
   end do
end do

end subroutine

end module
