-
Notifications
You must be signed in to change notification settings - Fork 9
/
tf_ellip.m
63 lines (55 loc) · 1.93 KB
/
tf_ellip.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
function [Psi, Delta] = tf_ellip(stack, lambda, theta, bunwrap)
%function [Psi, Delta] = tf_ellip(stack, lambda, theta, bunwrap)
%
% tf_ellip : calculates the ellipsometric response of a
% multilayer stack at the specified wavelengths.
%
% Input:
% stack : a structure array with a material stack definition
% stack(k).d : layer thickness in um
% stack(k).n : refractive index table, function
% handle, or directly specified constant
% index
% lambda : Sampling wavelengths
% theta : the angle of incidence on the first layer interface in
% degrees.
% bunwrap : (Optional) controls unwrapping of Psi, Delta
% angles. When bunwrap ~= 0, angles will be
% unwrapped. Default is 0 (no unwrapping).
%
% Output:
% Psi : column vector Psi(lambda) in DEGREES
% Delta : column vector Delta(lambda) in DEGREES
%
% Initial version, Ulf Griesmann, October 2013
% check input
if nargin < 4, bunwrap = []; end
if nargin < 3
error('tf_ellip : three input arguments required.');
end
if isempty(bunwrap), bunwrap = 0; end;
if iscolumn(lambda), lambda = lambda'; end
% pre-allocate arrays
Psi = zeros(size(lambda));
Delta = zeros(size(lambda));
% compute all thicknesses in units of lambda
d = zeros(length(stack), length(lambda));
if length(stack) > 2
for l = 1:length(lambda)
d(2:length(stack)-1, l) = [stack(2:length(stack)-1).d] / lambda(l);
end
end
% compute all indices
nk = evalnk(stack, lambda);
% calculate Psi, Delta for all lambda
for l = 1:length(lambda)
[Psi(l), Delta(l)] = tf_psi(d(:,l), nk(:,l), theta);
end
% unwrap, convert to degrees, and make column vector
if bunwrap
Psi = unwrap(Psi);
Delta = unwrap(Delta);
end
Psi = 180 * Psi' / pi;
Delta = 180 * Delta' / pi;
end