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
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
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230510_MotionalSpectrum/DataOpticTransitory/')
MOTIONAL_FILES = """
000012033-AD9910RAM
000012032-AD9910RAM
000012031-AD9910RAM
000012030-AD9910RAM
000012025-AD9910RAM
000012026-AD9910RAM
000012027-AD9910RAM
000012028-AD9910RAM
000012029-AD9910RAM
000012034-AD9910RAM
"""
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(MOTIONAL_FILES))
#%%
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211101_CPT_DosLaseres_v03\Data
Counts = []
RealFreqs = []
UV_amp_vec = []
for i, fname in enumerate(MOTIONAL_FILES.split()):
print(str(i) + ' - ' + fname)
data = h5py.File(fname+'.h5', 'r')
RealFreqs.append(np.array(data['datasets']['real_freq']))
Counts.append(np.array(data['datasets']['counts']))
UV_amp_vec.append(np.array(data['datasets']['UV_amp']))
Potencias = [7.4, 11.4, 16.8, 23.2, 31.1, 40.7, 51.5, 64, 78.2, 92.7, 108, 124, 134, 154, 167]
PotenciasUsadas = [7.4, 11.4, 16.8, 23.2, 31.1, 40.7, 51.5, 64, 78.2]
#%%
"""
Ploteo una curva para buscar su minimo
"""
jvec = [0,1,2]
plt.figure()
i = 0
kmin = 106
for j in jvec:
plt.errorbar([1*f*1e-3 for f in RealFreqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label=f"Pot: {Potencias[j]} uW")
plt.plot([1*f*1e-3 for f in RealFreqs[j]][kmin], Counts[j][kmin], 'o', markersize=15)
i = i + 1
plt.xlabel('Frecuencia (kHz)')
plt.ylabel('counts')
#plt.xlim(782,787)
#plt.ylim(2000,5000)
plt.grid()
plt.legend(loc='upper left')
#%%
"""
Ploteo las curvas de referencia
"""
jvec = [0, 1, 2, 3, 8]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([1*f*1e-3 for f in RealFreqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label=f"Pot: {Potencias[j]} uW")
i = i + 1
plt.xlabel('Frecuencia (kHz)')
plt.ylabel('counts')
#plt.xlim(782,787)
plt.ylim(2000,5000)
plt.grid()
plt.legend(loc='upper left')
#%%
"""
Busco el cociente entre el minimo y el maximo
"""
kmins = [106, 106, 106, 106, 110, 110, 110, 112, 108]
minabs = np.min(Counts[2])
MinimosFluos = []
MaximosFluos = []
CocientesFluos = []
ErrorCocientesFluos = []
for m in range(9):
mini = Counts[m][kmins[m]]-minabs
maxi = Counts[m][0]-minabs
MinimosFluos.append(mini)
MaximosFluos.append(maxi)
CocientesFluos.append(mini/maxi)
ErrorCocientesFluos.append((mini/maxi)*(np.sqrt(mini)/mini + np.sqrt(maxi)/maxi))
plt.figure()
plt.errorbar(PotenciasUsadas, CocientesFluos, yerr=ErrorCocientesFluos, fmt='o', capsize=5, markersize=15)
plt.axhline(1)
plt.xlabel('Potencia IR (uW)')