forked from snnagel/Structural-Color-by-Cascading-TIR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameterTrends.m
83 lines (67 loc) · 1.48 KB
/
parameterTrends.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
71
72
73
74
75
76
77
78
79
80
81
82
83
figure
%Default parameters:
R_df=25%10/sind(CA) %Microns
n1_df= 1.37
n2_df=1.27
CA_df=71%acosd(1-h/R)
inputAngle_df=21.41
phiOut=pi;
N=200%0%number of each values for each sweep
%Sweep values:
ilVals=linspace(0, 60, N);
n2Vals=linspace(1, 1.3, N);
Rvals=linspace(10,40, N);
CAvals=linspace(50, 110, N);
thetaOut=linspace(0, pi/2, N);
wavelengths=linspace(0.3, 0.800, 200);
for qq=1:4 %Each parameter
fullDist=zeros(length(wavelengths), N, N);
for ll=1:N
R=R_df;
n1=n1_df;
n2=n2_df;
CA=CA_df;
inputAngle=inputAngle_df;
if qq==1
R=Rvals(ll);
end
if qq==2
CA=CAvals(ll);
end
if qq==3
n2=n2Vals(ll);
end
if qq==4
inputAngle=ilVals(ll);
end
d=-R*cosd(CA);
eta=CA*pi/180;
outMap=Intensity_3D( wavelengths, thetaOut, phiOut, R, CA, inputAngle, n1, n2, false);
fullDist(:, :, ll)=outMap;
end
C=IntensityToColor(wavelengths, fullDist);
colorImage=permute(C, [2, 1, 3]);
subplot(2, 2, qq)
if qq==1
ydat=Rvals
ylab='Radius (\mu m)'
end
if qq==2
ydat=CAvals
ylab='\eta (^o))'
end
if qq==3
ydat=n2Vals
ylab='n_{2}'
end
if qq==4
ydat=ilVals
ylab='\theta_{in}'
end
image(thetaOut*180/pi, ydat, colorImage)
ylabel(ylab)
xlabel('\theta_{out}')
set(gca,'YDir','normal')
xlim([0, 90])
end
set(gcf, 'color', 'white')