exist(expdir,<span class="string">'dir'</span>)
    mkdir(expdir);
<span class="keyword">end</span>
curdir = pwd;
cd(expdir);

<span class="comment">% model</span>
[v,n,d,o]  = rsf_read_all([datadir <span class="string">'/'</span> vfile]);
[v0,n,d,o] = rsf_read_all([datadir <span class="string">'/'</span> v0file]);
mref       = 1e6./v(:).^2;
m0         = 1e6./v0(:).^2;

<span class="comment">% read data</span>
[D,nd,dd,od] = rsf_read_all([datadir <span class="string">'/'</span> datafile]);
D            = re