Commit f5db1d79 authored by tilman.metz's avatar tilman.metz

modified slice2D_toy_model.m script and cleanup

- slice2D_toy_model.m now reads source and receiver positions and plots them if the positions are located in the current 2D slice
- One figure in the manual had old coordinate system (fixed)
- removed old figures in git
parent 50c12608
*.kdev4
*.swp
*.backup
*~*
*.orig
manual_IFOS3D.pdf
This diff is collapsed.
This diff is collapsed.
......@@ -5,7 +5,7 @@ The 3D inversion is costly even for a simple model. To enable a successfull inve
\subsection{Model and grid system}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=\textwidth]{fig_toy/toy_real_model_neu}
\includegraphics[width=\textwidth]{fig_toy/toy_real_model}
\caption[Toy example - the real model and acquisition geometry]{The toy example - real model $v_p$ (a) and $v_s$ (b), sources and receivers indicated as stars and crosses, respectively}\label{fig:toy_model}
\end{center}
\end{figure}
......@@ -93,7 +93,7 @@ The gradients can be plotted with the Matlab program \textit{slice\_3D\_toy\_gra
Here, we show the ``raw'' gradients and the preconditioned gradients of $v_p$ and $v_s$ normalised to their maximum value for the first iteration (figure~\ref{fig:toy_grad}). In the raw gradients (a,b) the high amplitudes around sources and receivers are clearly visible. Especially the source artefacts are very distinct compared to the small scaled receiver artefacts. By preconditioning these artefacts can be removed for the greater part (c,d) and the main update concentrates on the box area. Due to the smaller wavelengths of the shear wave, the $v_s$-gradient already shows more structure than the $v_p$-gradient.
\begin{figure}[h!]
\begin{center}
\includegraphics[width=\textwidth]{fig_toy/grad_toy_neu}
\includegraphics[width=\textwidth]{fig_toy/grad_toy}
\caption[Toy example - gradient before and after preconditioning]{Normalised gradients of first iteration : a) ``raw'' gradient $v_p$, b) ``raw'' gradient $v_s$, c) preconditioned gradient $v_p$ and d) preconditioned gradient $v_s$; sources (stars) and receivers (crosses) are indicated. }\label{fig:toy_grad}
\end{center}
\end{figure}
......@@ -119,7 +119,7 @@ Model parameters are written into the folder \textit{model} in each iteration fo
The results for the toy example is plotted for two 2D slices. Figure~\ref{fig:toy_result1} shows a horizontal slice through the box area. The three different box areas seen in the real model in a) and c) are well resolved for $v_p$ (b) and $v_s$ (d) after 60 iterations. However the $v_s$-model offers a clearly higher resolution due to the smaller wavelengths compared to the $v_p$-model. In transmission geometry a resolution down to one wavelength is possible and higher frequencies would be necessary to gain a better resolved box in $v_p$.
\begin{figure}[h!]
\begin{center}
\includegraphics[width=\textwidth]{fig_toy/toy_model_result_new}
\includegraphics[width=\textwidth]{fig_toy/toy_model_result}
\caption[Toy example - final inverted models, horizontal slice]{Final inverted models (60 iterations) compared to real models for horizontal slice at $y$=60\,m: a) real model $v_p$, b) inverted model $v_p$, c) real model $v_s$ and d) inverted model $v_s$. The dashed line indicates the absorbing frame; }\label{fig:toy_result1}
\end{center}
\end{figure}
......
......@@ -4,9 +4,14 @@ clear all;
clc
close all
iteration=1;
fname='toy.';
parameter='vp';
source_file='../par/sources/sources_toy.dat';
rec_file='../par/receiver/receiver_toy.dat';
iteration=60;
nx=160; ny=184; nz=160; %ny:vertical
nx=160; ny=186; nz=160; %ny:vertical
outx=1; outy=1; outz=1;
dh=0.8;
FW=10;
......@@ -17,33 +22,53 @@ Y=dh:dh*outy:ny*outy*dh;
Z=dh:dh*outz:nz*outz*dh;
% Slizes of the 3D-Model in m
slx=60;
sly=60;
slz=60;
slx=56;
sly=24;
slz=52.8;
if strcmp(parameter,'vs')
caxis_value_1=3300;%vs
caxis_value_2=3900;%vs
end
if strcmp(parameter,'vp')
caxis_value_1=5700;%vp
caxis_value_2=6700;%vp
end
% No changes to be done after this line---------
%------------------------------------------------
% general settings for plots information
%Input of receiver and source positions--
fp = fopen(source_file);
SRC=textscan(fp, '%f %f %f %f %f %f', 'delimiter','\t', 'commentstyle','%','MultipleDelimsAsOne',1);
fclose(fp);
fp = fopen(rec_file);
REC=textscan(fp, '%f %f %f ', 'delimiter','\t', 'commentstyle','#','MultipleDelimsAsOne',1);
fclose(fp);
% Lines to mark PML position
fontsize=14;
x_line=[FW FW nx-FW nx-FW FW]*dh;
y_line=[FW ny-FW ny-FW FW FW]*dh;
z_line=[FW nz-FW nz-FW FW FW]*dh;
slizex=slx/dh/outx;
slizey=sly/dh/outy;
slizez=slz/dh/outz;
fname='toy.';
parameter='vs';
%m --> model indices
slizex=int64(slx/dh/outx);
slizey=int64(sly/dh/outy);
slizez=int64(slz/dh/outz);
file_inp1=['../par/model/' fname parameter '.true'];
file_inp2=['../par/model/' fname parameter '_it' num2str(iteration)];
if strcmp(parameter,'vs')
caxis_value_1=3300;%vs
caxis_value_2=3900;%vs
end
if strcmp(parameter,'vp')
caxis_value_1=5700;%vp
caxis_value_2=6700;%vp
end
%Read 3D Models------------------------
fid=fopen(file_inp1,'r','ieee-le');
modelvec=zeros(ny/outy,nx/outx,nz/outz);
......@@ -58,6 +83,8 @@ modelvec=fread(fid,(nx*ny*nz),'float');
model=reshape(modelvec,ny,nx,nz);
%Creation of 2D Slices--------------
model_truex=zeros(ny,nz);
model_truey=zeros(nz,nx);
model_truez=zeros(ny,nx);
......@@ -103,6 +130,8 @@ for x=1:1:nx
end
end
%Plotting-------------------------------------------
figure(1)
imagesc(Z,Y,model_truex);
line(x_line,y_line,'LineStyle','--','Color','k')
......@@ -116,23 +145,25 @@ xlabel('z in m','FontSize',fontsize)
ylabel('y in m','FontSize',fontsize)
title(['true ' parameter '-model. Slize at x=' num2str(slx) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{1}(ii)==slx;
plot(SRC{3}(ii),SRC{2}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{1}(ii)==slx;
plot(REC{3}(ii),REC{2}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
figure(3)
imagesc(X,Z,model_truey);
line(x_line,z_line,'LineStyle','--','Color','k')
colb=colorbar;
coll=get(colb,'xlabel');
set(coll,'String',[parameter ' in m/s'],'FontSize',fontsize);
caxis([caxis_value_1 caxis_value_2])
set(gca,'ydir','normal');
xlabel('x in m','FontSize',fontsize)
ylabel('z in m','FontSize',fontsize)
title(['true ' parameter '-model. Slize at x=' num2str(sly) 'm'],'FontSize',fontsize)
axis tight
figure(5)
imagesc(X,Y,model_truez);
figure(2)
imagesc(Z,Y,modelx);
line(x_line,y_line,'LineStyle','--','Color','k')
colb=colorbar;
coll=get(colb,'xlabel');
......@@ -140,28 +171,55 @@ set(coll,'String',[parameter ' in m/s'],'FontSize',fontsize);
caxis([caxis_value_1 caxis_value_2])
set(gca,'ydir','normal');
%set(gca,'xdir','reverse');
xlabel('x in m','FontSize',fontsize)
xlabel('z in m','FontSize',fontsize)
ylabel('y in m','FontSize',fontsize)
title(['true ' parameter '-model. Slize at x=' num2str(slz) 'm'],'FontSize',fontsize)
title([ parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(slx) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{1}(ii)==slx;
plot(SRC{3}(ii),SRC{2}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{1}(ii)==slx;
plot(REC{3}(ii),REC{2}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
figure(2)
imagesc(Z,Y,modelx);
line(x_line,y_line,'LineStyle','--','Color','k')
figure(3)
imagesc(X,Z,model_truey);
line(x_line,z_line,'LineStyle','--','Color','k')
colb=colorbar;
coll=get(colb,'xlabel');
set(coll,'String',[parameter ' in m/s'],'FontSize',fontsize);
caxis([caxis_value_1 caxis_value_2])
set(gca,'ydir','normal');
%set(gca,'xdir','reverse');
xlabel('z in m','FontSize',fontsize)
ylabel('y in m','FontSize',fontsize)
title([ parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(slx) 'm'],'FontSize',fontsize)
xlabel('x in m','FontSize',fontsize)
ylabel('z in m','FontSize',fontsize)
title(['true ' parameter '-model. Slize at x=' num2str(sly) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{2}(ii)==sly;
plot(SRC{1}(ii),SRC{3}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{2}(ii)==sly;
plot(REC{1}(ii),REC{3}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
figure(4)
......@@ -176,7 +234,52 @@ xlabel('x in m','FontSize',fontsize)
ylabel('z in m','FontSize',fontsize)
title([parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(sly) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{2}(ii)==sly;
plot(SRC{1}(ii),SRC{3}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{2}(ii)==sly;
plot(REC{1}(ii),REC{3}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
figure(5)
imagesc(X,Y,model_truez);
line(x_line,y_line,'LineStyle','--','Color','k')
colb=colorbar;
coll=get(colb,'xlabel');
set(coll,'String',[parameter ' in m/s'],'FontSize',fontsize);
caxis([caxis_value_1 caxis_value_2])
set(gca,'ydir','normal');
%set(gca,'xdir','reverse');
xlabel('x in m','FontSize',fontsize)
ylabel('y in m','FontSize',fontsize)
title(['true ' parameter '-model. Slize at x=' num2str(slz) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{3}(ii)==slz;
plot(SRC{1}(ii),SRC{2}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{3}(ii)==sly;
plot(REC{1}(ii),REC{2}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
figure(6)
imagesc(X,Y,modelz);
......@@ -191,8 +294,23 @@ xlabel('x in m','FontSize',fontsize)
ylabel('y in m','FontSize',fontsize)
title([parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(slz) 'm'],'FontSize',fontsize)
axis tight
hold on
%Plot sources if in model slice
for ii=1:length(SRC{1})
if SRC{3}(ii)==slz;
plot(SRC{1}(ii),SRC{2}(ii),'*blue','MarkerSize',15,'LineWidth',2.0);
end
end
%Plot receiver if in model slice
for ii=1:length(REC{1})
if REC{3}(ii)==sly;
plot(REC{1}(ii),REC{2}(ii),'.blue','MarkerSize',15,'LineWidth',2.0);
end
end
hold off
% exportfig(3, [fname parameter '.eps'],'bounds','tight', 'color','rgb', ...
% 'preview','none', 'resolution',200, 'lockaxes',1);
%exportfig(2, [fname parameter '.eps'],'bounds','tight', 'color','rgb', ...
% 'preview','none', 'resolution',200, 'lockaxes',1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment