-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig_sim_profil.m
executable file
·70 lines (65 loc) · 1.97 KB
/
fig_sim_profil.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% Draws profiles of simulation results and deviation from mie
%% settings
clear all;
fname='.\Tex\Images\fig_sim_profile.pdf';
g=gpuDevice();
reset(g);
addpath('reconstruction','simulation','helper');
N=2*1024;
beta=1e-4;
delta=1e-4;
radius=20;
dx=1/2;
dz=1/8;
wavelength=1;
green=([0,150,64]./255);
red=([190,22,34]./255);
blue=([49,39,131]./255);
%% run
objects{1}=scatterObjects.sphere();
objects{1}.radius=radius;
objects{1}.beta=beta;
objects{1}.delta=delta;
run=singlerun(N,dx,dz,wavelength,objects);
%% values
minangle=1;
maxangle=20;
angles=run.scatter_scale;
x=angles(end/2+1:end,end/2+1);
err=structfun(@(x)median(abs(x(angles>minangle&angles<maxangle))),run.error_rel,'UniformOutput',false);
disp(err);
names=fieldnames(run.scatter);
%% figure
f=figure('visible','off');
set(f,'defaultAxesColorOrder',[[0 0 0]; [0 0 0]]);
nicenames={'Projektion','Multislice Propagation','Thibaults Multislice','MSFT'};
for n=1:length(names)
cur=names{n};
ax=subplot(2,2,n);
yyaxis left
linem=semilogy(x,run.profile_mie,'o','MarkerSize',4,'Color',green);
hold on;
linep=semilogy(x,run.profile_scatter.(cur),'.','MarkerSize',8,'Color',blue);
axis([0.2,maxangle,1e-10,1]);
yyaxis right;
linee=plot(x,run.profile_error_rel.(cur),'-','Color',red);
plot(x,0*x,'--k');
axis([0.2,maxangle,-.5,.5]);
ax.XAxis.TickLabelFormat = '%,.1g°';
ax.XAxis.Label.String='Streuwinkel';
ax.YAxis(1).Label.String='normierte Intensität';
ax.YAxis(2).Label.String='rel. Fehler';
ax.Title.String=nicenames{n};
ax.Title.FontSize=24;
ax.YAxis(1).Label.FontSize=16;
ax.YAxis(2).Label.FontSize=16;
ax.XAxis.Label.FontSize=16;
end
hL = legend([linem,linep,linee],{'Mie{ }','Simulation{ }','{ }rel. Abweichung von Mie'});
hL.Orientation='horizontal';
hL.FontSize=16;
hL.Position=[0.5,0.05,0,0];
f.PaperSize=3*[15,9];
f.PaperPosition=3*[-1 -.25 17 9.5];
print(fname,'-dpdf');
open(fname);