%*************************************************************
% Migration and Migration Velocity Lab
% Naoshi Aoki , 3/6/2008
%*************************************************************
clear all
% Data Space Parameters
nx=401;   % Number of trace
dx=16.67; % trace interval
dt=0.004; % time sampling interval
nt=2750;  % Number of time samples
ap=200;   % migration aperture

% Targeted Time Range for Time Migration
TWTS=5.5; % Time range for time-window
TWTE=8.5; % 
TOTS=round(TWTS/dt)+1;
TOTE=round(TWTE/dt)+1;
x=[1:nx]*dx;
t=[TWTS:dt:TWTE];

% Model Space Parameters
dz=5;    % Depth sampling interval
nz=2000; % Number of depth samples
% Targeted Depth Range for Depth Migration
DEPTHS=4200; % Targeted depth range
DEPTHE=8200;
TOZS=round(DEPTHS/dz)+1;
TOZE=round(DEPTHE/dz)+1;
z=[DEPTHS:dz:DEPTHE];

% Load Stack Section
fn=sprintf('Nstack_401_2750.bin');
fid=fopen(fn,'r');
stack=fread(fid,[nt nx],'float32')';
fclose(fid);

%   % Plot Stack Section
%   % Uncomment the next line.

%plotStack
 
%   % Lab1: Time Migration with Constant velocitiy
%   % Uncomment the next line.

TimeMigConst

%   % Lab2; Time Migration with RMS Velocity Model
%   % Uncomment the next line.

% TimeMigRms

%   % Lab3: Depth Migrations with Average Velocity Model (Straight Ray Assumption)
%   % Uncomment the next line.

%DepthMigStraightRay

%   % Lab4: Depth Migration with Slowness Model. Eikonal traveltimes are used.
%   % Uncomment the next line.

% DepthMigEikonal
