% Migration and Migration Velocity Lab
% Part 1: Time migration with Constant Velocity

count=1;
for ivel=1500:50:1700
    ivel
    c=ones(nx,nt)*ivel; % Migration with water velocity.
    %c=ones(nx,nt)*2000;% What will happen if the velocity is chaned to 3000m/s?

    % Time Migration Code.
    [MIG_t_const]=timemigrate(stack,nx,nz,nt,dt,ap,dx,dz,c,TOTS,TOTE);

    % Plot Migrated Section with Constant Velocity
    maxtmigc=0.2*max(MIG_t_const(:));
    figure;
    imagesc(x,t,MIG_t_const',[-maxtmigc maxtmigc]);
    title(['Migrated Section with Constant Velocity =',num2str(ivel),' m/s'],'FontSize',16);
    xlabel('X (m)','FontSize',16);
    ylabel('TWT (msec)','FontSize',16);
    colormap('gray');

    M(count)=getframe;
    count=count+1;
end
figure;

% Movie
movie(M,10,1)
