function [migi]=migrate1(cdp1,time_table,nx,nxx,nz,ntrace,ntime,dt,app,rick,tshift,dx,c,MOD)
migi=zeros(nxx,nz);
dz=dx;
for q=1:ntrace;cdp2(q,:)=xcorr1(rick,cdp1(q,:));end;
cdp3=cdp2*0;for i=1:ntime;cdp3(:,i)=cdp2(:,ntime+i-1);end;
for ixtrace=1:ntrace;
  ixtrace
  istart=1 + (ixtrace-1)-app;iend=1+ (ixtrace-1)+app;
  if istart<1;istart=1;end;
  if iend>nxx;iend=nxx;end;
    for ixs=istart:iend;
    for izs=1:nz;
      r = sqrt((ixtrace*dx-ixs*dx)^2+(izs*dx)^2);
      time = round( 1 +  r/c/dt );rr=1;
      migi(ixs,izs) = migi(ixs,izs) + cdp3(ixtrace,time)/rr;
    end;
    end;
plotit(migi,MOD,nxx,nz,dx,dz,dt,cdp3,ntime) 
%subplot(212);title(['Partial Migration Section at Iteration ',num2str(ixtrace)])
%hold on;plot(ixtrace*dx,0,'*w');hold off;
pause(.1)
%subplot(212);
%axis([0 2000 0 0.75]);colormap('jet')
pause(.05)
hold off
end;

