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
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\20211216_CPT_DosLaseres_v06\Data
ALL_FILES = """000006557-IR_Scan_withcal_optimized
000006558-IR_Scan_withcal_optimized
000006559-IR_Scan_withcal_optimized
000006560-IR_Scan_withcal_optimized
000006561-IR_Scan_withcal_optimized
000006562-IR_Scan_withcal_optimized
000006563-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']))
#%%
#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 = [0, 1, 2, 3, 4, 5, 6]
Angs = [90, 0, 15, 30, 45, 60, 75]
jselected = [6, 1, 3]
plt.figure()
i = 0
for j in jvec:
if j in jselected:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', label=f'Ang ECDL: {Angs[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()