-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnormalize_plot.m
184 lines (176 loc) · 8.78 KB
/
normalize_plot.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
function funcOut = normalize_plot(analyVar, indivDataset, avgDataset)
%%% normalize_plot.m - Soumya K. Kanungo 2021.02.03
%%% Make a plot of the normalized sfiIntegral depending on if the line
%%% is atomic line, dimer line, trimer line or tetramer line. The
%%% function takes the average dataset based on the flags in the batch
%%% file.
%%% norm(atomic line) = numberAtom*UV_Power*Spec_Power/Detuning^2
%%% norm(dimer line) =
%%% numberAtom^2*UV_Power*Spec_Power/Detuning^2/Temp^(3/2)
%%% norm(trimer line) =
%%% numberAtom^3*UV_Power*Spec_Power/Detuning^2/Temp^(3)
indVarField = 'imagevcoAtom'; % The Field of an IndivDataset that is to be plotted on the X axis
depVarField = 'sfiIntegral'; % The field of an indivdataset that is to be plotted on the y axis
species = 1; % choose what species is being normalized: atom, dimer or trimer.
weighting = 'gaussian';
swapcodes = 1; %Switch between Soumya Legacy code and Nina's manual data entry code
if swapcodes == 1 %Enter manual data entry code
if species == 1
disp('normalizing for Rydberg atom ')
end
if species == 2
disp('Normalizing for Rydberg dimer')
end
if species == 3
disp('Normalizing for Rydberg trimer')
end
[xavg, yavg, yavgerr] = get_averages(analyVar, indivDataset, avgDataset,...
indVarField, depVarField, weighting);
disp(yavg{1});
%[uv,~,red,~] = get_daq_averages(analyVar, indivDataset);
[num, ~, tx, ~, ty, ~] = get_num_temp_averages(analyVar, indivDataset);
disp(num)
scanIDs = analyVar.uniqScanList;
uv = zeros(1,length(scanIDs));%create arrays to store user inputted power
red = zeros(1,length(scanIDs));
%disp(uv)
%disp(red)
figure;
hold on;
xlim([xavg{1}(1), xavg{1}(length(xavg{1}))]);
for id = 1:length(scanIDs)
[maxvalue,offset] = max(yavg{id});
%%%%One can manually change the power of the beams below:
uv(id) = 45; %mW value
red(id) = 2.08; %mW value
avgtemp = (tx(id)*tx(id)*ty(id))^(1/3);
if species ==1
errorbar(xavg{id}, yavg{id}/(uv(id)*red(id)), yavgerr{id}/(uv(id)*red(id)),...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('461nm, 413nm power normalized avg plots')
xlabel('GHz Synth [MHz]')
ylabel('Normalized Signal [arb.]')
%legend(num2str(scanIDs(id)))
end
if species ==2
qnum = scanIDs(id);
disp('ScanIDs are taken as principal quantum numbers to normalize for FC overlap.');
UVDAQoffset = 0.0144; % check the OneNote Calibration
FCexponent = 3.7;
y_processed = yavg{id}*avgtemp^(3/2)/(uv(id)+UVDAQoffset)/red(id)/num(id)^2/(qnum-3.371).^FCexponent;
y_processed_err = yavgerr{id}*avgtemp^(3/2)/(uv(id)+UVDAQoffset)/red(id)/num(id)^2/(qnum-3.371)^FCexponent;
errorbar(xavg{id}-xavg{id}(offset), y_processed,y_processed_err,...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('Num.,Temp.,UV,red power normalized avg plots')
xlabel('GHz_synth [MHz]')
ylabel('Normalized Signal [arb.]')
string = ['FC exponent used = ', num2str(FCexponent)];
annotation('textbox',[0.15,0.8,0.3,0.1],'String', string);
%legend(num2str(scanIDs(id)))
end
if species ==3
errorbar(xavg{id}-xavg{id}(offset), yavg{id}*avgtemp^(3)/uv(id)/red(id)/num(id)^3, yavgerr{id}*avgtemp^(3)/uv(id)/red(id)/num(id)^3,...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('Num.,Temp.,UV,red power normalized avg plots')
xlabel('GHz_synth [MHz]')
ylabel('Normalized Signal [arb.]')
%legend(num2str(scanIDs(id)))
end
end
hold off;
legend(num2str(scanIDs))
funcOut.analyVar = analyVar;
funcOut.indivDataset = indivDataset;
funcOut.avgDataset = avgDataset;
else %enter Soumya Legacy code where beam intensity data is extracted from the DAQ
if species == 1
disp('normalizing for Rydberg atom ')
end
if species == 2
disp('Normalizing for Rydberg dimer')
end
if species == 3
disp('Normalizing for Rydberg trimer')
end
[xavg, yavg, yavgerr] = get_averages(analyVar, indivDataset, avgDataset,...
indVarField, depVarField, weighting);
[uv,~,red,~] = get_daq_averages(analyVar, indivDataset);
[num, ~, tx, ~, ty, ~] = get_num_temp_averages(analyVar, indivDataset);
scanIDs = analyVar.uniqScanList;
%disp(uv)
%disp(red)
figure;
hold on;
xlim([100,400]);
for id = 1:length(scanIDs)
[maxvalue,offset] = max(yavg{id});
avgtemp = (tx(id)*tx(id)*ty(id))^(1/3);
if species ==1
errorbar(xavg{id}-xavg{id}(offset), yavg{id}/uv(id)/red(id)/num(id), yavgerr{id}/uv(id)/red(id)/num(id),...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('Num.,UV,red power normalized avg plots')
xlabel('GHz_synth [MHz]')
ylabel('Normalized Signal [arb.]')
%legend(num2str(scanIDs(id)))
end
if species ==2
qnum = scanIDs(id);
disp('ScanIDs are taken as principal quantum numbers to normalize for FC overlap.');
UVDAQoffset = 0.0144; % check the OneNote Calibration
FCexponent = 3.7;
y_processed = yavg{id}*avgtemp^(3/2)/(uv(id)+UVDAQoffset)/red(id)/num(id)^2/(qnum-3.371).^FCexponent;
y_processed_err = yavgerr{id}*avgtemp^(3/2)/(uv(id)+UVDAQoffset)/red(id)/num(id)^2/(qnum-3.371)^FCexponent;
errorbar(xavg{id}-xavg{id}(offset), y_processed,y_processed_err,...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('Num.,Temp.,UV,red power normalized avg plots')
xlabel('GHz_synth [MHz]')
ylabel('Normalized Signal [arb.]')
string = ['FC exponent used = ', num2str(FCexponent)];
annotation('textbox',[0.15,0.8,0.3,0.1],'String', string);
%legend(num2str(scanIDs(id)))
end
if species ==3
errorbar(xavg{id}-xavg{id}(offset), yavg{id}*avgtemp^(3)/uv(id)/red(id)/num(id)^3, yavgerr{id}*avgtemp^(3)/uv(id)/red(id)/num(id)^3,...
'LineStyle','-',...
'Marker', 'o',...
'MarkerSize', analyVar.markerSize,...
'MarkerFaceColor', analyVar.COLORS(id,:),...
'MarkerEdgeColor', 'none',...
'Color', analyVar.COLORS(id,:));
title('Num.,Temp.,UV,red power normalized avg plots')
xlabel('GHz_synth [MHz]')
ylabel('Normalized Signal [arb.]')
%legend(num2str(scanIDs(id)))
end
end
hold off;
legend(num2str(scanIDs))
funcOut.analyVar = analyVar;
funcOut.indivDataset = indivDataset;
funcOut.avgDataset = avgDataset;
end