-
Notifications
You must be signed in to change notification settings - Fork 3
/
generate_resonance_pillar.m
88 lines (69 loc) · 2.55 KB
/
generate_resonance_pillar.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
84
85
86
87
88
function generate_resonance_pillar(SRCDIR, DSTDIR)
% UNFINISHED
%===============================
% preparations
%===============================
if exist('SRCDIR','var')==0
disp('SRCDIR not given');
SRCDIR = uigetdir('D:\Simulations\BFDTD','SRCDIR');
end
if ~(exist(SRCDIR,'dir'))
disp('dir not found');
return;
end
if exist('DSTDIR','var')==0
disp('DSTDIR not given');
DSTDIR = uigetdir('D:\Simulations\BFDTD','DSTDIR');
end
if ~(exist(DSTDIR,'dir'))
disp('dir not found');
mkdir(DSTDIR);
% return;
end
% copyfile(fullfile(getuserdir(),'MATLAB','entity.lst'),DSTDIR);
% copyfile(fullfile(getuserdir(),'MATLAB','qedc3_2_05.sh'),DSTDIR);
cd(DSTDIR);
%===============================
DSTDIR
SRCDIR
close all
%=======================================
% analyze top probes from source pillar
%=======================================
% get pillar cavity frequency
dt_vec = [0,0,0,0];
fmin_vec = [0,0,0,0];
fmax_vec = [0,0,0,0];
[ vEnd1, vStart1, dt_vec(1), fmin_vec(1), fmax_vec(1) ] = analyzePRN([SRCDIR,'\\p062id.prn'], [DSTDIR,'\\p062id.peakfile'], 1/4);
[ vEnd2, vStart2, dt_vec(2), fmin_vec(2), fmax_vec(2) ] = analyzePRN([SRCDIR,'\\p071id.prn'], [DSTDIR,'\\p071id.peakfile'], 1/4);
[ vEnd3, vStart3, dt_vec(3), fmin_vec(3), fmax_vec(3) ] = analyzePRN([SRCDIR,'\\p080id.prn'], [DSTDIR,'\\p080id.peakfile'], 1/4);
[ vEnd4, vStart4, dt_vec(4), fmin_vec(4), fmax_vec(4) ] = analyzePRN([SRCDIR,'\\p089id.prn'], [DSTDIR,'\\p089id.peakfile'], 1/4);
for i=1:length(dt_vec)
fprintf('%d: dt=%E fmin=%E fmax=%E\n', i, dt_vec(i), fmin_vec(i), fmax_vec(i));
end
dt = min(dt_vec);
fmin = min(fmin_vec);
fmax = max(fmax_vec);
fprintf('final: dt=%E fmin=%E fmax=%E\n', dt, fmin, fmax);
% vEnd = [x0, y0, A, FWHM];
% Q=x0/FWHM = vEnd(1)/vEnd(4)
% lambda = 900*10^-3;%mum
return;
%===============================
% get data from source pillar
%===============================
% get pillar data
[ folder, basename, ext ] = fileparts(SRCDIR);
infos = regexp(basename, '_', 'split');
pillar_type = infos(2);
n_type = str2num(char(infos(3)));
radius = str2num(char(infos(4)))/10;
%===============================
% generate new pillar
%===============================
SNAPSHOTS_ON = 1;
c0=299792458;%mum/mus
FREQUENCY = c0/lambda;
dirname = strcat('pillar_',pillar_type,'_',num2str(n_type),'_',num2str(10*radius),'_at_cavity_frequency');
micropillar(radius, dirname, 'qedc3_2_05', n_type, a_N_bottom, a_N_top, FREQUENCY, SNAPSHOTS_ON);
end