Newer
Older
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
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
# Solo levanto algunos experimentos
Calib_Files_IR = """000003547-IR_Saturation.h5"""
Calib_Files_UV = """000002865-UV_Saturation.h5
000002866-UV_Saturation.h5
000002867-UV_Saturation.h5
000002868-UV_Saturation.h5
000002869-UV_Saturation.h5
000002870-UV_Saturation.h5
000002871-UV_Saturation.h5
000002872-UV_Saturation.h5
000002873-UV_Saturation.h5
000002874-UV_Saturation.h5
000002875-UV_Saturation.h5"""
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20210824_SaturacionTransiciones\Data_UV
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20210824_SaturacionTransiciones\Data_IR
def SeeKeys(files):
for i, fname in enumerate(files.split()):
data = h5py.File(fname, 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'
print(fname)
print(list(data['datasets'].keys()))
def ConvertIRampstoPower(amp):
amps = [0.01, 0.03, 0.05, 0.07, 0.09, 0.11, 0.13, 0.15, 0.17, 0.19, 0.21, 0.23, 0.25, 0.27, 0.29, 0.31, 0.33, 0.35]
powers = [0, 0.22, 1.42, 5.1, 13.13, 27, 48, 78, 116, 161, 211, 261, 310, 363, 412, 448, 486, 516]
f = interpolate.interp1d(amps, powers)
return f(amp)
def SaturationCurve(p, F0, a, det):
return 0.5*F0*a*p*(1/(1+a*p+4*((det**2)/(g23**2))))
def SaturationCurve_detzero(p, F0, a):
return 0.5*F0*a*p*(1/(1+a*p))
#%%
IR_powers_vec = []
IR_fluorescence_vec = []
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20210906_SaturacionTransiciones_MejorAlineacion\Data_IR
for i, fname in enumerate(Calib_Files_IR.split()):
print(i)
#print(fname)
data = h5py.File(fname, 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'
#print(list(data['datasets'].keys()))
meas = np.array(data['datasets']['measurements_IR_sat'])
IR_fluorescence_vec.append(meas)
IR_meas_amps = np.array(data['datasets']['IR_amps'])
IR_meas_powers = [ConvertIRampstoPower(amp) for amp in IR_meas_amps]
IR_powers_vec.append(IR_meas_powers)
#%%
#Calculo el coeficiente de proporcionalidad entre S y Pot
j = 0
def SaturationCurve_detzero(p, F0, a):
return 0.5*F0*a*p*(1/(1+a*p))
IR_powers_vec_W = [p*1e-6 for p in IR_powers_vec[j]]
popt, pcov = curve_fit(SaturationCurve_detzero, IR_powers_vec_W, IR_fluorescence_vec[j], p0=(2e3, 5e4))
plt.figure()
plt.plot([popt[1]*p for p in IR_powers_vec_W], IR_fluorescence_vec[j], 'o')
plt.plot([popt[1]*p for p in IR_powers_vec_W], [SaturationCurve_detzero(p, popt[0], popt[1]) for p in IR_powers_vec_W])
plt.xlabel('Sat Parameter DP')
plt.ylabel('counts')
plt.title('Detuning = 0 MHz')
plt.grid()
plt.figure()
plt.plot([1e6*p for p in IR_powers_vec_W], IR_fluorescence_vec[j], 'o')
plt.plot([1e6*p for p in IR_powers_vec_W], [SaturationCurve_detzero(p, popt[0], popt[1]) for p in IR_powers_vec_W])
plt.xlabel('Potencia (uW)')
plt.ylabel('counts')
plt.title('Detuning = 0 MHz')
plt.grid()
print(popt)
factor = popt[1]
w_866 = 2*np.pi*346e12
w_397 = 2*np.pi*755e12
c=3e8
hbar = 1.05e-34
g21, g23 = 2*np.pi*21.58e6, 2*np.pi*1.35e6
g23b = 2*np.pi*23.05*1e6
radius = np.sqrt(6*c*c*2/(hbar*(w_866**3)*g23*factor))
print(f'Diametro: {2*radius*1e6} um')
print(f'Isat: {(2/(factor*np.pi*(radius**2)))*1e3/1e4} mW/cm2')
plt.figure()
plt.plot([p*1e6 for p in IR_powers_vec_W], [popt[1]*p for p in IR_powers_vec_W], 'o')
plt.xlim(-10, 100)
plt.ylim(-1, 5)
#plt.xlabel()
#%%
#Calculo el coeficiente de proporcionalidad entre S y Pot
j = 16
w_866 = 2*np.pi*346e12
w_397 = 2*np.pi*755e12
c=3e8
hbar = 1.05e-34
g21, g23 = 2*np.pi*21.58e6, 2*np.pi*1.35e6
g23 = 2*np.pi*23.05*1e6
def SaturationCurve(p, F0, det):
return 0.5*F0*factor*p*(1/(1+factor*p+4*((det**2)/(g23**2))))
IR_powers_vec_W = [p*1e-6 for p in IR_powers_vec[j]]
popt, pcov = curve_fit(SaturationCurve, IR_powers_vec_W, IR_fluorescence_vec[j], p0=(4e3, 2e7))
plt.figure()
plt.plot([factor*p for p in IR_powers_vec_W], IR_fluorescence_vec[j], 'o', label=f'Det: {round(1e-6*popt[1]/(2*np.pi), 1)} MHz')
plt.plot([factor*p for p in IR_powers_vec_W], [SaturationCurve(p, popt[0], popt[1]) for p in IR_powers_vec_W])
plt.xlabel('Sat Parameter DP')
plt.ylabel('counts')
plt.legend()
plt.grid()
#factor = popt[1]
print(f'Detuning: {1e-6*popt[1]/(2*np.pi)} MHz')
#radius = np.sqrt(12*c*c/(hbar*(w_866**3)*g23*factor))
#print(f'Diametro: {2*radius*1e6} um')