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
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
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211020_CPT_DosLaseres\Data
ALL_FILES = """000004585-IR_Scan_withcal_optimized
000004586-IR_Scan_withcal_optimized
000004587-IR_Scan_withcal_optimized
000004589-IR_Scan_withcal_optimized
000004590-IR_Scan_withcal_optimized
000004591-IR_Scan_withcal_optimized
000004594-IR_Scan_withcal_optimized
000004597-IR_Scan_withcal_optimized
000004639-IR_Scan_withcal_optimized
000004652-IR_Scan_withcal_optimized
000004653-IR_Scan_withcal_optimized
000004654-IR_Scan_withcal_optimized
000004655-IR_Scan_withcal_optimized
000004656-IR_Scan_withcal_optimized
000004667-IR_Scan_withcal_optimized
000004668-IR_Scan_withcal_optimized
000004669-IR_Scan_withcal_optimized
000004676-IR_Scan_withcal_optimized
000004680-IR_Scan_withcal_optimized
000004681-IR_Scan_withcal_optimized
000004690-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\artiq_master\results\2021-07-14\16
Counts = []
Freqs = []
AmpTisa = []
No_measures = []
for i, fname in enumerate(ALL_FILES.split()):
print(i)
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']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
j = 4 #Amp tisa = 0
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 6 #Amp tisa = 0.05
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0.05')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
plt.title(r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
#%%
j = 4 #Amp tisa = 0
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 5 #Amp tisa = 0.1
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0.10')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
plt.title(r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
#%%
j = 4 #Amp tisa = 0
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 3 #Amp tisa = 0.15
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Amp Tisa = 0.16')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
plt.title(r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
#%%
j = 3 #Amp tisa = 0.15, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 7 #Amp tisa = 0.15, pol edcl=pi, pol tisa = smsm
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Pol ECDL: $\pi$, pol TISA: $\sigma_+ + \sigma_-$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
plt.ylim(0, 550)
plt.title('Amp Tisa = 0.16')
#%%
j = 3 #Amp tisa = 0.15, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 7 #Amp tisa = 0.15, pol edcl=pi, pol tisa = smsm
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Pol ECDL: $\pi$, pol TISA: $\sigma_+ + \sigma_-$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 4 #Amp tisa = 0
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Amp Tisa = 0, Pol ECDL: $\sigma_+ + \sigma_-$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
plt.ylim(0, 650)
plt.title('Amp Tisa = 0.16')
#%%
### NUEVAS MEDICIONES ###
j = 8 #Amp tisa = 0.15, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=r'Pol ECDL: $\sigma_+ + \sigma_-$, pol TISA: $\pi$')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
#%% LA MEJOR DE TODAS CON 4 PICOS SIN TISA
j = 9 #Amp tisa = 0, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=r'Amp Tisa = 0')
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
BestF = [2*f*1e-6 - 436 for f in Freqs[j]]
BestC = Counts[j]
j = 11 #Amp tisa = 0.14, pol edcl=smsm, pol tisa = pi
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=r'Amp Tisa = 0.14')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 13 #Amp tisa = 0.15, pol edcl=smsm, pol tisa = pi
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=r'Amp Tisa = 0.06')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.legend()
#%% LA MEJOR DE TODAS CON 4 PICOS SIN TISA
j = 14 #Amp tisa = 0, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=f'Amp Tisa = {AmpTisa[j]}')
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 15 #Amp tisa = 0.14, pol edcl=smsm, pol tisa = pi
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=f'Amp Tisa = {AmpTisa[j]}')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 16 #Amp tisa = 0.14, pol edcl=smsm, pol tisa = pi
#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', markersize=3, linewidth=1, label=f'Amp Tisa = {AmpTisa[j]}')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.legend()
plt.title('Mediciones de noche del jueves')
#%%
j = 18 #Amp tisa = 0, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([f*1e-6 for f in Freqs[j]], Counts[j], 'o', markersize=3, linewidth=1, label=f'Amp Tisa = {AmpTisa[j]}')
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
j = 19
plt.plot([f*1e-6 for f in Freqs[j]], Counts[j], 'o', markersize=3, linewidth=1, label=f'Amp Tisa = {AmpTisa[j]}')
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.title('Referencia para mediciones del viernes')
#%%
j = 9 #Amp tisa = 0, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o', markersize=3, linewidth=1)
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.axvline(419, linestyle='--', linewidth=1, color='red', label='Detuning UV = -22 MHz')
plt.legend()
#%%
j = 20 #Amp tisa = 0, pol edcl=smsm, pol tisa = pi
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o', markersize=3, linewidth=1)
#plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], np.sqrt(np.array(Counts[j])))
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.axvline(423, linestyle='--', linewidth=1, color='red', label='Detuning UV = -17 MHz')
plt.legend()