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

new script for plotting the toy example results

And a few adaptions to existing scripts
parent a91128be
%3D plot of model
clear all;
clc
close all
iteration=60;
nx=160; ny=186; nz=160; %ny:vertical
outx=1; outy=1; outz=1;
dh=0.8;
FW=10;
nx=nx/outx;ny=ny/outy;nz=nz/outz;
X=dh:dh*outx:nx*outx*dh;
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;
% general settings for plots information
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';
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
fid=fopen(file_inp1,'r','ieee-le');
modelvec=zeros(ny/outy,nx/outx,nz/outz);
modelvec=fread(fid,(nx*ny*nz),'float');
model_true=reshape(modelvec,ny,nx,nz);
fid=fopen(file_inp2,'r','ieee-le');
modelvec=zeros(ny/outy,nx/outx,nz/outz);
modelvec=fread(fid,(nx*ny*nz),'float');
model=reshape(modelvec,ny,nx,nz);
model_truex=zeros(ny,nz);
model_truey=zeros(nz,nx);
model_truez=zeros(ny,nx);
for y=1:1:ny
for z=1:1:nz
model_truex(y,z)=model_true(y,slizex,z);
end
end
for x=1:1:nx
for z=1:1:nz
model_truey(z,x)=model_true(slizey,x,z);
end
end
for x=1:1:nx
for y=1:1:ny
model_truez(y,x)=model_true(y,x,slizez);
end
end
modelx=zeros(ny,nz);
modely=zeros(nz,nx);
modelz=zeros(ny,nx);
for y=1:1:ny
for z=1:1:nz
modelx(y,z)=model(y,slizex,z);
end
end
for x=1:1:nx
for z=1:1:nz
modely(z,x)=model(slizey,x,z);
end
end
for x=1:1:nx
for y=1:1:ny
modelz(y,x)=model(y,x,slizez);
end
end
figure(1)
imagesc(Z,Y,model_truex);
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('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
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);
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
figure(2)
imagesc(Z,Y,modelx);
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('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)
axis tight
figure(4)
imagesc(X,Z,modely);
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([parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(sly) 'm'],'FontSize',fontsize)
axis tight
figure(6)
imagesc(X,Y,modelz);
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([parameter '-model. Iteration ' num2str(iteration) ' Slize at x=' num2str(slz) 'm'],'FontSize',fontsize)
axis tight
exportfig(3, [fname parameter '.eps'],'bounds','tight', 'color','rgb', ...
'preview','none', 'resolution',200, 'lockaxes',1);
\ No newline at end of file
......@@ -6,13 +6,13 @@ nx=160; ny=184; nz=160; %ny:vertical
outx=1; outy=1; outz=1;
dh=0.8;
nx=nx/outx;ny=ny/outy;nz=nz/outz;
fignum=13;
fignum=12;
%file_inp1='/data14/sdunkl/3DAWAIT/trunk_JURECA/results_toy/model/toy_real.vp';
%file_inp2='/data14/sdunkl/3DAWAIT/trunk_JURECA/results_toy/model/toy_real.vp';
file_inp1='../par/model/toy.vp_it0';
file_inp2='../par/model/toy.vp_it60';
file_inp1='../par/model/toy.vs_it0';
file_inp2='../par/model/toy.vs_it60';
phi1=0; %rotation angles to x-z plane of first and second plane
......@@ -27,10 +27,10 @@ rotaxes=[1,0,0]; %direction rotation axes [0,1,0] rotation of plane around verti
%viewpoint=[122,26];
viewpoint=[-20,12];
%caxis_value_1=3300;%vs
%caxis_value_2=3900;%vs
caxis_value_1=5700;%vp
caxis_value_2=6700;%vp
caxis_value_1=3300;%vs
caxis_value_2=3900;%vs
%caxis_value_1=5700;%vp
%caxis_value_2=6700;%vp
......@@ -40,12 +40,12 @@ zcut1=10; zcut2=149;
fid_rot=fopen(file_inp1,'r','ieee-le');
rot1=zeros(nz/outz,nx/outx,ny/outy);
rot1=zeros(ny/outy,nx/outx,nz/outz);
rot1=fread(fid_rot,(nx*ny*nz),'float');
fid_div=fopen(file_inp2,'r','ieee-le');
div1=zeros(nz/outz,nx/outx,ny/outy);
div1=fread(fid_div,(nx*ny*nz),'float');
% fid_div=fopen(file_inp2,'r','ieee-le');
% div1=zeros(nz/outz,nx/outx,ny/outy);
% div1=fread(fid_div,(nx*ny*nz),'float');
%rot1=-rot1./max(max(rot1));
......@@ -57,8 +57,8 @@ div1=fread(fid_div,(nx*ny*nz),'float');
%rot1=log10(rot1);
rot=reshape(rot1,nz/outz,nx/outx,ny/outy);
rot=rot(zcut1:zcut2,xcut1:xcut2,ycut1:ycut2);
rot=reshape(rot1,ny/outy,nx/outx,nz/outz);
rot=rot(ycut1:ycut2,xcut1:xcut2,zcut1:zcut2);
nx=xcut2-xcut1+1;
ny=ycut2-ycut1+1;
......@@ -139,7 +139,7 @@ zd3 = get(hslicez,'ZData');
rot=permute(rot,[2,1,3]);
rot=permute(rot,[2,3,1]);
%rott=size(rot)
%size(rot)
%size(Z)
......@@ -225,7 +225,7 @@ hold on
set(gca,'FontSize',14);
set(gca,'FontWeight','normal');
set(gca,'Linewidth',1.0);
colormap('jet')
cb = colorbar('vert');
xlabel(cb, 'v_p');
......
......@@ -3,6 +3,11 @@ make clean
make install MODEL=hh_toy_true.c
mpirun -np 8 nice -19 ../bin/ifos3d ./in_and_out/ifos3d_toy_FW.json | tee ./in_and_out/ifos3D.out
cp model/toy.vs_it0 model/toy.vs.true
cp model/toy.vp_it0 model/toy.vp.true
cp model/toy.rho_it0 model/toy.rho.true
# invert observed data using homogeneous starting model
make clean
make install MODEL=hh_toy_start.c
......
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