function [migi]=migrate0(cdp1,nx,nz,ntime,dt,ap,dx,dz,c,TOZS,TOZE)
migi=zeros(nx,TOZE-TOZS+1);

for ixtrace=1:nx;
    ixtrace
    istart=1 + (ixtrace-1)-ap;iend=1+ (ixtrace-1)+ap;
    if istart<1;istart=1;end;
    if iend>nx;iend=nx;end;
    for ixs=istart:iend;
        for izs=TOZS:TOZE;
            r = sqrt((ixtrace*dx-ixs*dx)^2+(izs*dz)^2);
            time = round( 1 +  2*r/c(ixtrace,izs+1)/dt );
            if time <= ntime
                obl=izs*dz/r;
                migi(ixs,izs-TOZS+1) = migi(ixs,izs-TOZS+1) + obl*cdp1(ixtrace,time)/r;
                %migi(ixs,izs-TOZS+1) = migi(ixs,izs-TOZS+1) + obl*cdp1(ixtrace,time)/r^2;
            end
        end;
    end;
end;
