Commit cd346c12 authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto
parents d0b09909 f2229730
...@@ -3,7 +3,7 @@ import numpy as np ...@@ -3,7 +3,7 @@ import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
#plt.ion() #plt.ion()
dataREAL = pd.read_csv("medidos_powers_taus.csv") #dataREAL = pd.read_csv("medidos_powers_taus.csv")
dataSIM = pd.read_csv("sim_intensidad_taus_full.csv") dataSIM = pd.read_csv("sim_intensidad_taus_full.csv")
errsSIM = pd.read_csv("error_teorico_tau_det20.csv") errsSIM = pd.read_csv("error_teorico_tau_det20.csv")
I_sat = 43.3*1e-5 #uW/um2 I_sat = 43.3*1e-5 #uW/um2
...@@ -11,50 +11,51 @@ I_sat = 43.3*1e-5 #uW/um2 ...@@ -11,50 +11,51 @@ I_sat = 43.3*1e-5 #uW/um2
#%% ##################################################################################### #%% #####################################################################################
### Plot de lineas teoricas tau-intensidad variando detuning + datos medidos ### Plot de lineas teoricas tau-intensidad variando detuning + datos medidos
UVpotVec=[4,6,12,17,26,36, 48, 77, 112, 151, 190, 226, 255, 279]
Taus = [2.6474524026975392, 1.651982852985559, 1.0793431020294597, 0.8171909874107741, 0.6329192159654833, 0.5246427838474966, 0.468752585310023, 0.3943320198588099, 0.34233658233849174, 0.314035400291993, 0.30338246040910105,0.2891087574893047, 0.2861944000648665,0.2804274973493638]
Taus_v2 = [1.6655917442406167, 1.1754160164890701, 1.0129299348502132, 0.6747311668331314, 0.5395244011650271, 0.4699144306437099, 0.41805942894076137, 0.3948601586682529, 0.3849453824721735, 0.3752507710597908]
fig2, ax2 = plt.subplots(figsize=(4,3)) fig2, ax2 = plt.subplots(figsize=(4,3))
detuning_lines = ['Det10', 'Det20', 'Det30', 'Det40', 'Det50', 'Det60', 'Det70', 'Det80', 'Det90'] detuning_lines = ['Det10', 'Det20', 'Det30', 'Det40', 'Det50', 'Det60', 'Det70', 'Det80', 'Det90']
# Curvas de las simulaciones con tau en unidades de microseg # Curvas de las simulaciones con tau en unidades de microseg
for det in detuning_lines: for det in detuning_lines:
ax2.plot(dataSIM.I, dataSIM[det]*1e6, 'k-', ms=1, lw=0.5) ax2.plot(dataSIM.I**1, [d for d in dataSIM[det]*1e6], 'k-', ms=1, lw=0.5)
# Curvas de las mediciones cambiando el radio posible con tau en microseg # Curvas de las mediciones cambiando el radio posible con tau en microseg
for cambio in [0]: # esto es para shiftear la potencia medida for cambio in [0]: # esto es para shiftear la potencia medida
potencias = dataREAL.Pow - cambio potencias = dataREAL.Pow - cambio
for rad in [85.7*1.5]: # esto evalua con distintos radios for rad in [128]: # esto evalua con distintos radios
ax2.errorbar([p/(np.pi*(rad**2)) for p in UVpotVec], Taus, yerr=np.mean(1e6*errsSIM.stdval.values), ax2.errorbar([(p/(np.pi*(rad**2)))**1 for p in UVpotVec], [t for t in Taus], yerr=np.mean(1e6*errsSIM.stdval.values),
fmt='.--', ms=6, lw=.5, \ fmt='.--', ms=6, lw=.5, \
color="#3949ab", color="#3949ab",
capsize=2) capsize=2)
ax2.errorbar([p/(np.pi*(rad**2)) for p in UVpotVec][4:], Taus_v2[4:], yerr=np.mean(1e6*errsSIM.stdval.values), ax2.errorbar([(p/(np.pi*(rad**2)))**1 for p in UVpotVec][4:], [t for t in Taus_v2], yerr=np.mean(1e6*errsSIM.stdval.values),
fmt='.--', ms=6, lw=.5, \ fmt='.--', ms=6, lw=.5, \
color="#3949ab", color="#3949ab",
capsize=2) capsize=2)
#ax2.errorbar(potencias/(np.pi*(rad**2)), dataREAL.Tau*1e6, \
# yerr = 1e6*errsSIM.stdval.values, \
# fmt='.--', ms=6, lw=.5, \
# color="#3949ab",
# capsize=3,
# label=f'r={rad}; cambio={cambio}')
fs = 9 fs = 9
ax2.set_xlim([0.47e-4, 0.8e-2]) ax2.set_xlim([0.47e-4, 0.8e-2])
ax2.set_ylim([2e-1, 4e1]) #ax2.set_xlim([0., 0.000005])
#ax2.set_ylim([2e-1, 4e1])
ax2.set_ylabel(r"Characteristic time ($\mu$s)", fontname='STIXGeneral') ax2.set_ylabel(r"Characteristic time ($\mu$s)", fontname='STIXGeneral')
#ax2.set_xlabel(r"$I = P / (\pi\,r^2)$ [$\mu$W/$\mu$m$^2$]") #ax2.set_xlabel(r"$I = P / (\pi\,r^2)$ [$\mu$W/$\mu$m$^2$]")
ax2.set_xlabel(r'UV intensity ($\mu$W/$\mu$m$^2$)', fontname='STIXGeneral') ax2.set_xlabel(r'UV intensity ($\mu$W/$\mu$m$^2$)', fontname='STIXGeneral')
# ax2.set_title(r"datos(punteadas) $r \in [30; 190]\ \mu m$ | simulacion(llenas) $\Delta \in -[10; 90]$ MHz") # ax2.set_title(r"datos(punteadas) $r \in [30; 190]\ \mu m$ | simulacion(llenas) $\Delta \in -[10; 90]$ MHz")
#ax2.legend(markerscale=2) #ax2.legend(markerscale=2)
ax2.set_xticks([1e-4, 1e-3]) #ax2.set_xticks([1e-4, 1e-3])
ax2.set_xticklabels([1e-4, 1e-3], fontsize=fs, fontname='STIXGeneral') ax2.set_xticklabels([1e-4, 1e-3], fontsize=fs, fontname='STIXGeneral')
ax2.set_yticks([1e0, 1e1]) #ax2.set_yticks([1e0, 1e1])
ax2.set_yticklabels([1e0, 1e1], fontsize=fs, fontname='STIXGeneral') ax2.set_yticklabels([1e0, 1e1], fontsize=fs, fontname='STIXGeneral')
ax2.grid(which='minor', alpha=0.2) ax2.grid(which='minor', alpha=0.2)
ax2.set_xscale("log") ax2.set_xscale("log")
ax2.set_yscale("log") ax2.set_yscale("log")
plt.savefig('Fig03_varyingUVpower.pdf')
plt.savefig('Fig03_varyingUVpower.svg')
...@@ -9,9 +9,9 @@ import os ...@@ -9,9 +9,9 @@ import os
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221006_transitoriosv2') os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221006_transitoriosv2')
# Solo levanto algunos experimentos # Solo levanto algunos experimentos
SP_files = [8445, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469] SP_files = [8445, 8457, 8458, 8459, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 84840, 88040]
SP_files_v2 = [8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776] SP_files_v2 = [8763, 8764, 8765, 8766, 8767, 8768, 8769, 8770, 8771, 8772, 8773, 8774, 8775, 8776]
DP_files = [8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482] DP_files = [8472, 8473, 8474, 8475, 8476, 8477, 8478, 8479, 8480, 8481, 8482, 8749]
Long_files = ['DP_long', 'SP_long', 'DP_long_v2', 'DP_long_v3', 'DP_long_new', 'SP_long_new'] Long_files = ['DP_long', 'SP_long', 'DP_long_v2', 'DP_long_v3', 'DP_long_new', 'SP_long_new']
Calib_files = ['Cal_DP_5M', 'Cal_SP_5M', 'Cal_DP_25M', 'Cal_SP_25M'] Calib_files = ['Cal_DP_5M', 'Cal_SP_5M', 'Cal_DP_25M', 'Cal_SP_25M']
...@@ -352,116 +352,109 @@ plt.plot(UVpotVec, Offsets_v2,'o') ...@@ -352,116 +352,109 @@ plt.plot(UVpotVec, Offsets_v2,'o')
""" """
FIGURA PAPER FIGURA PAPER
""" """
import matplotlib
import seaborn as sns
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'
plt.style.use('seaborn-bright')
plt.rcParams.update({
"text.usetex": False,
})
jselected = [1, 5, 12] jselected = [1, 5, 12]
t0=0.18 t0=0.18
plt.figure()
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], SP_Heigths[jselected[0]])
plt.plot([r-t0 for r in RefBins[90:]], [expo(r, *popt_vec[jselected[0]]) for r in RefBins[90:]])
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], SP_Heigths[jselected[1]])
plt.plot([r-t0 for r in RefBins[90:]], [expo(r, *popt_vec[jselected[1]]) for r in RefBins[90:]])
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], SP_Heigths[jselected[2]])
plt.plot([r-t0 for r in RefBins[90:]], [expo(r, *popt_vec[jselected[2]]) for r in RefBins[90:]])
plt.xlim(-0.5,3)
plt.xlabel('Time (us)')
plt.ylabel('Counts')
s1 = 0
s2 = 700
s3 = 2*s2
kini = 75
colors=sns.color_palette("rocket", 10)
color3 = colors[0]
color2 = colors[3]
color1 = colors[8]
plt.figure(figsize=(3.5,3))
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], [s+s1 for s in SP_Heigths[jselected[0]]],color=color1,alpha=0.7)
plt.plot([r-t0 for r in RefBins[kini:]], [expo(r, *popt_vec[jselected[0]])+s1 for r in RefBins[kini:]],color=color1)
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], [s+s2 for s in SP_Heigths[jselected[1]]],color=color2,alpha=0.7)
plt.plot([r-t0 for r in RefBins[kini:]], [expo(r, *popt_vec[jselected[1]])+s2 for r in RefBins[kini:]],color=color2)
plt.plot([f*1e6-t0 for f in SP_Bins[jselected[0]][:-1]], [s+s3 for s in SP_Heigths[jselected[2]]],color=color3,alpha=0.7)
plt.plot([r-t0 for r in RefBins[kini:]], [expo(r, *popt_vec[jselected[2]])+s3 for r in RefBins[kini:]],color=color3)
plt.xlim(-0.3,2)
plt.xlabel('Time (us)', fontname='STIXGeneral', fontsize=14)
plt.ylabel('Counts', fontname='STIXGeneral', fontsize=14)
plt.xticks([0, 0.5, 1, 1.5, 2], fontsize=12)
plt.yticks([0, 1000, 2000, 3000, 4000], fontsize=12)
plt.grid()
plt.savefig('fig3_01.pdf') plt.savefig('fig3_01.pdf')
plt.savefig('fig3_01.svg') plt.savefig('fig3_01.svg')
#%% #%%
""" """
Defino los vectores de las mediciones largas para obtener branching fractions, 25 M de mediciones VEMOS UNA DP CON POTENCIA ALTA A VER SI DA LO QUE TIENE QUE DAR EL ANCHO DE LINEA
""" """
#Bins_long = [t*1e6 for t in Long_Bins[0][:-1]] BinsIRhigh = [t*1e6 for t in DP_Bins[-1][:-1]]
Bins_long = [t*1e6 for t in Long_Bins[-1][:-1]] HeightsIRhigh = DP_Heigths[-1]
#DP_long_raw = Long_Heigths[3] #la 0 y la 2 salieron mal pero las dejo por las dudas. uso la 3
#SP_long_raw = Long_Heigths[1]
DP_long_raw = Long_Heigths[-2] #la 0 y la 2 salieron mal pero las dejo por las dudas. uso la 3
SP_long_raw = Long_Heigths[-1]
DP_bkg_long_raw = Calib_Heigths[2] #calibracion del DP, esta al final ni la uso
SP_bkg_long_raw = Calib_Heigths[3] #calibracion del SP
from scipy.optimize import curve_fit
#Genero el vector de background para el SP def expo(T, tau, N0, C, T0):
BackgroundVectorLong = SP_Bkgr_builder(np.mean(SP_long_raw[0:50]),np.mean(SP_long_raw[-50:]),59,67,965) return N0*np.exp(-(T-T0)/tau) + C
SP_long_corrected = [SP_long_raw[k]-BackgroundVectorLong[k] for k in range(len(SP_long_raw))] popt_IR, pcov_IR = curve_fit(expo, BinsIRhigh[int(0.1*len(BinsIRhigh)):], HeightsIRhigh[int(0.1*len(BinsIRhigh)):], p0=(5, 100, 200, 1))
DP_long_corrected = [DP_long_raw[k]-np.mean(DP_long_raw[-100:]) for k in range(len(DP_long_raw))]
plt.figure() plt.figure()
plt.plot(SP_long_raw) plt.plot(BinsIRhigh, HeightsIRhigh)
plt.plot(BackgroundVectorLong,'o') plt.plot(BinsIRhigh, [expo(r, *popt_IR) for r in BinsIRhigh])
plt.xlim(0,100)
#%%
""" tauIR = popt_IR[0]
Ploteo las mediciones largas print(tauIR)
"""
plt.figure()
plt.plot(Bins_long, SP_long_corrected)
plt.plot([b+0.25 for b in Bins_long], DP_long_corrected)
plt.grid()
#plt.xlim(0, 1.5)
#plt.ylim(-100,100)
stotal = np.sum(SP_long_corrected)
dtotal = np.sum(DP_long_corrected)
print(stotal/(dtotal+stotal))
#%% #%%
""" """
aca se plotea la SP con su curva de calibracion sin ion para restar VEMOS UNA SP CON POTENCIA ALTA A VER SI DA LO QUE TIENE QUE DAR EL ANCHO DE LINEA
"""
plt.figure()
#plt.plot(Bins_long, SP_long_raw)
plt.plot(Bins_long, SP_bkg_long_raw)
plt.xlim(-1, 2)
#%%
"""
Restamos el fondo a ambas curvas. A la DP le restamos un promedio de la curva con el ion
apagado porque en ningun momento esta prendido el UV
""" """
#Pruebo restar background directamente
#DP_long_subs = [DP_long_raw[j]-DP_bkg_long_raw[j] for j in range(len(DP_long_raw))]
DP_long_subs = [d-int(np.mean(DP_long_raw[-100:])) for d in DP_long_raw]
SP_long_subs = [SP_long_raw[j]-SP_bkg_long_raw[j] for j in range(len(SP_long_raw))]
stot = np.sum(SP_long_subs) # k=5
dtot = np.sum(DP_long_subs) # BinsUVhigh = [t*1e6 for t in Long_Bins[k][:-1]]
# HeightsUVhigh = Long_Heigths[k]
prob = stot/(stot+dtot)
eff_deteccion = dtot/25e6 k=-3
print(f'p={prob}')
print(f'Eff de deteccion: {eff_deteccion*100}')
#%%
plt.figure()
plt.plot(Bins_long, SP_long_subs)
plt.plot([b+0.25 for b in Bins_long[0:475]], DP_long_subs)
plt.xlim(-0.2, 2)
plt.grid()
#%%
plt.figure()
plt.plot(Random_Bins[0][:-1], Random_Heigths[0],'o')
BinsUVhigh = [t*1e6 for t in SP_Bins[k][:-1]]
HeightsUVhigh = SP_Heigths[k]
from scipy.optimize import curve_fit
def expo(T, tau, N0, C, T0):
return N0*np.exp(-(T-T0)/tau) + C
initi=0.10
popt_UV, pcov_UV = curve_fit(expo, BinsUVhigh[int(initi*len(BinsUVhigh)):], HeightsUVhigh[int(initi*len(BinsUVhigh)):], p0=(1, 1000, 1800, 1), bounds=((0,0,0,0),(20, 1e7, 1e5, 1e3)))
plt.figure()
plt.plot(BinsUVhigh, HeightsUVhigh)
plt.plot(BinsUVhigh, [expo(r, *popt_UV) for r in BinsUVhigh])
plt.plot(BinsUVhigh[int(initi*len(BinsUVhigh))], HeightsUVhigh[int(initi*len(BinsUVhigh))],'o',markersize=5)
#plt.ylim(-1000,20000)
tauUV = popt_UV[0]
print(tauUV)
......
This diff is collapsed.
...@@ -140,8 +140,8 @@ plt.ylabel('Event frequency', fontname='STIXGeneral') ...@@ -140,8 +140,8 @@ plt.ylabel('Event frequency', fontname='STIXGeneral')
name='fig01a' name='fig01a'
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.pdf') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.pdf')
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.svg') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.svg')
...@@ -173,8 +173,8 @@ plt.tight_layout() ...@@ -173,8 +173,8 @@ plt.tight_layout()
name='fig01b' name='fig01b'
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.pdf') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.pdf')
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.svg') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'_dump.svg')
......
...@@ -28,13 +28,18 @@ for cambio in [0]: # esto es para shiftear la potencia medida ...@@ -28,13 +28,18 @@ for cambio in [0]: # esto es para shiftear la potencia medida
color="#3949ab", color="#3949ab",
capsize=3) capsize=3)
ax2.errorbar([p/(np.pi*(rad**2)) for p in UVpotVec], Taus_v2, yerr=np.mean(1e6*errsSIM.stdval.values),
ax2.errorbar(potencias/(np.pi*(rad**2)), dataREAL.Tau*1e6, \
yerr = 1e6*errsSIM.stdval.values, \
fmt='.--', ms=6, lw=.5, \ fmt='.--', ms=6, lw=.5, \
color="#3949ab", color="#3949ab",
capsize=3, capsize=3)
label=f'r={rad}; cambio={cambio}')
# ax2.errorbar(potencias/(np.pi*(rad**2)), dataREAL.Tau*1e6, \
# yerr = 1e6*errsSIM.stdval.values, \
# fmt='.--', ms=6, lw=.5, \
# color="#3949ab",
# capsize=3,
# label=f'r={rad}; cambio={cambio}')
ax2.set_xlim([1.2e-4, 0.2e-1]) ax2.set_xlim([1.2e-4, 0.2e-1])
ax2.set_ylim([2e-1, 0.8e1]) ax2.set_ylim([2e-1, 0.8e1])
......
This diff is collapsed.
This diff is collapsed.
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