Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GPIAG-Software
IFOS3D
Commits
f337698d
Commit
f337698d
authored
Jun 20, 2016
by
Tilman Steinweg
Browse files
new script for plotting the toy example results
And a few adaptions to existing scripts
parent
a91128be
Changes
3
Hide whitespace changes
Inline
Side-by-side
mfiles/slice2D_toy_model.m
0 → 100644
View file @
f337698d
%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
mfiles/slice3D_toy_model.m
View file @
f337698d
...
@@ -6,13 +6,13 @@ nx=160; ny=184; nz=160; %ny:vertical
...
@@ -6,13 +6,13 @@ nx=160; ny=184; nz=160; %ny:vertical
outx
=
1
;
outy
=
1
;
outz
=
1
;
outx
=
1
;
outy
=
1
;
outz
=
1
;
dh
=
0.8
;
dh
=
0.8
;
nx
=
nx
/
outx
;
ny
=
ny
/
outy
;
nz
=
nz
/
outz
;
nx
=
nx
/
outx
;
ny
=
ny
/
outy
;
nz
=
nz
/
outz
;
fignum
=
1
3
;
fignum
=
1
2
;
%file_inp1='/data14/sdunkl/3DAWAIT/trunk_JURECA/results_toy/model/toy_real.vp';
%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_inp2='/data14/sdunkl/3DAWAIT/trunk_JURECA/results_toy/model/toy_real.vp';
file_inp1
=
'../par/model/toy.v
p
_it0'
;
file_inp1
=
'../par/model/toy.v
s
_it0'
;
file_inp2
=
'../par/model/toy.v
p
_it60'
;
file_inp2
=
'../par/model/toy.v
s
_it60'
;
phi1
=
0
;
%rotation angles to x-z plane of first and second plane
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
...
@@ -27,10 +27,10 @@ rotaxes=[1,0,0]; %direction rotation axes [0,1,0] rotation of plane around verti
%viewpoint=[122,26];
%viewpoint=[122,26];
viewpoint
=
[
-
20
,
12
];
viewpoint
=
[
-
20
,
12
];
%
caxis_value_1=3300;%vs
caxis_value_1
=
3300
;
%vs
%
caxis_value_2=3900;%vs
caxis_value_2
=
3900
;
%vs
caxis_value_1
=
5700
;
%vp
%
caxis_value_1=5700;%vp
caxis_value_2
=
6700
;
%vp
%
caxis_value_2=6700;%vp
...
@@ -40,12 +40,12 @@ zcut1=10; zcut2=149;
...
@@ -40,12 +40,12 @@ zcut1=10; zcut2=149;
fid_rot
=
fopen
(
file_inp1
,
'r'
,
'ieee-le'
);
fid_rot
=
fopen
(
file_inp1
,
'r'
,
'ieee-le'
);
rot1
=
zeros
(
n
z
/
out
z
,
nx
/
outx
,
n
y
/
out
y
);
rot1
=
zeros
(
n
y
/
out
y
,
nx
/
outx
,
n
z
/
out
z
);
rot1
=
fread
(
fid_rot
,(
nx
*
ny
*
nz
),
'float'
);
rot1
=
fread
(
fid_rot
,(
nx
*
ny
*
nz
),
'float'
);
fid_div
=
fopen
(
file_inp2
,
'r'
,
'ieee-le'
);
%
fid_div=fopen(file_inp2,'r','ieee-le');
div1
=
zeros
(
nz
/
outz
,
nx
/
outx
,
ny
/
outy
);
%
div1=zeros(nz/outz,nx/outx,ny/outy);
div1
=
fread
(
fid_div
,(
nx
*
ny
*
nz
),
'float'
);
%
div1=fread(fid_div,(nx*ny*nz),'float');
%rot1=-rot1./max(max(rot1));
%rot1=-rot1./max(max(rot1));
...
@@ -57,8 +57,8 @@ div1=fread(fid_div,(nx*ny*nz),'float');
...
@@ -57,8 +57,8 @@ div1=fread(fid_div,(nx*ny*nz),'float');
%rot1=log10(rot1);
%rot1=log10(rot1);
rot
=
reshape
(
rot1
,
n
z
/
out
z
,
nx
/
outx
,
n
y
/
out
y
);
rot
=
reshape
(
rot1
,
n
y
/
out
y
,
nx
/
outx
,
n
z
/
out
z
);
rot
=
rot
(
z
cut1
:
z
cut2
,
xcut1
:
xcut2
,
y
cut1
:
y
cut2
);
rot
=
rot
(
y
cut1
:
y
cut2
,
xcut1
:
xcut2
,
z
cut1
:
z
cut2
);
nx
=
xcut2
-
xcut1
+
1
;
nx
=
xcut2
-
xcut1
+
1
;
ny
=
ycut2
-
ycut1
+
1
;
ny
=
ycut2
-
ycut1
+
1
;
...
@@ -139,7 +139,7 @@ zd3 = get(hslicez,'ZData');
...
@@ -139,7 +139,7 @@ zd3 = get(hslicez,'ZData');
rot
=
permute
(
rot
,[
2
,
1
,
3
]);
rot
=
permute
(
rot
,[
2
,
3
,
1
]);
%rott=size(rot)
%rott=size(rot)
%size(rot)
%size(rot)
%size(Z)
%size(Z)
...
@@ -225,7 +225,7 @@ hold on
...
@@ -225,7 +225,7 @@ hold on
set
(
gca
,
'FontSize'
,
14
);
set
(
gca
,
'FontSize'
,
14
);
set
(
gca
,
'FontWeight'
,
'normal'
);
set
(
gca
,
'FontWeight'
,
'normal'
);
set
(
gca
,
'Linewidth'
,
1.0
);
set
(
gca
,
'Linewidth'
,
1.0
);
colormap
(
'jet'
)
cb
=
colorbar
(
'vert'
);
cb
=
colorbar
(
'vert'
);
xlabel
(
cb
,
'v_p'
);
xlabel
(
cb
,
'v_p'
);
...
...
par/run_toy_example.sh
View file @
f337698d
...
@@ -3,6 +3,11 @@ make clean
...
@@ -3,6 +3,11 @@ make clean
make
install
MODEL
=
hh_toy_true.c
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
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
# invert observed data using homogeneous starting model
make clean
make clean
make
install
MODEL
=
hh_toy_start.c
make
install
MODEL
=
hh_toy_start.c
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment