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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
import h5py
import matplotlib.pyplot as plt
import numpy as np
import sys
import re
import ast
from scipy.optimize import curve_fit
import os
from scipy import interpolate
#BUENAS MEDICIONES VARIANDO PARAMETROS
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211201_CPT_DosLaseres_v05\Data
ALL_FILES = """000006238-IR_Scan_withcal_optimized
000006239-IR_Scan_withcal_optimized
000006247-IR_Scan_withcal_optimized
000006254-IR_Scan_withcal_optimized
000006308-IR_Scan_withcal_optimized
000006309-IR_Scan_withcal_optimized
000006310-IR_Scan_withcal_optimized
000006313-IR_Scan_withcal_optimized
000006314-IR_Scan_withcal_optimized
000006315-IR_Scan_withcal_optimized
000006316-IR_Scan_withcal_optimized
000006317-IR_Scan_withcal_optimized
000006382-IR_Scan_withcal_optimized
000006422-IR_Scan_withcal_optimized
000006423-IR_Scan_withcal_optimized
000006424-IR_Scan_withcal_optimized
000006425-IR_Scan_withcal_optimized
000006469-IR_Scan_withcal_optimized
000006470-IR_Scan_withcal_optimized
000006471-IR_Scan_withcal_optimized
000006497-IR_Scan_withcal_optimized
000006498-IR_Scan_withcal_optimized
000006499-IR_Scan_withcal_optimized
000006500-IR_Scan_withcal_optimized
000006501-IR_Scan_withcal_optimized
000006502-IR_Scan_withcal_optimized
000006503-IR_Scan_withcal_optimized
000006504-IR_Scan_withcal_optimized
000006505-IR_Scan_withcal_optimized
000006506-IR_Scan_withcal_optimized
000006507-IR_Scan_withcal_optimized
000006508-IR_Scan_withcal_optimized
"""
def SeeKeys(files):
for i, fname in enumerate(files.split()):
data = h5py.File(fname+'.h5', 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'
print(fname)
print(list(data['datasets'].keys()))
print(SeeKeys(ALL_FILES))
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211101_CPT_DosLaseres_v03\Data
Counts = []
Freqs = []
AmpTisa = []
UVCPTAmp = []
No_measures = []
for i, fname in enumerate(ALL_FILES.split()):
print(str(i) + ' - ' + fname)
#print(fname)
data = h5py.File(fname+'.h5', 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'
# Aca hago algo repugnante para poder levantar los strings que dejamos
# que además tenian un error de tipeo al final. Esto no deberá ser necesario
# cuando se solucione el error este del guardado.
Freqs.append(np.array(data['datasets']['IR_Frequencies']))
Counts.append(np.array(data['datasets']['counts_spectrum']))
AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
UVCPTAmp.append(np.array(data['datasets']['UV_CPT_amp']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
#VARIANDO POTENCIA IR se ve que aparecen las DR
jvec = [1]
plt.figure()
i = 0
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#TISA ON. Dos configuraciones de polarizaciones cruzadas de los dos laseres infrarrojos
#Poca estadistica, 15k mediciones
jvec = [3]
plt.figure()
i = 0
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#%%
#CAMBIO POLARIZACIONES: ahora pongo ambas en sigma+ + sigma-
#Voy variando la potencia del tisa a ver si veo que se apaguen todas las resonancias.
#20 k mediciones
jvec = [8, 9, 7]
AmpTisa = [0.1, 0.05, 0]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', label=f'Amp Tisa: {AmpTisa[i]}', capsize=2, markersize=2)
#plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=f'Amp Tisa: {AmpTisa[i]}', markersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
#%%
#SE CHOTEO CUANDO TOQUE EL PINHOLE, PASE DE 4 DR A UNA COSA RARA
jvec = [10, 11]
plt.figure()
i = 0
for j in jvec:
if j==10:
plt.plot([2*f*1e-6 for f in Freqs[j]], [1*c for c in Counts[j]], 'o-', markersize=3)
else:
plt.plot([2*f*1e-6 for f in Freqs[j]], [1*c for c in Counts[j]], 'o-', markersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#4 DR muy bullish
jvec = [12]
plt.figure()
i = 0
for j in jvec:
if j==10:
plt.plot([2*f*1e-6 for f in Freqs[j]], [1*c for c in Counts[j]], 'o-', markersize=3)
else:
plt.plot([2*f*1e-6 for f in Freqs[j]], [1*c for c in Counts[j]], 'o-', markersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#Variando potencia UV
jvec = [14, 15, 16]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', label=f'Amp Tisa: {AmpTisa[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#Variando potencia UV
jvec = [16]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', label=f'Amp Tisa: {AmpTisa[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend(
#%%
#FITEOSSSSS
#Variando la polarizacion del UV
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
T = 0.6e-3
sg = 0.49
sp = 4
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 33.5e6
B = (u/(2*np.pi))/c
correccion = 8 #con 8 fitea bien
offsetxpi = 440+1+correccion
DetDoppler = -14-correccion
FreqsDRpi_1 = [2*f*1e-6-offsetxpi+14 for f in Freqs[16]]
CountsDRpi_1 = Counts[16]
freqslongpi_1 = np.arange(min(FreqsDRpi_1), max(FreqsDRpi_1)+FreqsDRpi_1[1]-FreqsDRpi_1[0], 0.1*(FreqsDRpi_1[1]-FreqsDRpi_1[0]))
def FitEITpi(freqs, SG, SP):
temp = 2e-3
MeasuredFreq, MeasuredFluo = GenerateNoisyCPT_fit(SG, sr, SP, gPS, gPD, DetDoppler, DetRepump, u, DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth, temp, alpha, phidoppler, titadoppler, phiprobe, [titaprobe], phirepump, titarepump, freqs, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
FinalFluo = [f*5.95591183e4 + 8.6e2 for f in MeasuredFluo]
return FinalFluo
popt, pcov = curve_fit(FitEITpi, FreqsDRpi_1, CountsDRpi_1, p0=[0.7, 4], bounds=(0, [2, 30]))
print(popt)
FittedEITpi_1 = FitEITpi(freqslongpi_1, *popt)
plt.figure()
plt.errorbar(FreqsDRpi_1, CountsDRpi_1, yerr=2*np.sqrt(CountsDRpi_1), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi_1, FittedEITpi_1)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
#%%
#AHORA SI: VARIANDO POTENCIA TISA, CON DOS IR EN SIGMAM M SIGMAM
jvec = [17, 18, 19]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', label=f'Amp Tisa: {AmpTisa[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#MEJORES MEDS
#VARIANDO POLARIZACION TISA LINEAL. Doy fe que el detuning se mantuvo recontra estable en todas las mediciones
jvec = [20, 21, 22]
Angle = ['tisaoff', 0, 90]
plt.figure()
i = 0
for j in jvec:
if j==20:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='-o', label=f'Tisa off', capsize=2, markersize=2)
else:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='-o', label=f'Tisa ang: {Angle[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
#%%
#MEJORES MEDS
#VARIANDO POLARIZACION TISA LINEAL, 3 angulos
jvec = [21, 23, 22]
Angle = [0, 45, 90]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='-o', label=f'Tisa ang: {Angle[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.ylim(2500, 6100)
plt.legend()
#%%
#MEJORES MEDS
#VARIANDO POLARIZACION TISA LINEAL
jvec = [21, 22, 23, 24, 25, 26, 27]
Angle = [0, 90, 45, 30, 60, 15, 75]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='-o', label=f'Tisa ang: {Angle[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.ylim(2500, 6100)
plt.legend()
#%%
#MEJORES MEDS
#VARIANDO POTENCIA TISA, A 90°
jvec = [28, 29, 30]
Amp = [0.25, 0.3, 0.1]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='-o', label=f'Tisa amp: {Amp[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.ylim(2500, 6100)
plt.legend()