Commit 42ea9a65 authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto

pusheo modificaciones al codigo

parent c3fdbdf9
...@@ -8,9 +8,7 @@ from scipy.optimize import curve_fit ...@@ -8,9 +8,7 @@ from scipy.optimize import curve_fit
import os import os
# Solo levanto algunos experimentos # Solo levanto algunos experimentos
ALL_FILES_SP = """000001503-SingleLine.h5 ALL_FILES_SP = """000001505-SingleLine.h5
000001504-SingleLine.h5
000001505-SingleLine.h5
000001506-SingleLine.h5 000001506-SingleLine.h5
000001507-SingleLine.h5 000001507-SingleLine.h5
000001508-SingleLine.h5 000001508-SingleLine.h5
...@@ -21,6 +19,8 @@ ALL_FILES_SP = """000001503-SingleLine.h5 ...@@ -21,6 +19,8 @@ ALL_FILES_SP = """000001503-SingleLine.h5
000001513-SingleLine.h5 000001513-SingleLine.h5
000001514-SingleLine.h5""" #este tiene amplitud 0.08 que es muy poquito 000001514-SingleLine.h5""" #este tiene amplitud 0.08 que es muy poquito
#000001504-SingleLine.h5
BINW = 20e-9 BINW = 20e-9
T0 = 1.15e-6 T0 = 1.15e-6
...@@ -78,12 +78,12 @@ for i, fname in enumerate(ALL_FILES_SP.split()): ...@@ -78,12 +78,12 @@ for i, fname in enumerate(ALL_FILES_SP.split()):
# ax.hist(counts, bines[bines<3e-6], histtype='step', align='mid', color=f"C{i}") # ax.hist(counts, bines[bines<3e-6], histtype='step', align='mid', color=f"C{i}")
heigs, binsf = np.histogram(counts, bines[bines>T0]) heigs, binsf = np.histogram(counts, bines[bines>T0])
ax0.step(binsf[:-1], heigs, label=f"AMP: {laser_UV_amp}", where='mid', ax0.step([t*1e6 for t in binsf[:-1]], heigs, label=f"AMP: {laser_UV_amp}", where='mid',
color=f"C{i}", lw=0.5, alpha=0.4) color=f"C{i}", lw=0.5, alpha=0.4)
popt, pcov = curve_fit(expo, binsf[:-1], heigs, p0=(2e-6, 400, 300)) popt, pcov = curve_fit(expo, binsf[:-1], heigs, p0=(2e-6, 400, 300))
print(popt) # tau, N0, C print(popt) # tau, N0, C
ax0.plot(binsf, expo(binsf, *popt), label=f"tau: {popt[0]}", ax0.plot([t*1e6 for t in binsf], expo(binsf, *popt), label=f"tau: {popt[0]}",
color=f"C{i}", ls='-', lw=1, zorder=99) color=f"C{i}", ls='-', lw=1, zorder=99)
allamps = np.append(allamps, laser_UV_amp) allamps = np.append(allamps, laser_UV_amp)
...@@ -92,19 +92,20 @@ for i, fname in enumerate(ALL_FILES_SP.split()): ...@@ -92,19 +92,20 @@ for i, fname in enumerate(ALL_FILES_SP.split()):
alltaus = np.append(alltaus, popt[0]) alltaus = np.append(alltaus, popt[0])
allN0 = np.append(allN0, popt[1]) allN0 = np.append(allN0, popt[1])
ax1_a.plot(laser_pow , popt[0], 'o', color=f"C{i}", ms=5, )
ax1_a.plot(laser_pow , 1e6*popt[0], 'o', color=f"C{i}", ms=5, )
ax1_b.plot(laser_pow, popt[1], '^', color=f"C{i}", ms=7, ) ax1_b.plot(laser_pow, popt[1], '^', color=f"C{i}", ms=7, )
ax1_a.plot(allpows, alltaus, 'k-', lw=0.2, zorder=0) ax1_a.plot(allpows, [t*1e6 for t in alltaus], 'k-', lw=0.2, zorder=0)
ax1_b.plot(allpows, allN0, 'k-', lw=0.2, zorder=0) ax1_b.plot(allpows, allN0, 'k-', lw=0.2, zorder=0)
# plt.annotate(f"bin: {BINW}", (0,5e-5, 700), fontsize=14) # plt.annotate(f"bin: {BINW}", (0,5e-5, 700), fontsize=14)
ax0.set_xlabel("Tiempo") ax0.set_xlabel("Tiempo (us)")
ax0.set_ylabel("Cuentas") ax0.set_ylabel("Cuentas")
ax1_a.set_xlabel("Potencia [uW]") ax1_a.set_xlabel("Potencia [uW]")
ax1_a.set_ylabel("Tau (circulo)") ax1_a.set_ylabel("Tau (circulo) (us)")
ax1_b.set_ylabel("Alturas (triang)") ax1_b.set_ylabel("Alturas (triang)")
ax1_a.grid(alpha=0.3) ax1_a.grid(alpha=0.3)
...@@ -117,4 +118,4 @@ plt.xlabel("Potencia [uW]") ...@@ -117,4 +118,4 @@ plt.xlabel("Potencia [uW]")
plt.ylabel("Alturas/Tau") plt.ylabel("Alturas/Tau")
plt.show() plt.show()
input() #input()
...@@ -25,20 +25,21 @@ def pow_from_amp(amp): ...@@ -25,20 +25,21 @@ def pow_from_amp(amp):
assert amp in amplitudes_UV assert amp in amplitudes_UV
potencias_UV = np.array([5, 11, 20, 32, 47, 67, 86, 105, 120, 134, 144]) potencias_UV = np.array([5, 11, 20, 32, 47, 67, 86, 105, 120, 134, 144])
return potencias_UV[np.where(amplitudes_UV == amp)][0] return potencias_UV[np.where(amplitudes_UV == amp)][0]
"""
amplitudes_UV = np.flip(np.array([0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30])) amplitudes_UV = np.flip(np.array([0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30]))
potencias_UV = np.flip(np.array([4, 10, 19, 32, 49, 71, 96, 125, 155, 183, 208, 229])) potencias_UV = np.flip(np.array([4, 10, 19, 32, 49, 71, 96, 125, 155, 183, 208, 229]))
plt.plot(amplitudes_UV, potencias_UV, 'ko-', lw=0.2) plt.plot(amplitudes_UV, potencias_UV, 'ko-', lw=0.2)
plt.xlabel("Amplitud Urukul") plt.xlabel("Amplitud Urukul")
plt.ylabel("Potencia /uW") plt.ylabel("Potencia /uW")
plt.grid() plt.grid()
"""
#%% #%%
## Mostrar corte de los histos: ## Mostrar corte de los histos:
# fig, ax = plt.subplots() # fig, ax = plt.subplots()
# ax.axvline(T0, color='k') # ax.axvline(T0, color='k')
#os.chdir('/home/oem/Documentos/Doctorado/Artiq/Repositorio/artiq_experiments/artiq_master/results/2021-07-02/17') os.chdir('/home/oem/Documentos/Doctorado/Artiq/Repositorio/artiq_experiments/artiq_master/results/2021-07-08/19')
#fig0, [ax0, ax1_a] = plt.subplots(1, 2) #fig0, [ax0, ax1_a] = plt.subplots(1, 2)
#ax1_b = ax1_a.twinx() #ax1_b = ax1_a.twinx()
...@@ -59,12 +60,11 @@ for i, fname in enumerate(ALL_FILES.split()): ...@@ -59,12 +60,11 @@ for i, fname in enumerate(ALL_FILES.split()):
laser_UV_amp = data['datasets']['laser_UV_amp'] laser_UV_amp = data['datasets']['laser_UV_amp']
laser_UV_freq = data['datasets']['laser_UV_freq'] laser_UV_freq = data['datasets']['laser_UV_freq']
#print(laser_UV) #print(laser_UV)
measurements = np.array(data['datasets']['measurements']) measurements = np.array(data['datasets']['measurements'])
freqs = np.array(data['datasets']['IR_frequencies']) freqs = np.array(data['datasets']['IR_frequencies'])
n = np.array(data['datasets']['no_measures']) n = np.array(data['datasets']['no_measures'])
t_readout = np.array(data['datasets']['t_readout'])
print(measurements) print(measurements)
print(freqs) print(freqs)
...@@ -80,3 +80,4 @@ for i in range(len(measurements)): ...@@ -80,3 +80,4 @@ for i in range(len(measurements)):
plt.plot([f*1e-6 for f in freqs], SumaTotal, 'o') plt.plot([f*1e-6 for f in freqs], SumaTotal, 'o')
plt.xlabel('Frecuencia AOM (MHz)') plt.xlabel('Frecuencia AOM (MHz)')
plt.ylabel('Cuentas') plt.ylabel('Cuentas')
plt.title(f'Pot 397: 60 uW, Pot866 @ 208 MHz: 250 uW, Nmeds: {n}, Nfreqs: {len(freqs)}, treadout = {int(t_readout*1e6)} us')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment