Commit ee19408c authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto
parents 52faf1af 38606496
...@@ -25,7 +25,7 @@ Calib_Files_IR = """000007808-IR_Saturation ...@@ -25,7 +25,7 @@ Calib_Files_IR = """000007808-IR_Saturation
000007830-IR_Saturation 000007830-IR_Saturation
000007831-IR_Saturation""" 000007831-IR_Saturation"""
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20220527_CPTvariandoB_barriendopotenciaIR/Data') #os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20220527_CPTvariandoB_barriendopotenciaIR/Data')
#carpeta pc nico labo escritorio: #carpeta pc nico labo escritorio:
#/home/nico/Documents/artiq_experiments/analisis/plots/20220527_CPTvariandoB_barriendopotenciaIR/Data #/home/nico/Documents/artiq_experiments/analisis/plots/20220527_CPTvariandoB_barriendopotenciaIR/Data
...@@ -265,12 +265,21 @@ if plotFreqFreq == True: ...@@ -265,12 +265,21 @@ if plotFreqFreq == True:
else: else:
#plt.errorbar([b*1e3 for b in Bvec], MaxsPotsExp/propor, xerr=1e3*MeanError/(2*np.pi)/c, yerr=yerr0/propor, color=colores[0], fmt="o", markersize=4, zorder=3, elinewidth=1) #plt.errorbar([b*1e3 for b in Bvec], MaxsPotsExp/propor, xerr=1e3*MeanError/(2*np.pi)/c, yerr=yerr0/propor, color=colores[0], fmt="o", markersize=4, zorder=3, elinewidth=1)
plt.errorbar([f*1e-6 for f in ConvertBfieldtoLarmor(np.array([b*1e0 for b in Bvec]))], [c*1e-12/((2*np.pi)**2) for c in ConvertToRabiSq(np.array(MaxsPotsExp)/propor, 2*np.pi*1.35e6)], xerr=1e-6*MeanError, yerr=(1e-12/((2*np.pi)**2))*ConvertToRabiSq(yerr0, 2*np.pi*1.35e6)/propor, color=colores[0], fmt="o", markersize=4, zorder=3, elinewidth=1) plt.errorbar([(4/5)*f*1e-6 for f in ConvertBfieldtoLarmor(np.array([b*1e0 for b in Bvec]))], [c*1e-12/((2*np.pi)**2) for c in ConvertToRabiSq(np.array(MaxsPotsExp)/propor, 2*np.pi*1.35e6)], xerr=(4/5)*1e-6*MeanError, yerr=(1e-12/((2*np.pi)**2))*ConvertToRabiSq(yerr0, 2*np.pi*1.35e6)/propor, color=colores[0], fmt="o", markersize=4, zorder=3, elinewidth=1)
plt.plot([f*1e-9 for f in ConvertBfieldtoLarmor(CamposVector2)], [r*1e-12/((2*np.pi)**2) for r in ConvertToRabiSq(RabiVector2,2*np.pi*1.35e6)], linestyle='dashed', linewidth=1., color='grey') #esto viene del threeLevel_2repumps_CPTPlotter.py de Figura CPT Teorica plt.plot([(4/5)*f*1e-9 for f in ConvertBfieldtoLarmor(CamposVector2)], [r*1e-12/((2*np.pi)**2) for r in ConvertToRabiSq(RabiVector2,2*np.pi*1.35e6)], linestyle='dashed', linewidth=1., color='grey') #esto viene del threeLevel_2repumps_CPTPlotter.py de Figura CPT Teorica
#plt.ylabel(r'Rabi Frequency Squared (MHz$^2$)', fontsize=12, fontname='STIXGeneral') #plt.ylabel(r'Rabi Frequency Squared (MHz$^2$)', fontsize=12, fontname='STIXGeneral')
#plt.plot([f*1e-9 for f in ConvertBfieldtoLarmor(CamposVector2)], [15*(r*1e-12/((2*np.pi)**2))/popt for r in ConvertToRabiSq(RabiVector2,2*np.pi*1.35e6)], linestyle='dashed', linewidth=1., color='grey') #esto viene del threeLevel_2repumps_CPTPlotter.py de Figura CPT Teorica #esto seria con pendiente 15 que seria lo que da la teoria con el factor de lande correspondiente
plt.ylabel(r'$\Omega_{\mathrm{DP}}^2$ (MHz$^2$)', fontsize=12, fontname='STIXGeneral') plt.ylabel(r'$\Omega_{\mathrm{DP}}^2$ (MHz$^2$)', fontsize=12, fontname='STIXGeneral')
popt, pcov = curve_fit(LinearFitPotvsB, [(4/5)*f*1e-9 for f in ConvertBfieldtoLarmor(CamposVector2)], [r*1e-12/((2*np.pi)**2) for r in ConvertToRabiSq(RabiVector2,2*np.pi*1.35e6)])
poptexp,pcovexp = curve_fit(LinearFitPotvsB, [(4/5)*f*1e-6 for f in ConvertBfieldtoLarmor(np.array([b*1e0 for b in Bvec]))], [c*1e-12/((2*np.pi)**2) for c in ConvertToRabiSq(np.array(MaxsPotsExp)/propor, 2*np.pi*1.35e6)])
print(popt)
print(poptexp)
# plt.plot([f*1e-6 for f in ConvertBfieldtoLarmor(np.array([b*1e3 for b in Bvec]))], MaxsPotsExp,"o", color=colores[0], markersize=4, zorder=3) # plt.plot([f*1e-6 for f in ConvertBfieldtoLarmor(np.array([b*1e3 for b in Bvec]))], MaxsPotsExp,"o", color=colores[0], markersize=4, zorder=3)
# plt.ylim(0,80) # plt.ylim(0,80)
# plt.xlim(0,270) # plt.xlim(0,270)
...@@ -278,17 +287,21 @@ else: ...@@ -278,17 +287,21 @@ else:
plt.xlabel('Larmor Frequency (MHz)', fontsize=12, fontname='STIXGeneral') plt.xlabel(r'$\delta/2\pi $ (MHz)', fontsize=12, fontname='STIXGeneral')
plt.xlim(0,0.27) plt.xlim(0,(4/5)*0.27)
plt.xticks([0, 0.05, 0.1, 0.15, 0.2, 0.25], fontsize=12,fontname='STIXGeneral') plt.xticks([0, 0.05, 0.1, 0.15, 0.2], fontsize=12,fontname='STIXGeneral')
plt.yticks([0, 1, 2, 3, 4], fontsize=12,fontname='STIXGeneral') plt.yticks([0, 1, 2, 3, 4], fontsize=12,fontname='STIXGeneral')
plt.ylim(0,4.1) plt.ylim(0,4.1)
plt.grid() plt.grid()
plt.tight_layout() plt.tight_layout()
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Work/2022 B vs k race/Figuras/Figuras jpg trabajadas/umbralvsB_exp.png',dpi=500) #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Work/2022 B vs k race/Figuras/Figuras jpg trabajadas/umbralvsB_exp.png',dpi=500)
<<<<<<< HEAD
plt.savefig('C:/Users/nicon/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2b_v3.pdf')
=======
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2b_v2.pdf') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2b_v2.pdf')
>>>>>>> 9bb069aa4136dbc31f68a3cd69a81195df2f5649
...@@ -297,6 +310,9 @@ plt.tight_layout() ...@@ -297,6 +310,9 @@ plt.tight_layout()
Figura 2a) del paper. Curvas de fluorescencia vs potencia del IR Figura 2a) del paper. Curvas de fluorescencia vs potencia del IR
''' '''
'''
Este es el modelo viejo que ajusta super lindo, lo dejo por las dudas
'''
from scipy.signal import savgol_filter as sf from scipy.signal import savgol_filter as sf
...@@ -383,6 +399,66 @@ plt.yticks([0,1,2,3], fontsize=12, fontname='STIXGeneral') ...@@ -383,6 +399,66 @@ plt.yticks([0,1,2,3], fontsize=12, fontname='STIXGeneral')
plt.ylim(0,3.7) plt.ylim(0,3.7)
#plt.xlim(0,2.3) #plt.xlim(0,2.3)
plt.tight_layout() plt.tight_layout()
<<<<<<< HEAD
#plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1)
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2a_v2.pdf')
#%%
'''
Figura 2a) del paper. Curvas de fluorescencia vs potencia del IR
'''
'''
Este es el modelo NUEVO de ceci, veremos que onda
'''
from scipy.signal import savgol_filter as sf
# FluoSel = IR_fluorescence_vec[0][1:]
# PotsSel = PotenciasIR[1:]
# popt, pcov = curve_fit(FuncTest, PotsSel, FluoSel,p0=(1000,500,0,100,0))
def find_nearest(array, value):
array = np.asarray(array)
idx = (np.abs(array - value)).argmin()
return idx
from scipy.signal import savgol_filter as sf
import seaborn as sns
plt.style.use('seaborn-ticks')
colors=sns.color_palette("rocket", 10)
colorsselected=[colors[0],colors[3],colors[5],colors[8]]
FluovsBshort = []
#jselected = [0, 1, 4, 8]
jselected = [8, 2, 1, 0]
Bcampos = [b*1e3 for b in Bvec]
Bfields = [Bcampos[6], Bcampos[2], Bcampos[1], Bcampos[0]]
for j in jselected:
FluovsBshort.append(IR_fluorescence_vec[j])
#bkgr2 = np.min([FluovsBshort[0][1],FluovsBshort[1][1],FluovsBshort[2][1],FluovsBshort[3][1]])
#bkgrposta = np.min()
PotenciasMaximos_parcial = MaxsPotsExp/propor
PotenciasMaximos = [PotenciasMaximos_parcial[6],PotenciasMaximos_parcial[2],PotenciasMaximos_parcial[1],PotenciasMaximos_parcial[0]]
def FuncTest(rsq, A, det, delta, gs, gd):
c=1
gt = gs + gd
return A*((gd/gt)*((gt*gt+4*det*det+(8/3)*delta*delta)/(c*rsq))+1.5*c*rsq/(delta*delta) + 4*gs/gt)**(-1)
=======
plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1) plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1)
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2a_v2.pdf') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2a_v2.pdf')
...@@ -439,6 +515,7 @@ def FuncTest(rsq, A, det, delta, g): ...@@ -439,6 +515,7 @@ def FuncTest(rsq, A, det, delta, g):
return A*(((0.25*g*g+det*det+(2/3)*delta*delta)/(c*rsq))+6*c*rsq/(delta*delta))**(-1) return A*(((0.25*g*g+det*det+(2/3)*delta*delta)/(c*rsq))+6*c*rsq/(delta*delta))**(-1)
>>>>>>> 9bb069aa4136dbc31f68a3cd69a81195df2f5649
smoothen_order = [3,3,3,1] smoothen_order = [3,3,3,1]
err = [2,1,1,1] err = [2,1,1,1]
orden=5 orden=5
...@@ -446,6 +523,18 @@ plt.figure(figsize=(3.5, 3)) ...@@ -446,6 +523,18 @@ plt.figure(figsize=(3.5, 3))
for j in range(len(jselected)): for j in range(len(jselected)):
print(j) print(j)
rawcuentas = [f-bkgr for f in FluovsBshort[j]] rawcuentas = [f-bkgr for f in FluovsBshort[j]]
<<<<<<< HEAD
#cuentas = np.array(rawcuentas[0:3]+list(sf(rawcuentas[3:],7,3))) #este va bien
cuentas = np.array(rawcuentas[0:3]+list(sf(rawcuentas[3:],13,smoothen_order[j]))) #este va bien
#maximumfluo_index = np.array(cuentas[1:-1]).argmax()
maximumfluo_index = find_nearest(PotenciasIR[1:-1]/propor, PotenciasMaximos[j])
popt, pcov = curve_fit(FuncTest, PotenciasIR[1:-1]/propor, cuentas[1:-1]/1000, p0=(1e5,1.5,1e-2,2*np.pi*21,2*np.pi*1), bounds=((2e2,0,0,2*np.pi*20.5,2*np.pi*1),(2e7,10,1e8,2*np.pi*21.5,2*np.pi*1.1)))
#print(popt)
print(popt[1])
print(popt[2]/(2*np.pi))
=======
if j==0: if j==0:
print('tukson') print('tukson')
...@@ -462,6 +551,7 @@ for j in range(len(jselected)): ...@@ -462,6 +551,7 @@ for j in range(len(jselected)):
popt, pcov = curve_fit(FuncTest, PotenciasIR[1:-1]/propor, cuentas[1:-1]/1000, p0=(1e5,1.5,1e-2,3.5e2), bounds=((7e4,1.49,0,3.5e2),(2e5,1.51,1e6,3.501e2))) popt, pcov = curve_fit(FuncTest, PotenciasIR[1:-1]/propor, cuentas[1:-1]/1000, p0=(1e5,1.5,1e-2,3.5e2), bounds=((7e4,1.49,0,3.5e2),(2e5,1.51,1e6,3.501e2)))
print(popt) print(popt)
>>>>>>> 9bb069aa4136dbc31f68a3cd69a81195df2f5649
#[r*1e-12 for r in ConvertToRabiSq( ,2*np.pi*1.35e6)] #[r*1e-12 for r in ConvertToRabiSq( ,2*np.pi*1.35e6)]
#PotsLong = np.arange(0*np.min(PotenciasIR[1:-1]/propor), np.max(PotenciasIR[1:-1]/propor),0.01) #PotsLong = np.arange(0*np.min(PotenciasIR[1:-1]/propor), np.max(PotenciasIR[1:-1]/propor),0.01)
PotsLong = np.arange(0*np.min(PotenciasIR[1:-1]/propor), np.max(PotenciasIR[1:-1]/propor),0.01) PotsLong = np.arange(0*np.min(PotenciasIR[1:-1]/propor), np.max(PotenciasIR[1:-1]/propor),0.01)
...@@ -471,6 +561,12 @@ for j in range(len(jselected)): ...@@ -471,6 +561,12 @@ for j in range(len(jselected)):
plt.vlines(x=((2*np.pi*1.35e6)**2)*(1e-12/(propor*(((2*np.pi)**2))))*PotenciasIR[1:-1][maximumfluo_index],ymin=0.2,ymax=cuentas[1:-1][maximumfluo_index]/1000,color=colorsselected[j],zorder=1,linewidth=1, linestyle='dotted') plt.vlines(x=((2*np.pi*1.35e6)**2)*(1e-12/(propor*(((2*np.pi)**2))))*PotenciasIR[1:-1][maximumfluo_index],ymin=0.2,ymax=cuentas[1:-1][maximumfluo_index]/1000,color=colorsselected[j],zorder=1,linewidth=1, linestyle='dotted')
plt.fill_between([(r/((2*np.pi)**2))*1e-12 for r in ConvertToRabiSq(PotenciasIR[1:-1]/propor,2*np.pi*1.35e6)], (cuentas[1:-1]-1*np.sqrt(cuentas)[1:-1])/1000, (cuentas[1:-1]+1*np.sqrt(cuentas)[1:-1])/1000, color=colorsselected[j], alpha=0.3, zorder=orden) plt.fill_between([(r/((2*np.pi)**2))*1e-12 for r in ConvertToRabiSq(PotenciasIR[1:-1]/propor,2*np.pi*1.35e6)], (cuentas[1:-1]-1*np.sqrt(cuentas)[1:-1])/1000, (cuentas[1:-1]+1*np.sqrt(cuentas)[1:-1])/1000, color=colorsselected[j], alpha=0.3, zorder=orden)
orden=orden-1 orden=orden-1
<<<<<<< HEAD
#plt.errorbar(PotenciasIR, cuentas, yerr=1*np.sqrt(cuentas), color='r', fmt='o', capsize=2, markersize=4)
#plt.xlim(0, 90)
#plt.ylim(-100,3500)
=======
#plt.xlim(0,2) #plt.xlim(0,2)
#plt.errorbar(PotenciasIR, cuentas, yerr=1*np.sqrt(cuentas), color='r', fmt='o', capsize=2, markersize=4) #plt.errorbar(PotenciasIR, cuentas, yerr=1*np.sqrt(cuentas), color='r', fmt='o', capsize=2, markersize=4)
#plt.xlim(0, 90) #plt.xlim(0, 90)
...@@ -612,7 +708,25 @@ plt.tight_layout() ...@@ -612,7 +708,25 @@ plt.tight_layout()
plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1) plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1)
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/allcurves.pdf') plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/allcurves.pdf')
>>>>>>> 9bb069aa4136dbc31f68a3cd69a81195df2f5649
#for pot in MaxsPotsExp/propor:
# plt.axvline(pot)
plt.grid()
plt.xlabel(r'$\Omega_{\mathrm{DP}}^2$ (MHz$^2$)', fontsize=12, fontname='STIXGeneral')
#plt.xlabel(r'$\Gamma$', fontsize=12, fontname='STIXGeneral')
plt.ylabel('Fluorescence (kcounts/s)', fontsize=12, fontname='STIXGeneral')
plt.xticks([0, 1, 2, 3, 4], fontsize=12, fontname='STIXGeneral')
plt.yticks([0,1,2,3], fontsize=12, fontname='STIXGeneral')
plt.ylim(0,3.7)
#plt.xlim(0,2.3)
plt.tight_layout()
#plt.legend(loc='upper left', frameon=True, fontsize=7.6, handletextpad=0.1)
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2a_v3.pdf')
plt.savefig('C:/Users/nicon/Nextcloud/G_liaf/Publicaciones/Papers/2022 B vs K eigenbasis/Figuras_finales/Finalesfinales/Fig2a_v3.pdf')
......
...@@ -260,6 +260,57 @@ plt.xlabel('Detuning (MHz)') ...@@ -260,6 +260,57 @@ plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts') plt.ylabel('Counts')
plt.grid() plt.grid()
#%%
"""
Ahora repito el fit pero con un super ajuste
"""
FreqsDR = Freqs[10]
CountsDR = Counts[10]
def FitEIT_MM_SA(Freqs, offset, DetDoppler, SG, SP, SCALE1, SCALE2, OFFSET, BETA1, BETA2, TEMP, U, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, U, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, U, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 + OFFSET for f in Fluorescence2])
if plot:
return ScaledFluo1+ScaledFluo2, Detunings
else:
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
popt_SA, pcov_SA = curve_fit(FitEIT_MM_SA, FreqsDR, CountsDR, p0=[425, -13, 0.9, 7.5, 4e3, 5e3, 2500, 3.8, 0.8, 0.2e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 1500, 0,0, 0, 28e6), (1000, 0, 2, 20, 5e6, 5e6, 6000, 10, 10,20e-3,40e6)))
FittedEITpi_short_SA, Detunings_short_SA = FitEIT_MM_SA(FreqsDR, *popt_SA, plot=True)
freqslong = np.arange(1*min(FreqsDR), 1*max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_long_SA, Detunings_long_SA = FitEIT_MM_SA(freqslong, *popt_SA, plot=True)
plt.figure()
plt.errorbar(Detunings_short_SA, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_long_SA, FittedEITpi_long_SA, color='darkolivegreen', linewidth=3)
plt.title('2 ion model')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.xlim(-100,100)
#plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%% #%%
""" """
Vemos la contribucion de cada ion Vemos la contribucion de cada ion
......
...@@ -105,7 +105,7 @@ plt.xlim(-0.1, 5) ...@@ -105,7 +105,7 @@ plt.xlim(-0.1, 5)
#%% #%%
laser_UV_amp=0.1
allamps = np.array([]) allamps = np.array([])
allpows = np.array([]) allpows = np.array([])
alltaus = np.array([]) alltaus = np.array([])
......
...@@ -7,7 +7,7 @@ import ast ...@@ -7,7 +7,7 @@ import ast
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import os 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, 84840, 88040] 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]
...@@ -19,6 +19,7 @@ Calib_files = ['Cal_DP_5M', 'Cal_SP_5M', 'Cal_DP_25M', 'Cal_SP_25M'] ...@@ -19,6 +19,7 @@ Calib_files = ['Cal_DP_5M', 'Cal_SP_5M', 'Cal_DP_25M', 'Cal_SP_25M']
Random_files = [8749] Random_files = [8749]
def expo(T, tau, N0, C): def expo(T, tau, N0, C):
global T0 global T0
return N0*np.exp(-(T-T0)/tau) + C return N0*np.exp(-(T-T0)/tau) + C
...@@ -184,7 +185,8 @@ from scipy.optimize import curve_fit ...@@ -184,7 +185,8 @@ from scipy.optimize import curve_fit
RefBins = [t*1e6 for t in SP_Bins[0][:-1]] RefBins = [t*1e6 for t in SP_Bins[0][:-1]]
plt.figure() plt.figure()
for Height in SP_Heigths: for Height in SP_Heigths[:-1]:
print(len(Height))
plt.plot(RefBins, Height) plt.plot(RefBins, Height)
plt.xlim(-0.2, 3) plt.xlim(-0.2, 3)
...@@ -234,6 +236,10 @@ for j in range(len(SP_Heigths)-1): ...@@ -234,6 +236,10 @@ for j in range(len(SP_Heigths)-1):
ErrorTaus.append(np.sqrt(pcov)[0][0]) ErrorTaus.append(np.sqrt(pcov)[0][0])
#%% #%%
"""
TESIS
"""
plt.figure() plt.figure()
plt.plot(UVpotVec[:-5], Taus[:-6],'o', markersize=10, color='purple') plt.plot(UVpotVec[:-5], Taus[:-6],'o', markersize=10, color='purple')
#plt.errorbar(UVpotVec[:-5], Taus[:-6], yerr=1e1*np.array(ErrorTaus[:-6]), fmt='.', capsize=2, markersize=2) #plt.errorbar(UVpotVec[:-5], Taus[:-6], yerr=1e1*np.array(ErrorTaus[:-6]), fmt='.', capsize=2, markersize=2)
...@@ -245,12 +251,12 @@ plt.grid() ...@@ -245,12 +251,12 @@ plt.grid()
#%% #%%
plt.figure() plt.figure()
plt.plot(UVpotVec, Amps,'o') plt.plot(UVpotVec, Amps[:-1],'o')
plt.xlabel('UV power (mW)') plt.xlabel('UV power (mW)')
plt.ylabel('Characteristic time (us)') plt.ylabel('Characteristic time (us)')
plt.figure() plt.figure()
plt.plot(UVpotVec, Offsets,'o') plt.plot(UVpotVec, Offsets[:-1],'o')
#%% #%%
...@@ -361,6 +367,10 @@ plt.figure() ...@@ -361,6 +367,10 @@ plt.figure()
plt.plot(UVpotVec, Offsets_v2,'o') plt.plot(UVpotVec, Offsets_v2,'o')
#%% #%%
"""
TESIS
"""
""" """
FIGURA PAPER FIGURA PAPER
""" """
...@@ -409,7 +419,7 @@ plt.savefig('fig3_01.pdf') ...@@ -409,7 +419,7 @@ plt.savefig('fig3_01.pdf')
plt.savefig('fig3_01.svg') plt.savefig('fig3_01.svg')
#%% #%%
""" """
VEMOS UNA DP CON POTENCIA ALTA A VER SI DA LO QUE TIENE QUE DAR EL ANCHO DE LINEA VEMOS UNA DP CON POTENCIA ALTA A VER SI DA LO QUE TIENE QUE DAR EL ANCHO DE LINEA
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work> <cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2023-04-27T16:04:44.519667</dc:date> <dc:date>2023-10-03T15:31:08.257400</dc:date>
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:creator> <dc:creator>
<cc:Agent> <cc:Agent>
<dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title> <dc:title>Matplotlib v3.7.0, https://matplotlib.org/</dc:title>
</cc:Agent> </cc:Agent>
</dc:creator> </dc:creator>
</cc:Work> </cc:Work>
...@@ -42,21 +42,21 @@ z ...@@ -42,21 +42,21 @@ z
<g id="line2d_1"> <g id="line2d_1">
<path d="M 56.973913 189 <path d="M 56.973913 189
L 56.973913 25.92 L 56.973913 25.92
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_2"> <g id="line2d_2">
<defs> <defs>
<path id="m974d739213" d="M 0 0 <path id="mdfec4f4c2e" d="M 0 0
L 0 3.5 L 0 3.5
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m974d739213" x="56.973913" y="189" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mdfec4f4c2e" x="56.973913" y="189" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_1"> <g id="text_1">
<!-- 0.0 --> <!-- 0.0 -->
<g transform="translate(49.473913 204.195625)scale(0.12 -0.12)"> <g transform="translate(49.473913 204.195625) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-30" d="M 3046 2112 <path id="STIXGeneral-Regular-30" d="M 3046 2112
Q 3046 1683 2963 1302 Q 3046 1683 2963 1302
...@@ -106,16 +106,16 @@ z ...@@ -106,16 +106,16 @@ z
<g id="line2d_3"> <g id="line2d_3">
<path d="M 99.430435 189 <path d="M 99.430435 189
L 99.430435 25.92 L 99.430435 25.92
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_4"> <g id="line2d_4">
<g> <g>
<use xlink:href="#m974d739213" x="99.430435" y="189" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mdfec4f4c2e" x="99.430435" y="189" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_2"> <g id="text_2">
<!-- 0.5 --> <!-- 0.5 -->
<g transform="translate(91.930435 204.195625)scale(0.12 -0.12)"> <g transform="translate(91.930435 204.195625) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-35" d="M 2803 4358 <path id="STIXGeneral-Regular-35" d="M 2803 4358
L 2573 3814 L 2573 3814
...@@ -157,16 +157,16 @@ z ...@@ -157,16 +157,16 @@ z
<g id="line2d_5"> <g id="line2d_5">
<path d="M 141.886957 189 <path d="M 141.886957 189
L 141.886957 25.92 L 141.886957 25.92
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_6"> <g id="line2d_6">
<g> <g>
<use xlink:href="#m974d739213" x="141.886957" y="189" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mdfec4f4c2e" x="141.886957" y="189" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_3"> <g id="text_3">
<!-- 1.0 --> <!-- 1.0 -->
<g transform="translate(134.386957 204.195625)scale(0.12 -0.12)"> <g transform="translate(134.386957 204.195625) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-31" d="M 2522 0 <path id="STIXGeneral-Regular-31" d="M 2522 0
L 755 0 L 755 0
...@@ -197,16 +197,16 @@ z ...@@ -197,16 +197,16 @@ z
<g id="line2d_7"> <g id="line2d_7">
<path d="M 184.343478 189 <path d="M 184.343478 189
L 184.343478 25.92 L 184.343478 25.92
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_8"> <g id="line2d_8">
<g> <g>
<use xlink:href="#m974d739213" x="184.343478" y="189" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mdfec4f4c2e" x="184.343478" y="189" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_4"> <g id="text_4">
<!-- 1.5 --> <!-- 1.5 -->
<g transform="translate(176.843478 204.195625)scale(0.12 -0.12)"> <g transform="translate(176.843478 204.195625) scale(0.12 -0.12)">
<use xlink:href="#STIXGeneral-Regular-31"/> <use xlink:href="#STIXGeneral-Regular-31"/>
<use xlink:href="#STIXGeneral-Regular-2e" x="49.999985"/> <use xlink:href="#STIXGeneral-Regular-2e" x="49.999985"/>
<use xlink:href="#STIXGeneral-Regular-35" x="74.999969"/> <use xlink:href="#STIXGeneral-Regular-35" x="74.999969"/>
...@@ -217,16 +217,16 @@ L 184.343478 25.92 ...@@ -217,16 +217,16 @@ L 184.343478 25.92
<g id="line2d_9"> <g id="line2d_9">
<path d="M 226.8 189 <path d="M 226.8 189
L 226.8 25.92 L 226.8 25.92
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_10"> <g id="line2d_10">
<g> <g>
<use xlink:href="#m974d739213" x="226.8" y="189" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#mdfec4f4c2e" x="226.8" y="189" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_5"> <g id="text_5">
<!-- 2.0 --> <!-- 2.0 -->
<g transform="translate(219.3 204.195625)scale(0.12 -0.12)"> <g transform="translate(219.3 204.195625) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-32" d="M 3034 877 <path id="STIXGeneral-Regular-32" d="M 3034 877
L 2688 0 L 2688 0
...@@ -261,7 +261,7 @@ z ...@@ -261,7 +261,7 @@ z
</g> </g>
<g id="text_6"> <g id="text_6">
<!-- Time (us) --> <!-- Time (us) -->
<g transform="translate(101.738438 220.361562)scale(0.14 -0.14)"> <g transform="translate(101.738438 220.361562) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Regular-54" d="M 3795 3149 <path id="STIXGeneral-Regular-54" d="M 3795 3149
L 3642 3149 L 3642 3149
...@@ -499,21 +499,21 @@ z ...@@ -499,21 +499,21 @@ z
<g id="line2d_11"> <g id="line2d_11">
<path d="M 31.5 184.358386 <path d="M 31.5 184.358386
L 226.8 184.358386 L 226.8 184.358386
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_12"> <g id="line2d_12">
<defs> <defs>
<path id="m16703b3497" d="M 0 0 <path id="ma7230096af" d="M 0 0
L -3.5 0 L -3.5 0
" style="stroke: #000000; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m16703b3497" x="31.5" y="184.358386" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#ma7230096af" x="31.5" y="184.358386" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_7"> <g id="text_7">
<!-- 0 --> <!-- 0 -->
<g transform="translate(18.5 188.456198)scale(0.12 -0.12)"> <g transform="translate(18.5 188.456198) scale(0.12 -0.12)">
<use xlink:href="#STIXGeneral-Regular-30"/> <use xlink:href="#STIXGeneral-Regular-30"/>
</g> </g>
</g> </g>
...@@ -522,16 +522,16 @@ L -3.5 0 ...@@ -522,16 +522,16 @@ L -3.5 0
<g id="line2d_13"> <g id="line2d_13">
<path d="M 31.5 149.719473 <path d="M 31.5 149.719473
L 226.8 149.719473 L 226.8 149.719473
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_14"> <g id="line2d_14">
<g> <g>
<use xlink:href="#m16703b3497" x="31.5" y="149.719473" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#ma7230096af" x="31.5" y="149.719473" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_8"> <g id="text_8">
<!-- 1000 --> <!-- 1000 -->
<g transform="translate(0.5 153.817286)scale(0.12 -0.12)"> <g transform="translate(0.5 153.817286) scale(0.12 -0.12)">
<use xlink:href="#STIXGeneral-Regular-31"/> <use xlink:href="#STIXGeneral-Regular-31"/>
<use xlink:href="#STIXGeneral-Regular-30" x="49.999985"/> <use xlink:href="#STIXGeneral-Regular-30" x="49.999985"/>
<use xlink:href="#STIXGeneral-Regular-30" x="99.999969"/> <use xlink:href="#STIXGeneral-Regular-30" x="99.999969"/>
...@@ -543,16 +543,16 @@ L 226.8 149.719473 ...@@ -543,16 +543,16 @@ L 226.8 149.719473
<g id="line2d_15"> <g id="line2d_15">
<path d="M 31.5 115.080561 <path d="M 31.5 115.080561
L 226.8 115.080561 L 226.8 115.080561
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_16"> <g id="line2d_16">
<g> <g>
<use xlink:href="#m16703b3497" x="31.5" y="115.080561" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#ma7230096af" x="31.5" y="115.080561" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_9"> <g id="text_9">
<!-- 2000 --> <!-- 2000 -->
<g transform="translate(0.5 119.178373)scale(0.12 -0.12)"> <g transform="translate(0.5 119.178373) scale(0.12 -0.12)">
<use xlink:href="#STIXGeneral-Regular-32"/> <use xlink:href="#STIXGeneral-Regular-32"/>
<use xlink:href="#STIXGeneral-Regular-30" x="49.999985"/> <use xlink:href="#STIXGeneral-Regular-30" x="49.999985"/>
<use xlink:href="#STIXGeneral-Regular-30" x="99.999969"/> <use xlink:href="#STIXGeneral-Regular-30" x="99.999969"/>
...@@ -564,16 +564,16 @@ L 226.8 115.080561 ...@@ -564,16 +564,16 @@ L 226.8 115.080561
<g id="line2d_17"> <g id="line2d_17">
<path d="M 31.5 80.441648 <path d="M 31.5 80.441648
L 226.8 80.441648 L 226.8 80.441648
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_18"> <g id="line2d_18">
<g> <g>
<use xlink:href="#m16703b3497" x="31.5" y="80.441648" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#ma7230096af" x="31.5" y="80.441648" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_10"> <g id="text_10">
<!-- 3000 --> <!-- 3000 -->
<g transform="translate(0.5 84.539461)scale(0.12 -0.12)"> <g transform="translate(0.5 84.539461) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-33" d="M 390 3264 <path id="STIXGeneral-Regular-33" d="M 390 3264
L 288 3290 L 288 3290
...@@ -616,16 +616,16 @@ z ...@@ -616,16 +616,16 @@ z
<g id="line2d_19"> <g id="line2d_19">
<path d="M 31.5 45.802736 <path d="M 31.5 45.802736
L 226.8 45.802736 L 226.8 45.802736
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #b0b0b0; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_20"> <g id="line2d_20">
<g> <g>
<use xlink:href="#m16703b3497" x="31.5" y="45.802736" style="stroke: #000000; stroke-width: 0.8"/> <use xlink:href="#ma7230096af" x="31.5" y="45.802736" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_11"> <g id="text_11">
<!-- 4000 --> <!-- 4000 -->
<g transform="translate(0.5 49.900548)scale(0.12 -0.12)"> <g transform="translate(0.5 49.900548) scale(0.12 -0.12)">
<defs> <defs>
<path id="STIXGeneral-Regular-34" d="M 3027 1069 <path id="STIXGeneral-Regular-34" d="M 3027 1069
L 2368 1069 L 2368 1069
...@@ -656,7 +656,7 @@ z ...@@ -656,7 +656,7 @@ z
</g> </g>
<g id="text_12"> <g id="text_12">
<!-- Counts --> <!-- Counts -->
<g transform="translate(-6.538438 127.298437)rotate(-90)scale(0.14 -0.14)"> <g transform="translate(-6.538438 127.298437) rotate(-90) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Regular-43" d="M 3930 838 <path id="STIXGeneral-Regular-43" d="M 3930 838
L 4051 723 L 4051 723
...@@ -1042,7 +1042,7 @@ L 251.849348 175.248352 ...@@ -1042,7 +1042,7 @@ L 251.849348 175.248352
L 252.698478 176.148963 L 252.698478 176.148963
L 253 176.259664 L 253 176.259664
L 253 176.259664 L 253 176.259664
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #f6a47c; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #f6a47c; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_22"> <g id="line2d_22">
<path d="M 71.918609 162.714169 <path d="M 71.918609 162.714169
...@@ -1055,7 +1055,7 @@ L 184.852957 172.649954 ...@@ -1055,7 +1055,7 @@ L 184.852957 172.649954
L 208.628609 173.902326 L 208.628609 173.902326
L 232.404261 174.959443 L 232.404261 174.959443
L 232.404261 174.959443 L 232.404261 174.959443
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #f6a47c; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #f6a47c; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_23"> <g id="line2d_23">
<path d="M 8.148913 155.746644 <path d="M 8.148913 155.746644
...@@ -1323,7 +1323,7 @@ L 251.000217 154.60356 ...@@ -1323,7 +1323,7 @@ L 251.000217 154.60356
L 251.849348 155.365616 L 251.849348 155.365616
L 253 154.888449 L 253 154.888449
L 253 154.888449 L 253 154.888449
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #921c5b; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #921c5b; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_24"> <g id="line2d_24">
<path d="M 71.918609 109.245793 <path d="M 71.918609 109.245793
...@@ -1352,7 +1352,7 @@ L 213.723391 154.014441 ...@@ -1352,7 +1352,7 @@ L 213.723391 154.014441
L 229.85687 154.602705 L 229.85687 154.602705
L 232.404261 154.67762 L 232.404261 154.67762
L 232.404261 154.67762 L 232.404261 154.67762
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #921c5b; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #921c5b; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_25"> <g id="line2d_25">
<path d="M 8.148913 132.365378 <path d="M 8.148913 132.365378
...@@ -1628,7 +1628,7 @@ L 251.849348 128.000875 ...@@ -1628,7 +1628,7 @@ L 251.849348 128.000875
L 252.698478 129.10932 L 252.698478 129.10932
L 253 128.998619 L 253 128.998619
L 253 128.998619 L 253 128.998619
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #221331; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #221331; stroke-opacity: 0.7; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_26"> <g id="line2d_26">
<path d="M 71.918609 64.400286 <path d="M 71.918609 64.400286
...@@ -1662,7 +1662,7 @@ L 200.137304 128.309615 ...@@ -1662,7 +1662,7 @@ L 200.137304 128.309615
L 223.912957 128.514556 L 223.912957 128.514556
L 232.404261 128.550962 L 232.404261 128.550962
L 232.404261 128.550962 L 232.404261 128.550962
" clip-path="url(#pe427f866f0)" style="fill: none; stroke: #221331; stroke-width: 1.5; stroke-linecap: square"/> " clip-path="url(#pe1701b7467)" style="fill: none; stroke: #221331; stroke-width: 1.5; stroke-linecap: square"/>
</g> </g>
<g id="patch_3"> <g id="patch_3">
<path d="M 31.5 189 <path d="M 31.5 189
...@@ -1687,7 +1687,7 @@ L 226.8 25.92 ...@@ -1687,7 +1687,7 @@ L 226.8 25.92
</g> </g>
</g> </g>
<defs> <defs>
<clipPath id="pe427f866f0"> <clipPath id="pe1701b7467">
<rect x="31.5" y="25.92" width="195.3" height="163.08"/> <rect x="31.5" y="25.92" width="195.3" height="163.08"/>
</clipPath> </clipPath>
</defs> </defs>
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:Work> <cc:Work>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:date>2022-11-24T14:39:52.041749</dc:date> <dc:date>2023-10-03T20:00:16.203992</dc:date>
<dc:format>image/svg+xml</dc:format> <dc:format>image/svg+xml</dc:format>
<dc:creator> <dc:creator>
<cc:Agent> <cc:Agent>
<dc:title>Matplotlib v3.5.1, https://matplotlib.org/</dc:title> <dc:title>Matplotlib v3.7.0, https://matplotlib.org/</dc:title>
</cc:Agent> </cc:Agent>
</dc:creator> </dc:creator>
</cc:Work> </cc:Work>
...@@ -41,17 +41,17 @@ z ...@@ -41,17 +41,17 @@ z
<g id="xtick_1"> <g id="xtick_1">
<g id="line2d_1"> <g id="line2d_1">
<defs> <defs>
<path id="m0775a2d433" d="M 0 0 <path id="m824781fd88" d="M 0 0
L 0 6 L 0 3.5
" style="stroke: #262626; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m0775a2d433" x="192.753873" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.8"/> <use xlink:href="#m824781fd88" x="192.753873" y="252" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_1"> <g id="text_1">
<!-- $\mathdefault{10^{-3}}$ --> <!-- $\mathdefault{10^{-3}}$ -->
<g style="fill: #262626" transform="translate(179.453873 271.061562)scale(0.14 -0.14)"> <g transform="translate(179.453873 268.561562) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Regular-31" d="M 2522 0 <path id="STIXGeneral-Regular-31" d="M 2522 0
L 755 0 L 755 0
...@@ -136,20 +136,20 @@ z ...@@ -136,20 +136,20 @@ z
</defs> </defs>
<use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-2212" transform="translate(101.574969 36.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-2212" transform="translate(101.574969 36.684375) scale(0.7)"/>
<use xlink:href="#STIXGeneral-Regular-33" transform="translate(149.524959 36.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-33" transform="translate(149.524959 36.684375) scale(0.7)"/>
</g> </g>
</g> </g>
</g> </g>
<g id="xtick_2"> <g id="xtick_2">
<g id="line2d_2"> <g id="line2d_2">
<g> <g>
<use xlink:href="#m0775a2d433" x="343.439197" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.8"/> <use xlink:href="#m824781fd88" x="343.439197" y="252" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_2"> <g id="text_2">
<!-- $\mathdefault{10^{-2}}$ --> <!-- $\mathdefault{10^{-2}}$ -->
<g style="fill: #262626" transform="translate(330.139197 271.061562)scale(0.14 -0.14)"> <g transform="translate(330.139197 268.561562) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Regular-32" d="M 3034 877 <path id="STIXGeneral-Regular-32" d="M 3034 877
L 2688 0 L 2688 0
...@@ -178,8 +178,8 @@ z ...@@ -178,8 +178,8 @@ z
</defs> </defs>
<use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-2212" transform="translate(101.574969 36.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-2212" transform="translate(101.574969 36.684375) scale(0.7)"/>
<use xlink:href="#STIXGeneral-Regular-32" transform="translate(149.524959 36.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-32" transform="translate(149.524959 36.684375) scale(0.7)"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -187,16 +187,16 @@ z ...@@ -187,16 +187,16 @@ z
<g id="line2d_3"> <g id="line2d_3">
<path d="M 87.429351 252 <path d="M 87.429351 252
L 87.429351 34.56 L 87.429351 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_4"> <g id="line2d_4">
<defs> <defs>
<path id="m6ff2b0a9b4" d="M 0 0 <path id="me22c4e6fa0" d="M 0 0
L 0 3 L 0 2
" style="stroke: #262626; stroke-width: 0.6"/> " style="stroke: #000000; stroke-width: 0.6"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="87.429351" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="87.429351" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -204,11 +204,11 @@ L 0 3 ...@@ -204,11 +204,11 @@ L 0 3
<g id="line2d_5"> <g id="line2d_5">
<path d="M 113.963719 252 <path d="M 113.963719 252
L 113.963719 34.56 L 113.963719 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_6"> <g id="line2d_6">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="113.963719" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="113.963719" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -216,11 +216,11 @@ L 113.963719 34.56 ...@@ -216,11 +216,11 @@ L 113.963719 34.56
<g id="line2d_7"> <g id="line2d_7">
<path d="M 132.790153 252 <path d="M 132.790153 252
L 132.790153 34.56 L 132.790153 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_8"> <g id="line2d_8">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="132.790153" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="132.790153" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -228,11 +228,11 @@ L 132.790153 34.56 ...@@ -228,11 +228,11 @@ L 132.790153 34.56
<g id="line2d_9"> <g id="line2d_9">
<path d="M 147.39307 252 <path d="M 147.39307 252
L 147.39307 34.56 L 147.39307 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_10"> <g id="line2d_10">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="147.39307" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="147.39307" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -240,11 +240,11 @@ L 147.39307 34.56 ...@@ -240,11 +240,11 @@ L 147.39307 34.56
<g id="line2d_11"> <g id="line2d_11">
<path d="M 159.324522 252 <path d="M 159.324522 252
L 159.324522 34.56 L 159.324522 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_12"> <g id="line2d_12">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="159.324522" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="159.324522" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -252,11 +252,11 @@ L 159.324522 34.56 ...@@ -252,11 +252,11 @@ L 159.324522 34.56
<g id="line2d_13"> <g id="line2d_13">
<path d="M 169.412421 252 <path d="M 169.412421 252
L 169.412421 34.56 L 169.412421 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_14"> <g id="line2d_14">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="169.412421" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="169.412421" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -264,11 +264,11 @@ L 169.412421 34.56 ...@@ -264,11 +264,11 @@ L 169.412421 34.56
<g id="line2d_15"> <g id="line2d_15">
<path d="M 178.150956 252 <path d="M 178.150956 252
L 178.150956 34.56 L 178.150956 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_16"> <g id="line2d_16">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="178.150956" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="178.150956" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -276,11 +276,11 @@ L 178.150956 34.56 ...@@ -276,11 +276,11 @@ L 178.150956 34.56
<g id="line2d_17"> <g id="line2d_17">
<path d="M 185.858891 252 <path d="M 185.858891 252
L 185.858891 34.56 L 185.858891 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_18"> <g id="line2d_18">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="185.858891" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="185.858891" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -288,11 +288,11 @@ L 185.858891 34.56 ...@@ -288,11 +288,11 @@ L 185.858891 34.56
<g id="line2d_19"> <g id="line2d_19">
<path d="M 238.114675 252 <path d="M 238.114675 252
L 238.114675 34.56 L 238.114675 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_20"> <g id="line2d_20">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="238.114675" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="238.114675" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -300,11 +300,11 @@ L 238.114675 34.56 ...@@ -300,11 +300,11 @@ L 238.114675 34.56
<g id="line2d_21"> <g id="line2d_21">
<path d="M 264.649044 252 <path d="M 264.649044 252
L 264.649044 34.56 L 264.649044 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_22"> <g id="line2d_22">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="264.649044" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="264.649044" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -312,11 +312,11 @@ L 264.649044 34.56 ...@@ -312,11 +312,11 @@ L 264.649044 34.56
<g id="line2d_23"> <g id="line2d_23">
<path d="M 283.475478 252 <path d="M 283.475478 252
L 283.475478 34.56 L 283.475478 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_24"> <g id="line2d_24">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="283.475478" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="283.475478" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -324,11 +324,11 @@ L 283.475478 34.56 ...@@ -324,11 +324,11 @@ L 283.475478 34.56
<g id="line2d_25"> <g id="line2d_25">
<path d="M 298.078395 252 <path d="M 298.078395 252
L 298.078395 34.56 L 298.078395 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_26"> <g id="line2d_26">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="298.078395" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="298.078395" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -336,11 +336,11 @@ L 298.078395 34.56 ...@@ -336,11 +336,11 @@ L 298.078395 34.56
<g id="line2d_27"> <g id="line2d_27">
<path d="M 310.009847 252 <path d="M 310.009847 252
L 310.009847 34.56 L 310.009847 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_28"> <g id="line2d_28">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="310.009847" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="310.009847" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -348,11 +348,11 @@ L 310.009847 34.56 ...@@ -348,11 +348,11 @@ L 310.009847 34.56
<g id="line2d_29"> <g id="line2d_29">
<path d="M 320.097745 252 <path d="M 320.097745 252
L 320.097745 34.56 L 320.097745 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_30"> <g id="line2d_30">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="320.097745" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="320.097745" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -360,11 +360,11 @@ L 320.097745 34.56 ...@@ -360,11 +360,11 @@ L 320.097745 34.56
<g id="line2d_31"> <g id="line2d_31">
<path d="M 328.836281 252 <path d="M 328.836281 252
L 328.836281 34.56 L 328.836281 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_32"> <g id="line2d_32">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="328.836281" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="328.836281" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -372,11 +372,11 @@ L 328.836281 34.56 ...@@ -372,11 +372,11 @@ L 328.836281 34.56
<g id="line2d_33"> <g id="line2d_33">
<path d="M 336.544215 252 <path d="M 336.544215 252
L 336.544215 34.56 L 336.544215 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_34"> <g id="line2d_34">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="336.544215" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="336.544215" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -384,17 +384,17 @@ L 336.544215 34.56 ...@@ -384,17 +384,17 @@ L 336.544215 34.56
<g id="line2d_35"> <g id="line2d_35">
<path d="M 388.8 252 <path d="M 388.8 252
L 388.8 34.56 L 388.8 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_36"> <g id="line2d_36">
<g> <g>
<use xlink:href="#m6ff2b0a9b4" x="388.8" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#me22c4e6fa0" x="388.8" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
<g id="text_3"> <g id="text_3">
<!-- UV intensity ($\mu$W/$\mu$m$^2$) --> <!-- UV intensity ($\mu$W/$\mu$m$^2$) -->
<g style="fill: #262626" transform="translate(154.76 289.72)scale(0.14 -0.14)"> <g transform="translate(154.76 287.22) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Regular-55" d="M 4512 4237 <path id="STIXGeneral-Regular-55" d="M 4512 4237
L 4512 4115 L 4512 4115
...@@ -811,7 +811,7 @@ z ...@@ -811,7 +811,7 @@ z
<use xlink:href="#STIXGeneral-Regular-2f" transform="translate(719.199799 0.409375)"/> <use xlink:href="#STIXGeneral-Regular-2f" transform="translate(719.199799 0.409375)"/>
<use xlink:href="#STIXGeneral-Italic-3bc" transform="translate(746.999786 0.409375)"/> <use xlink:href="#STIXGeneral-Italic-3bc" transform="translate(746.999786 0.409375)"/>
<use xlink:href="#STIXGeneral-Regular-6d" transform="translate(799.599777 0.409375)"/> <use xlink:href="#STIXGeneral-Regular-6d" transform="translate(799.599777 0.409375)"/>
<use xlink:href="#STIXGeneral-Regular-32" transform="translate(878.943046 35.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-32" transform="translate(878.943046 35.684375) scale(0.7)"/>
<use xlink:href="#STIXGeneral-Regular-29" transform="translate(918.352411 0.409375)"/> <use xlink:href="#STIXGeneral-Regular-29" transform="translate(918.352411 0.409375)"/>
</g> </g>
</g> </g>
...@@ -820,20 +820,20 @@ z ...@@ -820,20 +820,20 @@ z
<g id="ytick_1"> <g id="ytick_1">
<g id="line2d_37"> <g id="line2d_37">
<defs> <defs>
<path id="mb1f45476b6" d="M 0 0 <path id="mf3c1070d02" d="M 0 0
L -6 0 L -3.5 0
" style="stroke: #262626; stroke-width: 0.8"/> " style="stroke: #000000; stroke-width: 0.8"/>
</defs> </defs>
<g> <g>
<use xlink:href="#mb1f45476b6" x="54" y="157.132118" style="fill: #262626; stroke: #262626; stroke-width: 0.8"/> <use xlink:href="#mf3c1070d02" x="54" y="157.132118" style="stroke: #000000; stroke-width: 0.8"/>
</g> </g>
</g> </g>
<g id="text_4"> <g id="text_4">
<!-- $\mathdefault{10^{0}}$ --> <!-- $\mathdefault{10^{0}}$ -->
<g style="fill: #262626" transform="translate(24.62 161.9129)scale(0.14 -0.14)"> <g transform="translate(27.12 161.9129) scale(0.14 -0.14)">
<use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-31" transform="translate(0 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/> <use xlink:href="#STIXGeneral-Regular-30" transform="translate(49.999985 0.684375)"/>
<use xlink:href="#STIXGeneral-Regular-30" transform="translate(101.574969 36.684375)scale(0.7)"/> <use xlink:href="#STIXGeneral-Regular-30" transform="translate(101.574969 36.684375) scale(0.7)"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -841,16 +841,16 @@ L -6 0 ...@@ -841,16 +841,16 @@ L -6 0
<g id="line2d_38"> <g id="line2d_38">
<path d="M 54 252 <path d="M 54 252
L 388.8 252 L 388.8 252
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_39"> <g id="line2d_39">
<defs> <defs>
<path id="m49da50041f" d="M 0 0 <path id="mc83fbb5aef" d="M 0 0
L -3 0 L -2 0
" style="stroke: #262626; stroke-width: 0.6"/> " style="stroke: #000000; stroke-width: 0.6"/>
</defs> </defs>
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="252" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="252" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -858,11 +858,11 @@ L -3 0 ...@@ -858,11 +858,11 @@ L -3 0
<g id="line2d_40"> <g id="line2d_40">
<path d="M 54 228.099969 <path d="M 54 228.099969
L 388.8 228.099969 L 388.8 228.099969
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_41"> <g id="line2d_41">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="228.099969" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="228.099969" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -870,11 +870,11 @@ L 388.8 228.099969 ...@@ -870,11 +870,11 @@ L 388.8 228.099969
<g id="line2d_42"> <g id="line2d_42">
<path d="M 54 211.142627 <path d="M 54 211.142627
L 388.8 211.142627 L 388.8 211.142627
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_43"> <g id="line2d_43">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="211.142627" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="211.142627" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -882,11 +882,11 @@ L 388.8 211.142627 ...@@ -882,11 +882,11 @@ L 388.8 211.142627
<g id="line2d_44"> <g id="line2d_44">
<path d="M 54 197.989491 <path d="M 54 197.989491
L 388.8 197.989491 L 388.8 197.989491
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_45"> <g id="line2d_45">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="197.989491" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="197.989491" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -894,11 +894,11 @@ L 388.8 197.989491 ...@@ -894,11 +894,11 @@ L 388.8 197.989491
<g id="line2d_46"> <g id="line2d_46">
<path d="M 54 187.242596 <path d="M 54 187.242596
L 388.8 187.242596 L 388.8 187.242596
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_47"> <g id="line2d_47">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="187.242596" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="187.242596" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -906,11 +906,11 @@ L 388.8 187.242596 ...@@ -906,11 +906,11 @@ L 388.8 187.242596
<g id="line2d_48"> <g id="line2d_48">
<path d="M 54 178.156226 <path d="M 54 178.156226
L 388.8 178.156226 L 388.8 178.156226
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_49"> <g id="line2d_49">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="178.156226" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="178.156226" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -918,11 +918,11 @@ L 388.8 178.156226 ...@@ -918,11 +918,11 @@ L 388.8 178.156226
<g id="line2d_50"> <g id="line2d_50">
<path d="M 54 170.285254 <path d="M 54 170.285254
L 388.8 170.285254 L 388.8 170.285254
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_51"> <g id="line2d_51">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="170.285254" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="170.285254" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -930,11 +930,11 @@ L 388.8 170.285254 ...@@ -930,11 +930,11 @@ L 388.8 170.285254
<g id="line2d_52"> <g id="line2d_52">
<path d="M 54 163.342565 <path d="M 54 163.342565
L 388.8 163.342565 L 388.8 163.342565
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_53"> <g id="line2d_53">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="163.342565" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="163.342565" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -942,11 +942,11 @@ L 388.8 163.342565 ...@@ -942,11 +942,11 @@ L 388.8 163.342565
<g id="line2d_54"> <g id="line2d_54">
<path d="M 54 116.274746 <path d="M 54 116.274746
L 388.8 116.274746 L 388.8 116.274746
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_55"> <g id="line2d_55">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="116.274746" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="116.274746" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -954,11 +954,11 @@ L 388.8 116.274746 ...@@ -954,11 +954,11 @@ L 388.8 116.274746
<g id="line2d_56"> <g id="line2d_56">
<path d="M 54 92.374715 <path d="M 54 92.374715
L 388.8 92.374715 L 388.8 92.374715
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_57"> <g id="line2d_57">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="92.374715" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="92.374715" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -966,11 +966,11 @@ L 388.8 92.374715 ...@@ -966,11 +966,11 @@ L 388.8 92.374715
<g id="line2d_58"> <g id="line2d_58">
<path d="M 54 75.417373 <path d="M 54 75.417373
L 388.8 75.417373 L 388.8 75.417373
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_59"> <g id="line2d_59">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="75.417373" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="75.417373" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -978,11 +978,11 @@ L 388.8 75.417373 ...@@ -978,11 +978,11 @@ L 388.8 75.417373
<g id="line2d_60"> <g id="line2d_60">
<path d="M 54 62.264237 <path d="M 54 62.264237
L 388.8 62.264237 L 388.8 62.264237
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_61"> <g id="line2d_61">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="62.264237" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="62.264237" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -990,11 +990,11 @@ L 388.8 62.264237 ...@@ -990,11 +990,11 @@ L 388.8 62.264237
<g id="line2d_62"> <g id="line2d_62">
<path d="M 54 51.517342 <path d="M 54 51.517342
L 388.8 51.517342 L 388.8 51.517342
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_63"> <g id="line2d_63">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="51.517342" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="51.517342" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -1002,11 +1002,11 @@ L 388.8 51.517342 ...@@ -1002,11 +1002,11 @@ L 388.8 51.517342
<g id="line2d_64"> <g id="line2d_64">
<path d="M 54 42.430972 <path d="M 54 42.430972
L 388.8 42.430972 L 388.8 42.430972
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_65"> <g id="line2d_65">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="42.430972" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="42.430972" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
...@@ -1014,17 +1014,17 @@ L 388.8 42.430972 ...@@ -1014,17 +1014,17 @@ L 388.8 42.430972
<g id="line2d_66"> <g id="line2d_66">
<path d="M 54 34.56 <path d="M 54 34.56
L 388.8 34.56 L 388.8 34.56
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #cccccc; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.2; stroke-width: 0.8; stroke-linecap: square"/>
</g> </g>
<g id="line2d_67"> <g id="line2d_67">
<g> <g>
<use xlink:href="#m49da50041f" x="54" y="34.56" style="fill: #262626; stroke: #262626; stroke-width: 0.6"/> <use xlink:href="#mc83fbb5aef" x="54" y="34.56" style="stroke: #000000; stroke-width: 0.6"/>
</g> </g>
</g> </g>
</g> </g>
<g id="text_5"> <g id="text_5">
<!-- $\tau$ [$\mu$s] --> <!-- $\tau$ [$\mu$s] -->
<g style="fill: #262626" transform="translate(17.581562 159.03)rotate(-90)scale(0.14 -0.14)"> <g transform="translate(20.081562 159.03) rotate(-90) scale(0.14 -0.14)">
<defs> <defs>
<path id="STIXGeneral-Italic-3c4" d="M 2726 2739 <path id="STIXGeneral-Italic-3c4" d="M 2726 2739
L 2592 2266 L 2592 2266
...@@ -1120,7 +1120,7 @@ L 336.590735 238.815309 ...@@ -1120,7 +1120,7 @@ L 336.590735 238.815309
L 354.625844 239.636666 L 354.625844 239.636666
L 360.12069 239.846836 L 360.12069 239.846836
L 360.12069 239.846836 L 360.12069 239.846836
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_69"> <g id="line2d_69">
<path d="M -1 77.116041 <path d="M -1 77.116041
...@@ -1158,7 +1158,7 @@ L 333.366349 237.040256 ...@@ -1158,7 +1158,7 @@ L 333.366349 237.040256
L 348.101338 238.063053 L 348.101338 238.063053
L 360.12069 238.752525 L 360.12069 238.752525
L 360.12069 238.752525 L 360.12069 238.752525
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_70"> <g id="line2d_70">
<path d="M -1 53.277404 <path d="M -1 53.277404
...@@ -1196,7 +1196,7 @@ L 342.022203 235.270426 ...@@ -1196,7 +1196,7 @@ L 342.022203 235.270426
L 355.101786 236.481441 L 355.101786 236.481441
L 360.12069 236.89126 L 360.12069 236.89126
L 360.12069 236.89126 L 360.12069 236.89126
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_71"> <g id="line2d_71">
<path d="M -1 30.460077 <path d="M -1 30.460077
...@@ -1234,7 +1234,7 @@ L 346.498601 232.674745 ...@@ -1234,7 +1234,7 @@ L 346.498601 232.674745
L 358.33985 234.159729 L 358.33985 234.159729
L 360.12069 234.363702 L 360.12069 234.363702
L 360.12069 234.363702 L 360.12069 234.363702
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_72"> <g id="line2d_72">
<path d="M -1 10.028638 <path d="M -1 10.028638
...@@ -1271,7 +1271,7 @@ L 348.626977 229.370824 ...@@ -1271,7 +1271,7 @@ L 348.626977 229.370824
L 359.236328 231.128678 L 359.236328 231.128678
L 360.12069 231.264982 L 360.12069 231.264982
L 360.12069 231.264982 L 360.12069 231.264982
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_73"> <g id="line2d_73">
<path d="M 6.930424 -1 <path d="M 6.930424 -1
...@@ -1305,7 +1305,7 @@ L 348.101338 225.150537 ...@@ -1305,7 +1305,7 @@ L 348.101338 225.150537
L 357.886964 227.245641 L 357.886964 227.245641
L 360.12069 227.691313 L 360.12069 227.691313
L 360.12069 227.691313 L 360.12069 227.691313
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_74"> <g id="line2d_74">
<path d="M 24.932363 -1 <path d="M 24.932363 -1
...@@ -1337,7 +1337,7 @@ L 350.688307 221.330887 ...@@ -1337,7 +1337,7 @@ L 350.688307 221.330887
L 359.680003 223.62973 L 359.680003 223.62973
L 360.12069 223.736702 L 360.12069 223.736702
L 360.12069 223.736702 L 360.12069 223.736702
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_75"> <g id="line2d_75">
<path d="M 40.964036 -1 <path d="M 40.964036 -1
...@@ -1367,7 +1367,7 @@ L 345.407879 214.93094 ...@@ -1367,7 +1367,7 @@ L 345.407879 214.93094
L 354.146414 217.717939 L 354.146414 217.717939
L 360.12069 219.488686 L 360.12069 219.488686
L 360.12069 219.488686 L 360.12069 219.488686
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="line2d_76"> <g id="line2d_76">
<path d="M 55.371205 -1 <path d="M 55.371205 -1
...@@ -1396,172 +1396,94 @@ L 350.688307 211.754451 ...@@ -1396,172 +1396,94 @@ L 350.688307 211.754451
L 359.236328 214.730856 L 359.236328 214.730856
L 360.12069 215.025418 L 360.12069 215.025418
L 360.12069 215.025418 L 360.12069 215.025418
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: round"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #000000; stroke-width: 0.5; stroke-linecap: square"/>
</g> </g>
<g id="LineCollection_1"> <g id="LineCollection_1">
<path d="M 78.074577 100.941576 <path d="M 78.074577 100.941577
L 78.074577 98.569602 L 78.074577 98.569602
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 104.608945 129.474967 <path d="M 104.608945 129.474967
L 104.608945 125.672857 L 104.608945 125.672857
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 149.969748 155.614391 <path d="M 149.969748 155.614391
L 149.969748 149.79238 L 149.969748 149.79238
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 172.763567 173.00466 <path d="M 172.763567 173.00466
L 172.763567 165.310306 L 172.763567 165.310306
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 200.56869 189.275601 <path d="M 200.56869 189.275601
L 200.56869 179.331635 L 200.56869 179.331635
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 221.864919 201.463607 <path d="M 221.864919 201.463607
L 221.864919 189.454394 L 221.864919 189.454394
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 240.691353 208.902775 <path d="M 240.691353 208.902775
L 240.691353 195.449891 L 240.691353 195.449891
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 271.619439 220.536775 <path d="M 271.619439 220.536776
L 271.619439 204.516146 L 271.619439 204.516146
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 296.140054 230.286366 <path d="M 296.140054 230.286366
L 296.140054 211.795057 L 296.140054 211.795057
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 315.69282 236.359577 <path d="M 315.69282 236.359577
L 315.69282 216.170433 L 315.69282 216.170433
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 330.727698 238.818099 <path d="M 330.727698 238.818099
L 330.727698 217.905331 L 330.727698 217.905331
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 342.082566 242.281691 <path d="M 342.082566 242.281691
L 342.082566 220.312947 L 342.082566 220.312947
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 349.98326 243.014604 <path d="M 349.98326 243.014604
L 349.98326 220.816852 L 349.98326 220.816852
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 355.869635 244.492306 <path d="M 355.869635 244.492307
L 355.869635 221.826851 L 355.869635 221.826851
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
</g> </g>
<g id="line2d_77"> <g id="line2d_77">
<defs> <defs>
<path id="m9782d4f57d" d="M 3 0 <path id="m50fb14276f" d="M 3 0
L -3 -0 L -3 -0
" style="stroke: #3949ab"/> " style="stroke: #3949ab"/>
</defs> </defs>
<g clip-path="url(#p87ef8453bf)"> <g clip-path="url(#p64b1d592be)">
<use xlink:href="#m9782d4f57d" x="78.074577" y="100.941576" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="78.074577" y="100.941577" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="104.608945" y="129.474967" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="104.608945" y="129.474967" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="149.969748" y="155.614391" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="149.969748" y="155.614391" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="172.763567" y="173.00466" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="172.763567" y="173.00466" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="200.56869" y="189.275601" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="200.56869" y="189.275601" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="221.864919" y="201.463607" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="221.864919" y="201.463607" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="240.691353" y="208.902775" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="240.691353" y="208.902775" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="271.619439" y="220.536775" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="271.619439" y="220.536776" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="296.140054" y="230.286366" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="296.140054" y="230.286366" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="315.69282" y="236.359577" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="315.69282" y="236.359577" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="330.727698" y="238.818099" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="330.727698" y="238.818099" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="342.082566" y="242.281691" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="342.082566" y="242.281691" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="349.98326" y="243.014604" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="349.98326" y="243.014604" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="355.869635" y="244.492306" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="355.869635" y="244.492307" style="fill: #3949ab; stroke: #3949ab"/>
</g> </g>
</g> </g>
<g id="line2d_78"> <g id="line2d_78">
<g clip-path="url(#p87ef8453bf)"> <g clip-path="url(#p64b1d592be)">
<use xlink:href="#m9782d4f57d" x="78.074577" y="98.569602" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="78.074577" y="98.569602" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="104.608945" y="125.672857" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="104.608945" y="125.672857" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="149.969748" y="149.79238" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="149.969748" y="149.79238" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="172.763567" y="165.310306" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="172.763567" y="165.310306" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="200.56869" y="179.331635" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="200.56869" y="179.331635" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="221.864919" y="189.454394" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="221.864919" y="189.454394" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="240.691353" y="195.449891" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="240.691353" y="195.449891" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="271.619439" y="204.516146" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="271.619439" y="204.516146" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="296.140054" y="211.795057" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="296.140054" y="211.795057" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="315.69282" y="216.170433" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="315.69282" y="216.170433" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="330.727698" y="217.905331" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="330.727698" y="217.905331" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="342.082566" y="220.312947" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="342.082566" y="220.312947" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="349.98326" y="220.816852" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="349.98326" y="220.816852" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="355.869635" y="221.826851" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m50fb14276f" x="355.869635" y="221.826851" style="fill: #3949ab; stroke: #3949ab"/>
</g> </g>
</g> </g>
<g id="LineCollection_2">
<path clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 104.608945 104.902777
L 104.608945 102.369417
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 149.969748 67.323738
L 149.969748 65.97106
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 172.763567 95.403956
L 172.763567 93.240819
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 200.56869 128.975332
L 200.56869 125.204309
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 221.864919 150.338652
L 221.864919 144.993186
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 240.691353 159.558656
L 240.691353 153.354239
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 271.619439 185.170149
L 271.619439 175.845052
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 296.140054 199.631483
L 296.140054 187.95572
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 315.69282 208.738178
L 315.69282 195.318844
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 330.727698 216.5725
L 330.727698 201.471423
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 342.082566 220.445572
L 342.082566 204.446635
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 349.98326 222.181735
L 349.98326 205.765445
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
<path d="M 355.869635 223.930273
L 355.869635 207.084145
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke: #3949ab; stroke-width: 0.5"/>
</g>
<g id="line2d_79"> <g id="line2d_79">
<g clip-path="url(#p87ef8453bf)">
<use xlink:href="#m9782d4f57d" x="80.271594" y="-1" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="104.608945" y="104.902777" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="149.969748" y="67.323738" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="172.763567" y="95.403956" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="200.56869" y="128.975332" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="221.864919" y="150.338652" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="240.691353" y="159.558656" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="271.619439" y="185.170149" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="296.140054" y="199.631483" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="315.69282" y="208.738178" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="330.727698" y="216.5725" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="342.082566" y="220.445572" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="349.98326" y="222.181735" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="355.869635" y="223.930273" style="fill: #3949ab; stroke: #3949ab"/>
</g>
</g>
<g id="line2d_80">
<g clip-path="url(#p87ef8453bf)">
<use xlink:href="#m9782d4f57d" x="80.398898" y="-1" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="104.608945" y="102.369417" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="149.969748" y="65.97106" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="172.763567" y="93.240819" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="200.56869" y="125.204309" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="221.864919" y="144.993186" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="240.691353" y="153.354239" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="271.619439" y="175.845052" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="296.140054" y="187.95572" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="315.69282" y="195.318844" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="330.727698" y="201.471423" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="342.082566" y="204.446635" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="349.98326" y="205.765445" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m9782d4f57d" x="355.869635" y="207.084145" style="fill: #3949ab; stroke: #3949ab"/>
</g>
</g>
<g id="line2d_81">
<path d="M 78.074577 99.743659 <path d="M 78.074577 99.743659
L 104.608945 127.543262 L 104.608945 127.543262
L 149.969748 152.631534 L 149.969748 152.631534
...@@ -1576,9 +1498,9 @@ L 330.727698 227.439094 ...@@ -1576,9 +1498,9 @@ L 330.727698 227.439094
L 342.082566 230.279718 L 342.082566 230.279718
L 349.98326 230.876924 L 349.98326 230.876924
L 355.869635 232.076808 L 355.869635 232.076808
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke-dasharray: 1.85,0.8; stroke-dashoffset: 0; stroke: #3949ab; stroke-width: 0.5"/> " clip-path="url(#p64b1d592be)" style="fill: none; stroke-dasharray: 1.85,0.8; stroke-dashoffset: 0; stroke: #3949ab; stroke-width: 0.5"/>
<defs> <defs>
<path id="m90e337699c" d="M 0 1.5 <path id="m3cf7117c1c" d="M 0 1.5
C 0.397805 1.5 0.77937 1.341951 1.06066 1.06066 C 0.397805 1.5 0.77937 1.341951 1.06066 1.06066
C 1.341951 0.77937 1.5 0.397805 1.5 0 C 1.341951 0.77937 1.5 0.397805 1.5 0
C 1.5 -0.397805 1.341951 -0.77937 1.06066 -1.06066 C 1.5 -0.397805 1.341951 -0.77937 1.06066 -1.06066
...@@ -1590,80 +1512,47 @@ C -0.77937 1.341951 -0.397805 1.5 0 1.5 ...@@ -1590,80 +1512,47 @@ C -0.77937 1.341951 -0.397805 1.5 0 1.5
z z
" style="stroke: #3949ab"/> " style="stroke: #3949ab"/>
</defs> </defs>
<g clip-path="url(#p87ef8453bf)"> <g clip-path="url(#p64b1d592be)">
<use xlink:href="#m90e337699c" x="78.074577" y="99.743659" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="78.074577" y="99.743659" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="104.608945" y="127.543262" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="104.608945" y="127.543262" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="149.969748" y="152.631534" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="149.969748" y="152.631534" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="172.763567" y="169.032024" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="172.763567" y="169.032024" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="200.56869" y="184.094173" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="200.56869" y="184.094173" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="221.864919" y="195.153688" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="221.864919" y="195.153688" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="240.691353" y="201.793372" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="240.691353" y="201.793372" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="271.619439" y="211.983845" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="271.619439" y="211.983845" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="296.140054" y="220.318561" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="296.140054" y="220.318561" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="315.69282" y="225.404825" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="315.69282" y="225.404825" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="330.727698" y="227.439094" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="330.727698" y="227.439094" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="342.082566" y="230.279718" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="342.082566" y="230.279718" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="349.98326" y="230.876924" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="349.98326" y="230.876924" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="355.869635" y="232.076808" style="fill: #3949ab; stroke: #3949ab"/> <use xlink:href="#m3cf7117c1c" x="355.869635" y="232.076808" style="fill: #3949ab; stroke: #3949ab"/>
</g>
</g>
<g id="line2d_82">
<path d="M 80.334971 -1
L 104.608945 103.622488
L 149.969748 66.643519
L 172.763567 94.312465
L 200.56869 127.059669
L 221.864919 147.605345
L 240.691353 156.374852
L 271.619439 180.323388
L 296.140054 193.504981
L 315.69282 201.647453
L 330.727698 208.539684
L 342.082566 211.904952
L 349.98326 213.403929
L 355.869635 214.907428
" clip-path="url(#p87ef8453bf)" style="fill: none; stroke-dasharray: 1.85,0.8; stroke-dashoffset: 0; stroke: #3949ab; stroke-width: 0.5"/>
<g clip-path="url(#p87ef8453bf)">
<use xlink:href="#m90e337699c" x="80.334971" y="-1" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="104.608945" y="103.622488" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="149.969748" y="66.643519" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="172.763567" y="94.312465" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="200.56869" y="127.059669" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="221.864919" y="147.605345" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="240.691353" y="156.374852" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="271.619439" y="180.323388" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="296.140054" y="193.504981" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="315.69282" y="201.647453" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="330.727698" y="208.539684" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="342.082566" y="211.904952" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="349.98326" y="213.403929" style="fill: #3949ab; stroke: #3949ab"/>
<use xlink:href="#m90e337699c" x="355.869635" y="214.907428" style="fill: #3949ab; stroke: #3949ab"/>
</g> </g>
</g> </g>
<g id="patch_3"> <g id="patch_3">
<path d="M 54 252 <path d="M 54 252
L 54 34.56 L 54 34.56
" style="fill: none; stroke: #262626; stroke-width: 1.25; stroke-linejoin: miter; stroke-linecap: square"/> " style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g> </g>
<g id="patch_4"> <g id="patch_4">
<path d="M 388.8 252 <path d="M 388.8 252
L 388.8 34.56 L 388.8 34.56
" style="fill: none; stroke: #262626; stroke-width: 1.25; stroke-linejoin: miter; stroke-linecap: square"/> " style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g> </g>
<g id="patch_5"> <g id="patch_5">
<path d="M 54 252 <path d="M 54 252
L 388.8 252 L 388.8 252
" style="fill: none; stroke: #262626; stroke-width: 1.25; stroke-linejoin: miter; stroke-linecap: square"/> " style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g> </g>
<g id="patch_6"> <g id="patch_6">
<path d="M 54 34.56 <path d="M 54 34.56
L 388.8 34.56 L 388.8 34.56
" style="fill: none; stroke: #262626; stroke-width: 1.25; stroke-linejoin: miter; stroke-linecap: square"/> " style="fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square"/>
</g> </g>
</g> </g>
</g> </g>
<defs> <defs>
<clipPath id="p87ef8453bf"> <clipPath id="p64b1d592be">
<rect x="54" y="34.56" width="334.8" height="217.44"/> <rect x="54" y="34.56" width="334.8" height="217.44"/>
</clipPath> </clipPath>
</defs> </defs>
......
...@@ -10,7 +10,7 @@ import scipy.stats as sts ...@@ -10,7 +10,7 @@ import scipy.stats as sts
import seaborn as sns import seaborn as sns
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221017_IonStatistics') #os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221017_IonStatistics')
plt.rcParams.update({ plt.rcParams.update({
"font.family": "STIXGeneral" "font.family": "STIXGeneral"
...@@ -79,6 +79,10 @@ for i, fname in enumerate(Stat_files[3:6]): ...@@ -79,6 +79,10 @@ for i, fname in enumerate(Stat_files[3:6]):
#%% #%%
"""
TESIS
"""
import matplotlib import matplotlib
import seaborn as sns import seaborn as sns
...@@ -113,26 +117,32 @@ bins3 = np.arange(30,100,1) ...@@ -113,26 +117,32 @@ bins3 = np.arange(30,100,1)
FIGURA ESTADISTICA POISSON FIGURA ESTADISTICA POISSON
""" """
plt.figure(figsize = (3.8,2.8)) fig,ax=plt.subplots(1,2,gridspec_kw={'width_ratios': [1, 1]},figsize=(6.5,3.))
plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True,color = color1, alpha = 0.6)#,label = 'BG')
plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True,color = color2, alpha = 0.6)#,label = 'UV laser') #plt.figure(figsize = (9,3.5))
plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True,color = color3, alpha = 0.6)#,label = 'Ion') ax[1].hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True,color = color1,linewidth=2, alpha = 0.6)#,label = 'BG')
ax[1].hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True,color = color2,linewidth=2, alpha = 0.6)#,label = 'UV laser')
ax[1].hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True,color = color3,linewidth=2, alpha = 0.6)#,label = 'Ion')
poisson1= sts.poisson.pmf(bins1,np.mean(Stat_Heigths[0])) poisson1= sts.poisson.pmf(bins1,np.mean(Stat_Heigths[0]))
poisson2= sts.poisson.pmf(bins2,np.mean(Stat_Heigths[1])) poisson2= sts.poisson.pmf(bins2,np.mean(Stat_Heigths[1]))
poisson3= sts.poisson.pmf(bins3,np.mean(Stat_Heigths[2])) poisson3= sts.poisson.pmf(bins3,np.mean(Stat_Heigths[2]))
plt.plot(bins2+0.5,poisson2,color = color2,label = 'Background') ax[1].plot(bins2+0.5,poisson2,color = color2,label = 'Señal de fondo',linewidth=1.5)
plt.plot(bins3+0.5,poisson3,color = color3,label = 'UV laser') ax[1].plot(bins3+0.5,poisson3,color = color3,label = 'Láser UV',linewidth=1.5)
plt.plot(bins1+0.5,poisson1,color = color1,label = 'Ion') ax[1].plot(bins1+0.5,poisson1,color = color1,label = 'Ion',linewidth=1.5)
plt.legend(loc=(0.15,0.65), prop={'size': 11}) ax[1].legend(loc='upper right', prop={'size': 10})
plt.grid() ax[1].grid()
plt.tight_layout() ax[1].set_xticks([0, 100, 200, 300])
plt.xticks([0, 100, 200, 300], fontname='STIXGeneral') ax[1].set_xticklabels([0, 100, 200, 300], fontsize=10,fontname='STIXGeneral')
plt.yticks([0,0.02, 0.04, 0.06, 0.08], fontname='STIXGeneral') ax[1].set_yticks([0,0.02, 0.04, 0.06, 0.08])
plt.xlabel('Counts', fontname='STIXGeneral') ax[1].set_yticklabels([0,0.02, 0.04, 0.06, 0.08], fontsize=10,fontname='STIXGeneral')
plt.ylabel('Event frequency', fontname='STIXGeneral') ax[1].set_xlabel('Cuentas', fontsize=10, fontname='STIXGeneral')
ax[1].set_ylabel('Frecuencia de eventos', fontsize=10, fontname='STIXGeneral')
#plt.savefig('C:/Users/nicon/Nextcloud/Nico/Doctorado/Tesis/Tesis_doctorado/Chapters/figures/Cap5_poisson.pdf')
#poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths) #poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths)
#plt.title('Varianza/media = {:.4f}'.format(poissoneidad)) #plt.title('Varianza/media = {:.4f}'.format(poissoneidad))
...@@ -140,39 +150,29 @@ plt.ylabel('Event frequency', fontname='STIXGeneral') ...@@ -140,39 +150,29 @@ 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+'.svg')
#%%
import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'
plt.style.use('seaborn-bright')
plt.rcParams.update({
"text.usetex": False,
})
""" """
FIGURA BACKGROUND, ENCENDIDO AOM Y ENCENDIDO ION FIGURA BACKGROUND, ENCENDIDO AOM Y ENCENDIDO ION
""" """
plt.figure(figsize=(4.5,3)) #plt.figure(figsize=(4.5,3))
plt.plot([s*1e6 for s in OnOff_Bins[1][:-1]],OnOff_Heights[1], color=color2) ax[0].plot([s*1e6 for s in OnOff_Bins[1][:-1]],OnOff_Heights[1], color=color2,linewidth=3)
plt.plot([s*1e6 for s in OnOff_Bins[0][:-1]],[(OnOff_Heights[0][j]-OnOff_Heights[1][j])*3.13+OnOff_Heights[1][j] for j in range(len(OnOff_Heights[0]))], color=color3) ax[0].plot([s*1e6 for s in OnOff_Bins[0][:-1]],[(OnOff_Heights[0][j]-OnOff_Heights[1][j])*3.13+OnOff_Heights[1][j] for j in range(len(OnOff_Heights[0]))], color=color3,linewidth=3)
plt.plot([s*1e6 for s in OnOff_Bins[2][:-1]],OnOff_Heights[2], color=color1) ax[0].plot([s*1e6 for s in OnOff_Bins[2][:-1]],OnOff_Heights[2], color=color1,linewidth=3)
plt.xlim(0,1) ax[0].set_xlim(0,1)
plt.grid() ax[0].grid()
plt.xlabel(r'Time ($\mu$s)', fontname='STIXGeneral') ax[0].set_xlabel(r'Tiempo ($\mu$s)', fontname='STIXGeneral', fontsize=10)
plt.ylabel(r'Counts /10$~\mu$s', fontname='STIXGeneral') ax[0].set_ylabel(r'Cuentas /10$~\mu$s', fontname='STIXGeneral', fontsize=10)
plt.xticks([0,0.2, 0.4, 0.6, 0.8, 1], fontname='STIXGeneral') ax[0].set_xticks([0,0.2, 0.4, 0.6, 0.8, 1])
plt.yticks([0,5000, 10000], fontname='STIXGeneral') ax[0].set_yticks([0,5000, 10000])
ax[0].set_xticklabels([0,0.2, 0.4, 0.6, 0.8, 1], fontname='STIXGeneral', fontsize=10)
ax[0].set_yticklabels([0,5000, 10000], fontname='STIXGeneral', fontsize=10)
plt.tight_layout() plt.tight_layout()
name='fig01b' name='fig01b'
plt.savefig('C:/Users/nicon/Nextcloud/Nico/Doctorado/Tesis/Tesis_doctorado/Chapters/figures/Cap5_statistics.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+'.pdf')
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'_dump.svg') #plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'_dump.svg')
......
...@@ -23,15 +23,15 @@ for det in detuning_lines: ...@@ -23,15 +23,15 @@ for det in detuning_lines:
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]: # esto evalua con distintos radios for rad in [85.7]: # 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)) for p in UVpotVec], Taus[:-1], yerr=np.mean(1e6*errsSIM.stdval.values),
fmt='.--', ms=6, lw=.5, \ fmt='.--', ms=6, lw=.5, \
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([p/(np.pi*(rad**2)) for p in UVpotVec], Taus_v2[:-1], yerr=np.mean(1e6*errsSIM.stdval.values),
fmt='.--', ms=6, lw=.5, \ # fmt='.--', ms=6, lw=.5, \
color="#3949ab", # color="#3949ab",
capsize=3) # capsize=3)
# ax2.errorbar(potencias/(np.pi*(rad**2)), dataREAL.Tau*1e6, \ # ax2.errorbar(potencias/(np.pi*(rad**2)), dataREAL.Tau*1e6, \
......
...@@ -7,7 +7,7 @@ import ast ...@@ -7,7 +7,7 @@ import ast
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import os import os
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221024_BranchingFractionMeasurement') #os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221024_BranchingFractionMeasurement')
Long_files = ['DP_long', 'SP_long'] Long_files = ['DP_long', 'SP_long']
Calib_files = ['Fondo_IR_50M', 'Fondo_UV_50M'] Calib_files = ['Fondo_IR_50M', 'Fondo_UV_50M']
...@@ -183,6 +183,10 @@ plt.plot(Long_Bins[1][:-1], SP_corrected) ...@@ -183,6 +183,10 @@ plt.plot(Long_Bins[1][:-1], SP_corrected)
plt.plot(Long_Bins[0][:-1], DP_corrected) plt.plot(Long_Bins[0][:-1], DP_corrected)
#%% #%%
"""
TESIS
"""
""" """
Figura branching Figura branching
""" """
...@@ -212,24 +216,24 @@ bins2 = np.arange(0,50,1) ...@@ -212,24 +216,24 @@ bins2 = np.arange(0,50,1)
bins3 = np.arange(30,100,1) bins3 = np.arange(30,100,1)
plt.figure(figsize = (3.8,3)) plt.figure(figsize = (4.5,3.5))
plt.plot([1e6*b-0.18 for b in Long_Bins[1][:-1]], SP_corrected, color=(0,0,128/255, 1),linewidth=2.5,label='SP transition') plt.plot([1e6*b-0.18 for b in Long_Bins[1][:-1]], SP_corrected, color=(0,0,128/255, 1),linewidth=2.5,label='Transición SP')
plt.plot([1e6*b+0.09 for b in Long_Bins[0][:-1]], DP_corrected, color=(212/255,0,0, 1),linewidth=2.5,label='DP transition') plt.plot([1e6*b+0.09 for b in Long_Bins[0][:-1]], DP_corrected, color=(212/255,0,0, 1),linewidth=2.5,label='Transición DP')
#plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True,color = color1, alpha = 0.6)#,label = 'BG') #plt.hist(Stat_Heigths[0], bins=bins1, histtype='step',density = True,color = color1, alpha = 0.6)#,label = 'BG')
#plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True,color = color2, alpha = 0.6)#,label = 'UV laser') #plt.hist(Stat_Heigths[1], bins=bins2, histtype='step',density = True,color = color2, alpha = 0.6)#,label = 'UV laser')
#plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True,color = color3, alpha = 0.6)#,label = 'Ion') #plt.hist(Stat_Heigths[2], bins=bins3, histtype='step',density = True,color = color3, alpha = 0.6)#,label = 'Ion')
#plt.legend(loc=(0.15,0.65), prop={'size': 11}) plt.legend(loc='upper right', prop={'family':'STIXgeneral','size': 10})
plt.legend() #plt.legend()
plt.grid() plt.grid()
plt.tight_layout() plt.tight_layout()
plt.xlim(-0.3, 2) plt.xlim(-0.3, 2)
plt.xticks([0, 1, 2], fontname='STIXGeneral') plt.xticks([0, 0.5, 1, 1.5, 2],fontsize=10, fontname='STIXGeneral')
plt.yticks([0,5000, 10000, 15000], fontname='STIXGeneral') plt.yticks([0,5000, 10000, 15000],fontsize=10, fontname='STIXGeneral')
plt.xlabel('Time (us)', fontname='STIXGeneral') plt.xlabel(r'Tiempo ($\mu$s)', fontsize=10,fontname='STIXGeneral')
plt.ylabel('Counts', fontname='STIXGeneral') plt.ylabel('Cuentas', fontsize=10, fontname='STIXGeneral')
#poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths) #poissoneidad = np.var(Stat_Heigths)/np.mean(Stat_Heigths)
#plt.title('Varianza/media = {:.4f}'.format(poissoneidad)) #plt.title('Varianza/media = {:.4f}'.format(poissoneidad))
...@@ -237,8 +241,10 @@ plt.ylabel('Counts', fontname='STIXGeneral') ...@@ -237,8 +241,10 @@ plt.ylabel('Counts', fontname='STIXGeneral')
name='fig02a' name='fig02a'
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.pdf') plt.savefig('C:/Users/nicon/Nextcloud/Nico/Doctorado/Tesis/Tesis_doctorado/Chapters/figures/Cap5_SP_DP.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+'.pdf')
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2022 Transient Phenomena JOSA B/Figures/'+name+'.svg')
#%% #%%
......
...@@ -7,7 +7,7 @@ import ast ...@@ -7,7 +7,7 @@ import ast
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import os import os
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230523_transitorioshighpower/') #os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230523_transitorioshighpower/')
# Solo levanto algunos experimentos # Solo levanto algunos experimentos
SP_files = [12221, 12222, 12223, 12224] SP_files = [12221, 12222, 12223, 12224]
......
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 4 12:24:54 2023
@author: nicon
"""
import numpy as np
import matplotlib.pyplot as plt
def RDE(r,l,v):
return 2*l*v/r
def OAM(r,w,amp):
width=2/(amp*np.sqrt(2*np.pi))
return amp*np.exp(-((r-w)**2)/(2*width**2))
r=np.arange(0,3,0.001)
w1 = 1
amp1 = 2*np.pi/w1
w2 = 1.5
amp2=2*np.pi/w2
plt.figure()
plt.plot(r,1*OAM(r,w1,amp1))
plt.plot(r,1*OAM(r,w2,amp2))
#%%
plt.figure()
plt.plot(r,OAM(r,w1,amp1)/RDE(r,2,2))
plt.plot(r,OAM(r,w2,amp2)/RDE(r,2,2))
#%%
plt.figure()
plt.plot(r/w1,(OAM(r,w1,amp1)/RDE(r,2,2)))
plt.plot(r/w2,(OAM(r,w2,amp2)/RDE(r,2,2)))
#%%
from math import factorial as fac
def LGbeam(r,l,w,P):
E = np.sqrt(4*P/(w**2))
return E*np.sqrt(2/(np.pi*(fac(np.abs(l)))))*(1/1)*(((np.sqrt(2)*r)/(w))**np.abs(l))*np.exp(-((r**2)/(w**2)))
def RDE(r,l,v,w):
#return 2*l*v*(1/r)
return 2*l*v*(r**2.21) #con una exponencial se chotea
#return 2*l*v
r = np.arange(0.01,200,0.01)
w1 = 40
w2 = 80
P = 1e50
l=2
vel = 1e1
# plt.figure()
# plt.plot(r,(LGbeam(r,l,w1,P))**2)
# plt.plot(r,(LGbeam(r,l,w2,P))**2)
# plt.title('Intensity of two LG beams with different waists')
# plt.figure()
# plt.plot(r,((LGbeam(r,l,w1,P))**2)/RDE(r,l,vel,w1))
# plt.plot(r,((LGbeam(r,l,w2,P))**2)/RDE(r,l,vel,w2))
# plt.title('Ratio between the LG intensity and the RDE term')
LG1 = (((LGbeam(r,l,w1,P))**2)/RDE(r,l,vel,w1))
LG2 = (((LGbeam(r,l,w2,P))**2)/RDE(r,l,vel,w2))
fact = (np.max(LG1)/np.max(LG2))
plt.figure()
plt.plot(r/w1,LG1)
plt.plot(r/w2,LG2*fact)
plt.title('Scaled ratio between LG and RDE, x axis scaled with LG waist')
#%%
def ShiftFull(r,l,vz,vr,vphi,w,wl,z):
k = 2*np.pi/wl
zr = 0.5*k*w*w
deltaz = (k + (k*r*r/(2*(z*z +zr*zr))*((2*z*z)/(z*z + zr*zr) - 1) - (l+1)*zr/(z*z+zr*zr)))*vz
deltar = (k*r*z/(z*z+zr*zr))*vr
deltaphi = (l/r)*vphi
return deltaz+deltar+deltaphi
r = np.arange(0.0001,200,0.01)
w1 = 40
w2 = 60
wl = 0.866
z=1
P = 1e15
l=2
velz = 1e10*0
velr = 1e10*0
velphi = 1e10
# plt.figure()
# plt.plot(r,(LGbeam(r,2,w1,1))**2)
# plt.plot(r,(LGbeam(r,2,w2,1))**2)
# plt.title('Intensity of two LG beams with different waists')
# plt.figure()
# plt.plot(r,((LGbeam(r,2,w1,1))**2)/RDE(r,2,2))
# plt.plot(r,((LGbeam(r,2,w2,1))**2)/RDE(r,2,2))
# plt.title('Ratio between the LG intensity and the RDE term')
LG1 = (((LGbeam(r,l,w1,P))**2)/ShiftFull(r,2,velz,velr,velphi,w1,wl,z))
LG2 = (((LGbeam(r,l,w2,P))**2)/ShiftFull(r,2,velz,velr,velphi,w2,wl,z))
fact = (np.max(LG1)/np.max(LG2))
plt.figure()
plt.plot(r/w1,LG1)
plt.plot(r/w2,LG2*fact)
plt.title('Scaled ratio between LG and RDE, x axis scaled with LG waist')
...@@ -18,6 +18,16 @@ from scipy.optimize import curve_fit ...@@ -18,6 +18,16 @@ from scipy.optimize import curve_fit
import random import random
from scipy.signal import savgol_filter as sf from scipy.signal import savgol_filter as sf
from scipy.stats import norm from scipy.stats import norm
def prob_energia(E,T):
kboltz = 1.380649e-23
mcalcio = 6.655e-23*1e-3
prob = np.exp(-E/(kboltz*T)) #*E**2
return prob
def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = False): def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = False):
""" """
...@@ -37,8 +47,9 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew ...@@ -37,8 +47,9 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew
velvec = np.linspace(-4*sigmaT,4*sigmaT,100) velvec = np.linspace(-4*sigmaT,4*sigmaT,100)
MBprobVec = norm.pdf(velvec,loc = 0, scale = sigmaT) MBprobVec = norm.pdf(velvec,loc = 0, scale = sigmaT)
MBprobVec = MBprobVec/np.trapz(MBprobVec,velvec)
for i in range(len(velvec)): for i in range(len(velvec)):
detVel = (detpvec - kp*velvec[i])/(2*np.pi*1e6) detVel = detpvec - kp*velvec[i]/(2*np.pi*1e6)
_, Fluorescence = CPTspectrum8levels( sg, sp, gPS, gPD, DetDoppler-kg*velvec[i]/(2*np.pi*1e6),u, DopplerLaserLinewidth, ProbeLaserLinewidth, 0,alpha, phidoppler, titadoppler, phiprobe, titaprobe,circularityprobe, betag, betap, drivefreq, freqMin=freqMin, freqMax=freqMax, freqStep=freqStep, plot=False,detpvec=detVel) _, Fluorescence = CPTspectrum8levels( sg, sp, gPS, gPD, DetDoppler-kg*velvec[i]/(2*np.pi*1e6),u, DopplerLaserLinewidth, ProbeLaserLinewidth, 0,alpha, phidoppler, titadoppler, phiprobe, titaprobe,circularityprobe, betag, betap, drivefreq, freqMin=freqMin, freqMax=freqMax, freqStep=freqStep, plot=False,detpvec=detVel)
FluorescencesVel.append(Fluorescence) FluorescencesVel.append(Fluorescence)
...@@ -54,21 +65,29 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew ...@@ -54,21 +65,29 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew
else: else:
drivefreq =2*np.pi* 1e3 drivefreq =2*np.pi* 0.6e6
FluorescencesVel = [] FluorescencesVel = []
sigmaT = np.sqrt(T*kboltz/m) sigmaT = np.sqrt(T*kboltz/m)
velvec = np.linspace(-4*sigmaT,4*sigmaT,100) velvec = np.linspace(-4*sigmaT,4*sigmaT,100)
MBprobVec = norm.pdf(velvec,loc = 0, scale = sigmaT) MBprobVec = norm.pdf(velvec,loc = 0, scale = sigmaT)
Evec = np.linspace(0,8*kboltz*T,100)
velvec = np.zeros(2*len(Evec))
velvec= np.sqrt(2 * Evec/m)
MBprobVec = prob_energia(Evec, T)
MBprobVec = MBprobVec/np.trapz(MBprobVec,Evec)
betagVec = velvec*kg/drivefreq betagVec = velvec*kg/drivefreq
betapVec = velvec*kp/drivefreq betapVec = velvec*kp/drivefreq
for i in range(len(betagVec)): for i in range(len(betagVec)):
betag,betap = betagVec[i],betapVec[i] betag,betap = betagVec[i],betapVec[i]
Frequencies, Fluorescence = CPTspectrum8levels( sg, sp, gPS, gPD, DetDoppler,u, DopplerLaserLinewidth, ProbeLaserLinewidth, 0,alpha, phidoppler, titadoppler, phiprobe, titaprobe,circularityprobe, betag, betap, drivefreq, freqMin=freqMin, freqMax=freqMax, freqStep=freqStep, plot=False,detpvec=None) Frequencies, Fluorescence = CPTspectrum8levels( sg, sp, gPS, gPD, DetDoppler,u, DopplerLaserLinewidth, ProbeLaserLinewidth, 0,alpha, phidoppler, titadoppler, phiprobe, titaprobe,circularityprobe, betag, betap, drivefreq, freqMin=freqMin, freqMax=freqMax, freqStep=freqStep, plot=False,detpvec=detpvec)
FluorescencesVel.append(Fluorescence) FluorescencesVel.append(Fluorescence)
FluorescencesVel = np.array(FluorescencesVel) FluorescencesVel = np.array(FluorescencesVel)
MBprobMat = np.tile(MBprobVec,(FluorescencesVel.shape[1],1)).T MBprobMat = np.tile(MBprobVec,(FluorescencesVel.shape[1],1)).T
Fluorescence = np.trapz(FluorescencesVel*MBprobMat,velvec,axis = 0) Fluorescence = np.trapz(FluorescencesVel*MBprobMat,Evec,axis = 0)
ProbeDetuningVectorL = Frequencies ProbeDetuningVectorL = Frequencies
#print('Done, Total time: ', round((tfinal-tinicial), 2), "s") #print('Done, Total time: ', round((tfinal-tinicial), 2), "s")
...@@ -106,15 +125,25 @@ def SmoothNoisyCPT(Fluo, window=11, poly=3): ...@@ -106,15 +125,25 @@ def SmoothNoisyCPT(Fluo, window=11, poly=3):
def fitCPT_8levels(Freq,Fluo,sg,sp,gPS,gPD,DetDoppler,u,DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe,beta, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False,dephasing = False, boltzmann = False ): def fitCPT_8levels(Freq,Fluo,sg,sp,gPS,gPD,DetDoppler,u,DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe,betag,betar, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False,dephasing = False, boltzmann = False ):
def SpectrumForFit(Freq,sg,sp,T,DetDoppler): def SpectrumForFit(Freq,sg,sp,T,DetDoppler,A,bgnd,f0):
freq,spectra = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, beta, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=Freq) Freq = Freq - f0
return spectra freq,spectra = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag,betar, drivefreq, freqMin, freqMax, freqStep,circularityprobe=1, plot=False, detpvec=Freq, dephasing = dephasing, boltzmann = boltzmann)
return spectra*A + bgnd
popt,pcov = curve_fit(SpectrumForFit,Freq,Fluo,p0 = [sg,sp,T,DetDoppler],bounds = ([0.01,0.01,0.00001,-50e6],[1,20,1,30e6])) popt,pcov = curve_fit(SpectrumForFit,Freq,Fluo,p0 = [sg,sp,T,DetDoppler,20000,800,432],bounds = ([0.1,1,0.5e-3,-30,10000,0,420],[0.8,10,10e-3,0,100000,1000,500]))
fitted_spectra = SpectrumForFit(Freq,*popt) fitted_spectra = SpectrumForFit(Freq,*popt)
return Freq, fitted_spectra,popt,pcov return Freq, fitted_spectra,popt,pcov
def try_fitCPT_8levels(A,bgnd,f0,Freq,Fluo,sg,sp,gPS,gPD,DetDoppler,u,DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe,betag,betar, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False,dephasing = False, boltzmann = False ):
def SpectrumForFit(Freq,sg,sp,T,DetDoppler,A,bgnd,f0):
Freq = Freq - f0
freq,spectra = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag,betar, drivefreq, freqMin, freqMax, freqStep,circularityprobe=1, plot=False, detpvec=Freq, dephasing = dephasing, boltzmann = boltzmann)
return spectra*A + bgnd
return SpectrumForFit(Freq, sg, sp, T, DetDoppler, A, bgnd, f0)
\ No newline at end of file
...@@ -10,24 +10,106 @@ Created on Tue Sep 1 17:58:39 2020 ...@@ -10,24 +10,106 @@ Created on Tue Sep 1 17:58:39 2020
import os import os
import numpy as np import numpy as np
from MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels, GenerateNoisyCPT_vel, SmoothNoisyCPT, PerformExperiment_8levels_vel from MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels, GenerateNoisyCPT_vel, SmoothNoisyCPT, PerformExperiment_8levels_vel,fitCPT_8levels,try_fitCPT_8levels
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import time import time
import h5py import h5py
def MB_prob(vel,T): os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20231218_CPT_muri/Data')
return (m/(2*np.pi*kboltz*T))**(3/2)*2* vel**2 *np.exp(-vel**2 * m/(2*kboltz*T))
CPT_FILES = """000016262-IR_Scan_withcal_optimized
000016239-IR_Scan_withcal_optimized
000016240-IR_Scan_withcal_optimized
000016241-IR_Scan_withcal_optimized
000016244-IR_Scan_withcal_optimized
000016255-IR_Scan_withcal_optimized
000016256-IR_Scan_withcal_optimized
000016257-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(CPT_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 = []
Voltages = []
for i, fname in enumerate(CPT_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']['IR1_Frequencies']))
Counts.append(np.array(data['datasets']['data_array']))
#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']))
Voltages.append(np.array(data['datasets']['scanning_voltages']))
def Split(array,n):
length=len(array)/n
splitlist = []
jj = 0
while jj<length:
partial = []
ii = 0
while ii < n:
partial.append(array[jj*n+ii])
ii = ii + 1
splitlist.append(partial)
jj = jj + 1
return splitlist
CountsSplit = []
CountsSplit.append(Split(Counts[0],len(Freqs[0])))
def MB_prob_1d(vel,T):
return np.sqrt(m/(2*np.pi*kboltz*T))*np.exp(-vel**2 * m/(2*kboltz*T))
#plt.rcParams.update({ CountsSplit_2ions = []
# "text.usetex": True, CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
# "font.family": "CM Roman"
#})
#%%
"""
Para distintos valores de j hay curvas CPT variando compensación.
Las que valen la pena son de la 1 a la 9.
En particular, la 4 tiene poca micromoción:
"""
jvec = [4] # de la 1 a la 9 vale la pena, despues no
drive=22.1
Frequencies = Freqs[0]
plt.figure()
i = 0
for j in jvec:
#plt.errorbar([2*f*1e-6-419-13 for f in Frequencies], CountsSplit[0][j], yerr=np.sqrt(CountsSplit[0][j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
plt.rcParams["axes.prop_cycle"] = plt.cycler('color', ['#DBAD1F', '#C213DB', '#DB4F2A', '#0500DB', '#09DB9B', '#B4001B', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']) plt.rcParams["axes.prop_cycle"] = plt.cycler('color', ['#DBAD1F', '#C213DB', '#DB4F2A', '#0500DB', '#09DB9B', '#B4001B', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])
...@@ -46,10 +128,10 @@ B = (u/(2*np.pi))/c ...@@ -46,10 +128,10 @@ B = (u/(2*np.pi))/c
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 #anchos de linea de las transiciones gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 #anchos de linea de las transiciones
lw = 0.1 #ancho de linea de los laseres en MHz lw = 0.5 #ancho de linea de los laseres en MHz
DopplerLaserLinewidth, ProbeLaserLinewidth = lw, lw #ancho de linea de los laseres DopplerLaserLinewidth, ProbeLaserLinewidth = lw, lw #ancho de linea de los laseres
DetDoppler = -15 #detuning doppler en MHz DetDoppler = -24.5 #detuning doppler en MHz
T = 0.1e-3 #temperatura en K T = 0.1e-3 #temperatura en K
alpha = 0 #angulo entre los láseres alpha = 0 #angulo entre los láseres
...@@ -64,18 +146,18 @@ CircPr = 1 ...@@ -64,18 +146,18 @@ CircPr = 1
#Parametros de la simulacion cpt todo en MHz #Parametros de la simulacion cpt todo en MHz
center = -15 center = -15
span = 30 span = 80
freqMin = center-span*0.5 freqMin = center-span*0.5
freqMax = center+span*0.5 freqMax = center+span*0.5
freqStep = 0.5 freqStep = 0.25
print(freqMin,freqMax,freqStep) print(freqMin,freqMax,freqStep)
noiseamplitude = 0 noiseamplitude = 0
#parametros de saturacion de los laseres. g: doppler. p: probe (un rebombeo que scanea), r: repump (otro rebombeo fijo) #parametros de saturacion de los laseres. g: doppler. p: probe (un rebombeo que scanea), r: repump (otro rebombeo fijo)
sg = 0.3 sg = 0.25
sp = 3 sp = 5.0
drivefreq=2*np.pi*22.135*1e6 drivefreq=2*np.pi*22.135*1e6
...@@ -97,17 +179,17 @@ Tvec = np.linspace(0.5e-3,100e-3,15) ...@@ -97,17 +179,17 @@ Tvec = np.linspace(0.5e-3,100e-3,15)
#Tvec = np.linspace(0.001,0.1,20) #Tvec = np.linspace(0.001,0.1,20)
s12vec = np.linspace(0.2,0.6,20) s12vec = np.linspace(0.2,0.6,20)
#s12vec = [s12vec[2],s12vec[4],s12vec[10],s12vec[18]] #s12vec = [s12vec[2],s12vec[4],s12vec[10],s12vec[18]]
s12vec = [0.28] s12vec = [0.51]
s23vec = np.linspace(0.5,15,20) s23vec = np.linspace(0.5,15,20)
#s23vec = [s23vec[2],s23vec[6],s23vec[10],s23vec[18]] #s23vec = [s23vec[2],s23vec[6],s23vec[10],s23vec[18]]
s23vec = [10] s23vec = [3.5]
Tmat = np.zeros((len(s12vec),len(s23vec))) Tmat = np.zeros((len(s12vec),len(s23vec)))
Tvec_ajuste = np.zeros(len(Tvec)) Tvec_ajuste = np.zeros(len(Tvec))
phivect = 0 phivect = 0
T = 10e-3 T = 8e-3
titavect = np.linspace(0,2*np.pi,100) titavect = np.linspace(0,2*np.pi,100)
...@@ -115,58 +197,134 @@ betag = 0 ...@@ -115,58 +197,134 @@ betag = 0
betap = 0 betap = 0
alpha = 0 alpha = 0
SCALE = 5.60485992e+04
SCALE = 1
OFFSET = 0
OFFSET = 1.55401398e+02
Freq,Fluo_sb = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = False) Freq,Fluo_sb = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = False)
Freq,Fluo_boltz = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = True) Freq,Fluo_boltz = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = False, boltzmann = True)
T = 0.8e-3
Freq,Fluo_deph = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = True, boltzmann = False) Freq,Fluo_deph = PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, betag, betap, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, dephasing = True, boltzmann = False)
#%%
plt.plot(Freq,Fluo_boltz,label = 'Velocities') plt.plot(Freq,SCALE*Fluo_boltz+OFFSET,label = 'Semiclassic')
plt.plot(Freq,Fluo_sb,label = 'Sideband') plt.plot(Freq,SCALE*Fluo_sb+OFFSET,label = 'Sideband')
plt.plot(Freq,Fluo_deph, label = 'Dephasing') plt.plot(Freq,SCALE*Fluo_deph+OFFSET, label = 'Dephasing')
plt.legend() plt.legend()
#%% #%%
os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20230920_CPT_TemperatureSens_v2/Data/') from scipy.optimize import curve_fit
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.5
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 4
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, TEMP,f0):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
BETA1 = 0
BETA2 = 0
Detunings, Fluorescence1 = PerformExperiment_8levels(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=np.array(freqs)-f0)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
popt_1 = [4.82483692e-01, 8.18685518e+00, 6.48238914e+04, 1.54835760e+02, 5.56566519e-03, 5.24515673e-18]
do_fit = True
if do_fit:
#popt_1, pcov_1 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.2, 5, 6.89e4, 1.2723, 8e-3,1], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 7e4, 5e4, 15e-3,5)))
FittedEITpi_1 = FitEIT_MM_single(freqslong, *popt_1)
beta1 = popt_1[4]
errorbeta1 = np.sqrt(pcov_1[4,4])
temp1 = popt_1[5]
errortemp1 = np.sqrt(pcov_1[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_1, color='darkolivegreen', linewidth=3, label='med 1')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
CPT_FILES = """000011345-IR_Scan_withcal_optimized
000011331-IR_Scan_withcal_optimized
"""
for i in range(0,9):
CPT_FILES = CPT_FILES + f'0000153{19 + i}-IR_Scan_withcal_optimized\n'
CPT_FILES = CPT_FILES
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(CPT_FILES))
Counts = []
Freqs = []
AmpTisa = []
UVCPTAmp = []
No_measures = []
for i, fname in enumerate(CPT_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']['IR1_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']))
...@@ -250,7 +250,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3): ...@@ -250,7 +250,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3):
kboltzmann = 1.38e-23 #J/K kboltzmann = 1.38e-23 #J/K
gammaD = (2*np.pi)*np.sqrt((1/(wlg*wlg)) + (1/(wlp*wlp)) - 2*(1/(wlg*wlp))*np.cos(alpha))*np.sqrt(kboltzmann*T/(2*mcalcio)) gammaD = (2*np.pi)*np.sqrt((1/(wlg*wlg)) + (1/(wlp*wlp)) - 2*(1/(wlg*wlp))*np.cos(alpha))*np.sqrt(kboltzmann*T/(mcalcio))
return gammaD return gammaD
...@@ -264,10 +264,16 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp ...@@ -264,10 +264,16 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp
""" """
kg = 397e9
kp = 866e9
fg = kg**2/(kg**2+kp**2)
fp = kp**2/(kg**2+kp**2)
db = dopplerBroadening(0.397e-6, 0.866e-6, alpha, T) db = dopplerBroadening(0.397e-6, 0.866e-6, alpha, T)
lwg = np.sqrt(lwg**2 + (db/2)**2)/2 lwg = np.sqrt(lwg**2 + (fg*db)**2)
lwp = np.sqrt(lwp**2 + (db/2)**2)/2 lwp = np.sqrt(lwp**2 + (fp*db)**2)
...@@ -306,15 +312,18 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp ...@@ -306,15 +312,18 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp
M = CalculateSingleMmatrix(gPS, gPD, lwg, lwp) M = CalculateSingleMmatrix(gPS, gPD, lwg, lwp)
L0 = np.array(np.matrix(Lfullpartial) + M) L0 = np.array(np.matrix(Lfullpartial) + M)
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax = 7
#print(nmax)
Ltemp, Omega = LtempCalculus(betag,betap, drivefreq)
#print(factor)
L1 = GetL1(Ltemp, L0, Omega, nmax)
Lfull = L0 + L1 #ESA CORRECCION ESTA EN L1
#HASTA ACA
if betag !=0 and betap !=0:
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax = 2*int(betag)
#print(nmax)
Ltemp, Omega = LtempCalculus(betag,betap, drivefreq)
#print(factor)
L1 = GetL1(Ltemp, L0, Omega, nmax)
Lfull = L0 + L1 #ESA CORRECCION ESTA EN L1
#HASTA ACA
else:
Lfull = L0
#NORMALIZACION DE RHO #NORMALIZACION DE RHO
i = 0 i = 0
while i < 64: while i < 64:
...@@ -422,6 +431,9 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp ...@@ -422,6 +431,9 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp
else: else:
DetProbeVector = detpvec*1e6 * 2*np.pi DetProbeVector = detpvec*1e6 * 2*np.pi
Detg = 2*np.pi*Detg*1e6 Detg = 2*np.pi*Detg*1e6
#lwg, lwr, lwp = 2*np.pi*lwg*1e6, 2*np.pi*lwr*1e6, 2*np.pi*lwp*1e6 #lwg, lwr, lwp = 2*np.pi*lwg*1e6, 2*np.pi*lwr*1e6, 2*np.pi*lwp*1e6
...@@ -463,7 +475,7 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp ...@@ -463,7 +475,7 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp
plt.plot(DetProbeVectorMHz, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK') plt.plot(DetProbeVectorMHz, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK')
plt.legend() plt.legend()
return DetProbeVectorMHz, Fluovector return DetProbeVectorMHz, np.array(Fluovector)
def CPTspectrum8levels_vel(velvect,titavec,phivec,probvel,sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidoppler, titadoppler, phiprobe, titaprobe, Circularityprobe, beta, drivefreq, freqMin=-100, freqMax=100, freqStep=1e-1, plot=False, solvemode=1): def CPTspectrum8levels_vel(velvect,titavec,phivec,probvel,sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidoppler, titadoppler, phiprobe, titaprobe, Circularityprobe, beta, drivefreq, freqMin=-100, freqMax=100, freqStep=1e-1, plot=False, solvemode=1):
...@@ -613,7 +625,7 @@ def CPTspectrum8levels_vel(velvect,titavec,phivec,probvel,sg, sp, gPS, gPD, Detg ...@@ -613,7 +625,7 @@ def CPTspectrum8levels_vel(velvect,titavec,phivec,probvel,sg, sp, gPS, gPD, Detg
plt.plot(DetProbeVectorMHz, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK') plt.plot(DetProbeVectorMHz, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK')
plt.legend() plt.legend()
return DetProbeVectorMHz, Fluovector return DetProbeVectorMHz, np.array(Fluovector)
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -24,7 +24,7 @@ CPT_FILES = """000016262-IR_Scan_withcal_optimized ...@@ -24,7 +24,7 @@ CPT_FILES = """000016262-IR_Scan_withcal_optimized
000016255-IR_Scan_withcal_optimized 000016255-IR_Scan_withcal_optimized
000016256-IR_Scan_withcal_optimized 000016256-IR_Scan_withcal_optimized
000016257-IR_Scan_withcal_optimized 000016257-IR_Scan_withcal_optimized
""" """
def SeeKeys(files): def SeeKeys(files):
...@@ -89,7 +89,7 @@ CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4]))) ...@@ -89,7 +89,7 @@ CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
Ploteo la cpt de referencia / plotting the reference CPT Ploteo la cpt de referencia / plotting the reference CPT
""" """
jvec = [4] # de la 1 a la 9 vale la pena, despues no jvec = [2] # de la 1 a la 9 vale la pena, despues no
drs = [390.5, 399.5, 406, 413.5] drs = [390.5, 399.5, 406, 413.5]
...@@ -147,7 +147,7 @@ correccion = 13 ...@@ -147,7 +147,7 @@ correccion = 13
offsetxpi = 419+correccion+3*0.8 offsetxpi = 419+correccion+3*0.8
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -173,7 +173,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -173,7 +173,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -234,7 +234,7 @@ correccion = 13 ...@@ -234,7 +234,7 @@ correccion = 13
offsetxpi = 419+correccion+1.6 offsetxpi = 419+correccion+1.6
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -259,7 +259,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -259,7 +259,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -323,7 +323,7 @@ DetDoppler = -11.5-correccion ...@@ -323,7 +323,7 @@ DetDoppler = -11.5-correccion
print(offsetxpi,DetDoppler) print(offsetxpi,DetDoppler)
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -347,7 +347,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -347,7 +347,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -409,7 +409,7 @@ correccion = 13 ...@@ -409,7 +409,7 @@ correccion = 13
offsetxpi = 419+correccion offsetxpi = 419+correccion
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -433,7 +433,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -433,7 +433,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -496,7 +496,7 @@ correccion = 13 ...@@ -496,7 +496,7 @@ correccion = 13
offsetxpi = 419+correccion-1 offsetxpi = 419+correccion-1
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -520,7 +520,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -520,7 +520,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
#TEMP = 0.2e-3 #TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -578,10 +578,10 @@ u = 32.5e6 ...@@ -578,10 +578,10 @@ u = 32.5e6
correccion = 13 correccion = 13
offsetxpi = 419+correccion-2.2 offsetxpi = 419+correccion-2.2
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -607,7 +607,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -607,7 +607,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -669,7 +669,7 @@ correccion = 13 ...@@ -669,7 +669,7 @@ correccion = 13
offsetxpi = 419+correccion-3.7 offsetxpi = 419+correccion-3.7
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -693,7 +693,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -693,7 +693,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -755,7 +755,7 @@ correccion = 13 ...@@ -755,7 +755,7 @@ correccion = 13
offsetxpi = 419+correccion-4.9 offsetxpi = 419+correccion-4.9
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -779,7 +779,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -779,7 +779,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -843,7 +843,7 @@ correccion = 16 ...@@ -843,7 +843,7 @@ correccion = 16
offsetxpi = 419+correccion-6 offsetxpi = 419+correccion-6
DetDoppler = -11.5-correccion DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -867,7 +867,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP): ...@@ -867,7 +867,7 @@ def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
#TEMP = 0.2e-3 #TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
...@@ -899,10 +899,13 @@ plt.grid() ...@@ -899,10 +899,13 @@ plt.grid()
#%% #%%
""" """
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
La 0 no ajusta bien incluso con todos los parametros libres
De la 1 a la 11 ajustan bien
""" """
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels from EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
from scipy.optimize import curve_fit from scipy.optimize import curve_fit
import time import time
...@@ -935,15 +938,15 @@ correccion = 13 ...@@ -935,15 +938,15 @@ correccion = 13
#DetDoppler = -11.5-correccion #DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
drivefreq = 2*np.pi*22.135*1e6 drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [1,2,3,4,5,6,7,8,9] SelectedCurveVec = [1,2,3,4,5,6,7,8,9,10,11]
#SelectedCurveVec = [9] #SelectedCurveVec = [10]
popt_SA_vec = [] popt_SA_vec = []
pcov_SA_vec = [] pcov_SA_vec = []
...@@ -960,7 +963,7 @@ ErrorTemp_vec = [] ...@@ -960,7 +963,7 @@ ErrorTemp_vec = []
DetuningsUV_vec = [] DetuningsUV_vec = []
ErrorDetuningsUV_vec = [] ErrorDetuningsUV_vec = []
for selectedcurve in SelectedCurveVec: for selectedcurve in SelectedCurveVec:
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION #selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
...@@ -979,55 +982,61 @@ for selectedcurve in SelectedCurveVec: ...@@ -979,55 +982,61 @@ for selectedcurve in SelectedCurveVec:
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77]) CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7: if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118]) CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0])) freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1 CircPr = 1
alpha = 0 alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, plot=False):
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, U, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1): #def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8 #BETA = 1.8
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs] freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, U, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot: if plot:
return ScaledFluo1, Detunings return ScaledFluo1, Detunings
else: else:
return ScaledFluo1 return ScaledFluo1
#return ScaledFluo1 #return ScaledFluo1
do_fit = True do_fit = True
if do_fit: if do_fit:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3], bounds=((0, -50, 0, 0, 0, 0, 0, 0), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3))) <<<<<<< HEAD
print(1)
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 0, 0, 31e6), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3, 34e6)))
print(2)
=======
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 0, 0, 25e6), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3, 40e6)))
>>>>>>> f197671e6d2f5bc2c74f8d1e8fb4a89fb518ddbe
popt_SA_vec.append(popt_3_SA) popt_SA_vec.append(popt_3_SA)
pcov_SA_vec.append(pcov_3_SA) pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True) FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0])) freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True) FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True)
DetuningsUV_vec.append(popt_3_SA[1]) DetuningsUV_vec.append(popt_3_SA[1])
ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1])) ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
Betas_vec.append(popt_3_SA[6]) Betas_vec.append(popt_3_SA[6])
ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6])) ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
Temp_vec.append(popt_3_SA[7]) Temp_vec.append(popt_3_SA[7])
ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7])) ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
Detuningsshort_vec.append(Detunings_3_SA_short) Detuningsshort_vec.append(Detunings_3_SA_short)
Counts_vec.append(CountsDR) Counts_vec.append(CountsDR)
Detuningslong_vec.append(Detunings_3_SA_long) Detuningslong_vec.append(Detunings_3_SA_long)
FittedCounts_vec.append(FittedEITpi_3_SA_long) FittedCounts_vec.append(FittedEITpi_3_SA_long)
plt.figure() plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2) plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}') plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
...@@ -1036,11 +1045,11 @@ for selectedcurve in SelectedCurveVec: ...@@ -1036,11 +1045,11 @@ for selectedcurve in SelectedCurveVec:
plt.ylabel('Counts') plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20) plt.legend(loc='upper left', fontsize=20)
plt.grid() plt.grid()
print(f'listo med {selectedcurve}') print(f'listo med {selectedcurve}')
print(popt_3_SA) print(popt_3_SA)
#%% #%%
""" """
Grafico distintas variables que salieron del SUper ajuste Grafico distintas variables que salieron del SUper ajuste
...@@ -1049,7 +1058,10 @@ Grafico distintas variables que salieron del SUper ajuste ...@@ -1049,7 +1058,10 @@ Grafico distintas variables que salieron del SUper ajuste
import seaborn as sns import seaborn as sns
paleta = sns.color_palette("rocket") paleta = sns.color_palette("rocket")
voltages_dcA = Voltages[0][1:10] medfin = 11
voltages_dcA = Voltages[0][1:medfin]
def lineal(x,a,b): def lineal(x,a,b):
return a*x+b return a*x+b
...@@ -1060,12 +1072,19 @@ def hiperbola(x,a,b,c,x0): ...@@ -1060,12 +1072,19 @@ def hiperbola(x,a,b,c,x0):
hiperbola_or_linear = True hiperbola_or_linear = True
if hiperbola_or_linear: if hiperbola_or_linear:
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15)) <<<<<<< HEAD
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA[0:9],Betas_vec[0:9],p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200) xhip = np.linspace(-0.23,0.055,200)
=======
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec[:medfin-1],p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
>>>>>>> f197671e6d2f5bc2c74f8d1e8fb4a89fb518ddbe
plt.figure() plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1]) plt.errorbar(voltages_dcA,Betas_vec[0:medfin-1],yerr=ErrorBetas_vec[:medfin-1],fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip)) plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)') plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor') plt.ylabel('Modulation factor')
...@@ -1074,13 +1093,13 @@ if hiperbola_or_linear: ...@@ -1074,13 +1093,13 @@ if hiperbola_or_linear:
else: else:
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3]) poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:]) poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100) xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100) xfin = np.linspace(-0.15,0.005,100)
plt.figure() plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1]) plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini)) plt.plot(xini,lineal(xini,*poptini))
...@@ -1094,9 +1113,10 @@ else: ...@@ -1094,9 +1113,10 @@ else:
print([t*1e3 for t in Temp_vec]) print([t*1e3 for t in Temp_vec])
plt.figure() plt.figure()
plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec],yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3]) plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec[:medfin-1]],yerr=[t*1e3 for t in ErrorTemp_vec[:medfin-1]],fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey') #plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.axhline(0.538) plt.axhline(0.538)
plt.yscale('log')
plt.xlabel('Endcap voltage (V)') plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)') plt.ylabel('Temperature (mK)')
plt.grid() plt.grid()
...@@ -1111,47 +1131,158 @@ sino que esta a una distancia d ...@@ -1111,47 +1131,158 @@ sino que esta a una distancia d
def hiperbola(x,a,b,c,x0): def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b return a*np.sqrt(((x-x0)**2+c**2))+b
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15)) medfin = 11
voltages_dcA = Voltages[0][1:medfin]
xhip = np.linspace(-0.23,0.005,200)
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA[:10],Betas_vec[:10],p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.055,200)
plt.figure() plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1]) plt.errorbar(voltages_dcA,Betas_vec[:medfin-1],yerr=ErrorBetas_vec[:medfin-1],fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip)) plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)') plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor') plt.ylabel('Modulation factor')
#plt.yscale('log')
plt.grid() plt.grid()
#%% #%%
from scipy.special import jv
def expo(x,tau,A,B): def expo(x,tau,A,B):
return A*np.exp(x/tau)+B return A*np.exp(x/tau)+B
def cuadratica(x,a,c): def cuadratica(x,a,c):
return a*(x**2)+c return a*(x**2)+c
def InverseMicromotionSpectra(beta, A, det, x0, gamma, B):
ftrap=22.1
#gamma=30
P = ((jv(0, beta)**2)/((((det-x0)**2)+(0.5*gamma)**2)**2))*(-2*(det-x0))
i = 1
#print(P)
while i <= 5:
P = P + (-2*(det-x0))*((jv(i, beta))**2)/(((((det-x0)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det-x0))*(((jv(-i, beta))**2)/((((det-x0)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
#return 1/(A*P+B)
return 1/(A*P+B)
def MicromotionSpectra(beta,det, gamma):
ftrap=22.1
#gamma=23
P = (jv(0, beta)**2)/(((det)**2)+(0.5*gamma)**2)
i = 1
#print(P)
while i <= 5:
P = P + ((jv(i, beta))**2)/((((det)+i*ftrap)**2)+(0.5*gamma)**2) + ((jv(-i, beta))**2)/((((det)-i*ftrap)**2)+(0.5*gamma)**2)
i = i + 1
#print(P)
return P
def polynomial(x,a,b,c,d,e):
b=0
d=0
return a+b*x+c*x*x+d*x*x*x+e*x*x*x*x
def InverseDerivMicromotionSpectra(beta, det, gamma):
ftrap=22.1
#gamma=23
#det = -gamma/2
P = ((jv(0, beta)**2)/((((det)**2)+(0.5*gamma)**2)**2))*(-2*(det))
i = 1
#print(P)
while i <= 5:
P = P + (-2*(det))*((jv(i, beta))**2)/(((((det)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det))*(((jv(-i, beta))**2)/((((det)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
return 1/P
def FinalTemp(beta,det, C,D):
gamma = 21
#det=-11
#D=-0.8
#C = 1.68656122e-03
#D = 6.64227010e-02
#C=0
#print(MicromotionSpectra(beta,det,gamma))
return (C*MicromotionSpectra(beta,det,gamma)+D*beta**2)*InverseDerivMicromotionSpectra(beta, det, gamma)
#return (C*MicromotionSpectra(beta,det,gamma))*InverseDerivMicromotionSpectra(beta, det, gamma)
""" """
Temperatura vs beta con un aju8ste exponencial Temperatura vs beta con un ajuste exponencial
""" """
popt_exp, pcov_exp = curve_fit(expo,Betas_vec,[t*1e3 for t in Temp_vec])
popt_quad, pcov_quad = curve_fit(cuadratica,Betas_vec,[t*1e3 for t in Temp_vec],p0=(1,10))
popt_exp, pcov_exp = curve_fit(expo,Betas_vec[:9],[t*1e3 for t in Temp_vec[:9]])
#popt_quad, pcov_quad = curve_fit(cuadratica,Betas_vec[:11],[t*1e3 for t in Temp_vec[:11]],p0=(1,10))
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec,[t*1e3 for t in Temp_vec],p0=(10,10,-10,1,20)) #esto ajusta muy bien
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec, [t*1e3 for t in Temp_vec],p0=(-10,-10,10,1,20)) #esto ajusta muy bien
#popt_rho22_raw, pcov_rho22_raw = curve_fit(InverseMicromotionSpectra_raw,Betas_vec[:7], [t*1e3 for t in Temp_vec[:7]],p0=(-0.1, -10, 1)) #esto ajusta muy bien
popt_rho22_balance, pcov_rho22_balance = curve_fit(FinalTemp,Betas_vec[:9], [t*1e3 for t in Temp_vec[:9]],p0=(-10, 10,1)) #esto ajusta muy bien
popt_rho22_poly, pcov_rho22_poly = curve_fit(polynomial,Betas_vec[:9], [t*1e3 for t in Temp_vec[:9]],p0=(1,2,3,4,10)) #esto ajusta muy bien
print(popt_rho22_balance)
betaslong = np.arange(0,2.8,0.01)
print(f'Min temp predicted: {FinalTemp(betaslong,*popt_rho22_balance)[0]}')
print(f'Detuning: {popt_rho22_balance[0]} MHz')
print(f'rho22 coeff: {popt_rho22_balance[1]}')
print(f'betasquared coeff: {popt_rho22_balance[2]}')
betaslong = np.arange(0,2.7,0.01) print(f'cociente de los coeff: {popt_rho22_balance[2]/popt_rho22_balance[1]}')
print(f'params: {popt_rho22_balance}')
print(f'errores: {np.sqrt(np.diag(pcov_rho22_balance))}')
k_plot = 9
plt.figure() plt.figure()
plt.errorbar(Betas_vec,[t*1e3 for t in Temp_vec],xerr=ErrorBetas_vec, yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3]) plt.errorbar(Betas_vec[:k_plot],[t*1e3 for t in Temp_vec[:k_plot]],xerr=ErrorBetas_vec[:k_plot], yerr=[t*1e3 for t in ErrorTemp_vec[:k_plot]],fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.plot(betaslong,expo(betaslong,*popt_exp),label='Ajuste exponencial') #plt.plot(betaslong,expo(betaslong,*popt_exp),label='Ajuste exponencial')
plt.plot(betaslong,cuadratica(betaslong,*popt_quad),label='Ajuste cuadratico') plt.plot(betaslong,polynomial(betaslong,*popt_rho22_poly),label='Ajuste exponencial')
#plt.plot(betaslong,cuadratica(betaslong,*popt_quad),label='Ajuste cuadratico')
#plt.plot(betaslong,InverseMicromotionSpectra(betaslong,*popt_rho22),label='Ajuste cuadratico')
plt.plot(betaslong,FinalTemp(betaslong,popt_rho22_balance[0],popt_rho22_balance[1],popt_rho22_balance[2]*1),label='Ajuste con espectro modulado')
# plt.xlim(-0.1,1.1)
#plt.ylim(0,1)
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey') #plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
#plt.axhline(0.538) #plt.axhline(0.538)
plt.xlabel('Modulation factor') plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)') plt.ylabel('Temperature (mK)')
plt.legend()
plt.grid() plt.grid()
#%%
hbar=1.05e-34
gammita = 22.1e6
kx = 2*np.pi/(0.397e-6)
kb = 1.38e-23
masita = 6.6e-26
coeff = gammita*hbar*hbar*kx*kx/(6*kb*masita)
print(coeff)
rfheatrate = coeff*popt_rho22_balance[2]/popt_rho22_balance[1]
print(f'heating rate due to rf heating: {rfheatrate*1e3} mK/s')
#%% #%%
""" """
...@@ -1307,8 +1438,8 @@ for j in jvec: ...@@ -1307,8 +1438,8 @@ for j in jvec:
plt.plot([f-f_2 for f in Freqs6[0:i_2]], [scale_2*c for c in Counts6[0:i_2]],'o') plt.plot([f-f_2 for f in Freqs6[0:i_2]], [scale_2*c for c in Counts6[0:i_2]],'o')
plt.plot(Freqs7, Counts7,'o') plt.plot(Freqs7, Counts7,'o')
plt.errorbar(Merged_freqs, Merged_counts, yerr=np.sqrt(Merged_counts), fmt='o', capsize=2, markersize=2) plt.errorbar(Merged_freqs, Merged_counts, yerr=np.sqrt(Merged_counts), fmt='o', capsize=2, markersize=2)
i = i + 1 i = i + 1
plt.xlabel('Frecuencia (MHz)') plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts') plt.ylabel('counts')
...@@ -1317,7 +1448,7 @@ for dr in drs: ...@@ -1317,7 +1448,7 @@ for dr in drs:
plt.axvline(dr) plt.axvline(dr)
plt.axvline(dr+drive, color='red', linestyle='dashed', alpha=0.3) plt.axvline(dr+drive, color='red', linestyle='dashed', alpha=0.3)
plt.axvline(dr-drive, color='red', linestyle='dashed', alpha=0.3) plt.axvline(dr-drive, color='red', linestyle='dashed', alpha=0.3)
plt.legend() plt.legend()
#%% #%%
...@@ -1352,7 +1483,7 @@ offsetxpi = 438+correccion ...@@ -1352,7 +1483,7 @@ offsetxpi = 438+correccion
DetDoppler = -35-correccion-22 DetDoppler = -35-correccion-22
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -1374,14 +1505,14 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, SCALE3, OFFSET, BETA1, BETA2, BETA3 ...@@ -1374,14 +1505,14 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, SCALE3, OFFSET, BETA1, BETA2, BETA3
# SP = 8.1 # SP = 8.1
TEMP = 0.1e-3 TEMP = 0.1e-3
#BETA1, BETA2, BETA3 = 0, 0, 2 #BETA1, BETA2, BETA3 = 0, 0, 2
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence3 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA3, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence3 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA3, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2]) ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
ScaledFluo3 = np.array([f*SCALE3 for f in Fluorescence3]) ScaledFluo3 = np.array([f*SCALE3 for f in Fluorescence3])
...@@ -1479,7 +1610,7 @@ offsetxpi = 421+correccion ...@@ -1479,7 +1610,7 @@ offsetxpi = 421+correccion
DetDoppler = -16-correccion+5 DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -1500,9 +1631,9 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET): ...@@ -1500,9 +1631,9 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
TEMP = 0.1e-3 TEMP = 0.1e-3
BETA1, BETA2 = 3, 0 BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
...@@ -1593,7 +1724,7 @@ correccion = 13 ...@@ -1593,7 +1724,7 @@ correccion = 13
#DetDoppler = -11.5-correccion #DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -1605,29 +1736,29 @@ SelectedCurveVec = [3] ...@@ -1605,29 +1736,29 @@ SelectedCurveVec = [3]
popt_SA_vec_2ions = [] popt_SA_vec_2ions = []
pcov_SA_vec_2ions = [] pcov_SA_vec_2ions = []
for selectedcurve in SelectedCurveVec: for selectedcurve in SelectedCurveVec:
FreqsDR = Freqs[selectedcurve] FreqsDR = Freqs[selectedcurve]
CountsDR = Counts[selectedcurve] CountsDR = Counts[selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0])) freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1 CircPr = 1
alpha = 0 alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, SCALE2, OFFSET, BETA1, BETA2, TEMP, plot=False): def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, SCALE2, OFFSET, BETA1, BETA2, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1): #def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8 #BETA = 1.8
#SG = 0.6 #SG = 0.6
#SP = 8.1 #SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs] freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1]) ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2]) ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
if plot: if plot:
...@@ -1635,22 +1766,22 @@ for selectedcurve in SelectedCurveVec: ...@@ -1635,22 +1766,22 @@ for selectedcurve in SelectedCurveVec:
else: else:
return ScaledFluo1+ScaledFluo2 return ScaledFluo1+ScaledFluo2
#return ScaledFluo1 #return ScaledFluo1
do_fit = True do_fit = True
if do_fit: if do_fit:
popt_3_SA_2ions, pcov_3_SA_2ions = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[448, -42, 0.6, 8.1, 4e4, 4e4, 6e3, 1, 1.2, 0.5e-3], bounds=((0, -100,0, 0, 0,0,0,0,0, 0), (1000, 0, 2, 20,5e6, 5e6,5e4, 10, 10,10e-3))) popt_3_SA_2ions, pcov_3_SA_2ions = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[448, -42, 0.6, 8.1, 4e4, 4e4, 6e3, 1, 1.2, 0.5e-3], bounds=((0, -100,0, 0, 0,0,0,0,0, 0), (1000, 0, 2, 20,5e6, 5e6,5e4, 10, 10,10e-3)))
#popt_3_SA_2ions = [448, -42, 8e4, 6e3, 2, 0.5e-3] #popt_3_SA_2ions = [448, -42, 8e4, 6e3, 2, 0.5e-3]
popt_SA_vec_2ions.append(popt_3_SA_2ions) popt_SA_vec_2ions.append(popt_3_SA_2ions)
pcov_SA_vec_2ions.append(pcov_3_SA_2ions) pcov_SA_vec_2ions.append(pcov_3_SA_2ions)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA_2ions, plot=True) FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA_2ions, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0])) freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA_2ions, plot=True) FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA_2ions, plot=True)
plt.figure() plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2) plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}') plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
...@@ -1659,7 +1790,7 @@ for selectedcurve in SelectedCurveVec: ...@@ -1659,7 +1790,7 @@ for selectedcurve in SelectedCurveVec:
plt.ylabel('Counts') plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20) plt.legend(loc='upper left', fontsize=20)
plt.grid() plt.grid()
print(f'listo med {selectedcurve}') print(f'listo med {selectedcurve}')
print(popt_3_SA_2ions) print(popt_3_SA_2ions)
#print(f'Detdop:{popt_3_SA[1]},popt_3_SA:{popt[0]}') #print(f'Detdop:{popt_3_SA[1]},popt_3_SA:{popt[0]}')
...@@ -1701,7 +1832,7 @@ offsetxpi = 421+correccion ...@@ -1701,7 +1832,7 @@ offsetxpi = 421+correccion
DetDoppler = -16-correccion+5 DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0 alpha = 0
...@@ -1722,9 +1853,9 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET): ...@@ -1722,9 +1853,9 @@ def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
TEMP = 0.1e-3 TEMP = 0.1e-3
BETA1, BETA2 = 3, 0 BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
...@@ -1779,10 +1910,148 @@ plt.title(f'Corr:{correccion},DetD:{DetDoppler}') ...@@ -1779,10 +1910,148 @@ plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid() plt.grid()
#%%
"""
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
SUPER AJUSTE (SA)
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
#SelectedCurveVec = [1,2,3,4,5,6,7,8,9]
SelectedCurveVec = [0]
# popt_SA_vec = []
# pcov_SA_vec = []
# Detuningsshort_vec = []
# Counts_vec = []
# Detuningslong_vec = []
# FittedCounts_vec = []
# Betas_vec = []
# ErrorBetas_vec = []
# Temp_vec = []
# ErrorTemp_vec = []
# DetuningsUV_vec = []
# ErrorDetuningsUV_vec = []
for selectedcurve in SelectedCurveVec:
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
FreqsDR = Freqs[0]
CountsDR = CountsSplit[0][selectedcurve]
if selectedcurve==1:
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
if selectedcurve==2:
CountsDR[67]=0.5*(CountsDR[66]+CountsDR[68])
CountsDR[71]=0.5*(CountsDR[70]+CountsDR[72])
if selectedcurve==6:
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, U, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, U, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot:
return ScaledFluo1, Detunings
else:
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 0, 0, 25e6), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3, 40e6)))
# popt_SA_vec.append(popt_3_SA)
# pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True)
# DetuningsUV_vec.append(popt_3_SA[1])
# ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
# Betas_vec.append(popt_3_SA[6])
# ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
# Temp_vec.append(popt_3_SA[7])
# ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
# Detuningsshort_vec.append(Detunings_3_SA_short)
# Counts_vec.append(CountsDR)
# Detuningslong_vec.append(Detunings_3_SA_long)
# FittedCounts_vec.append(FittedEITpi_3_SA_long)
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
20 de dic 2023
@author: lolo
reingenieria del código que anda
MAPA de FUNCIONES
CPTspectrum8levels_MM
|--> FullL_MM => ndarray(64,64,np.complex_)
|--> dopplerBroadening => float
|--> EffectiveL => ndarray(8,8,np.complex_)
|--> H0matrix => ndarray(8,8,np.complex_)
|--> HImatrix => ndarray(8,8,np.complex_)
|--> CalculateSingleMmatrix => ndarray(64,64,np.complex_)
|--> LtempCalculus => ndarray,ndarray
|--> GetL1 => ndarray
"""
# pylint: disable=C0301,R0913,R0914,W0621
import time
import random
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter as sf
from numba import jit,njit
@njit
def PerformExperiment_8levels_MM(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobe, beta, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None):
"""
solvemode=1: resuelve con np.linalg.solve
solvemode=2: resuelve invirtiendo L con la funcion np.linalg.inv
"""
rta = CPTspectrum8levels_MM(sg, sp, gPS, gPD, DetDoppler, u,
DopplerLaserLinewidth, ProbeLaserLinewidth,
T, alpha, phidoppler, titadoppler, phiprobe,
titaprobe, circularityprobe, beta, drivefreq,
freqMin=freqMin, freqMax=freqMax, freqStep=freqStep,
plot=False, solvemode=1)
ProbeDetuningVectorL, Fluovector = rta
return ProbeDetuningVectorL, Fluovector
def GenerateNoisyCPT_MM(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobeVec, kg, kr, v0, drivefreq, freqMin, freqMax, freqStep, circularityprobe=1, plot=False, solvemode=1, detpvec=None, noiseamplitude=0.001):
"""
Genera un resultado de PerformExperiment_8levels_MM con ruido normal agregado
"""
nFrequencyvector, Fluovector = PerformExperiment_8levels_MM(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobeVec, kg, kr, v0, drivefreq, freqMin, freqMax, freqStep, circularityprobe, plot=False, solvemode=1, detpvec=None)
NoisyFluovector = [fluo+noiseamplitude*(2*random.random()-1) for fluo in Fluovector]
return nFrequencyvector, NoisyFluovector
def GenerateNoisyCPT_MM_fit(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobeVec, beta, drivefreq, freqs, circularityprobe=1, plot=False, solvemode=1, detpvec=None, noiseamplitude=0.001):
"""
Este no se qué hace
"""
Frequencyvector, Fluovector = PerformExperiment_8levels_MM(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, titaprobeVec, beta, drivefreq, freqs[0], freqs[-1], freqs[1]-freqs[0], circularityprobe, plot=False, solvemode=1, detpvec=None)
#NoisyFluovector = [fluo+noiseamplitude*(2*random.random()-1) for fluo in Fluovector]
return Frequencyvector, Fluovector
def SmoothNoisyCPT(Fluo, window=11, poly=3):
SmoothenFluo = sf(Fluo, window, poly)
return SmoothenFluo
#%% Estos son los auxiliares ###################################################
"""
Esta parte es la del modelo
"""
@njit
def make_diag(vec):
"Construye matris diagonal desde una lista o vector"
return np.eye(len(vec))*np.array(vec).reshape(-1,1)
# @njit
# def kron(a,b):
# "Hago el producto de Kronecker a mano"
# return np.vstack( [ np.hstack( [ a[k,j]*b for j in range(a.shape[1]) ] ) for k in range(a.shape[0])])
# @njit
# def kron(A, B):
# cola = A.shape[1]
# rowa = A.shape[0]
# colb = B.shape[1]
# rowb = B.shape[0]
#
# C = [[0] * (cola * colb) for _ in range(rowa * rowb) ]
#
# for i in range(rowa):
# for k in range(cola):
# for j in range(rowb):
# for l in range(colb):
# C[i * rowb + k][j * colb + l] = A[i][j] * B[k][l]
# return np.array(C)
import numba
@jit
def kron(A,B):
out=np.empty((A.shape[0],B.shape[0],A.shape[1],B.shape[1]),dtype=A.dtype)
for i in numba.prange(A.shape[0]):
for j in range(B.shape[0]):
for k in range(A.shape[1]):
for l in range(B.shape[1]):
out[i,j,k,l]=A[i,k]*B[j,l]
return out
@njit
def H0matrix(Detg, Detp, u):
"""
Calcula la matriz H0 en donde dr es el detuning del doppler, dp es el retuning
del repump y u es el campo magnético en Hz/Gauss.
Para esto se toma la energía del nivel P como 0
"""
eigenEnergies = (Detg-u, Detg+u, -u/3, u/3, Detp-6*u/5,
Detp-2*u/5, Detp+2*u/5, Detp+6*u/5)
#pagina 26 de Oberst. los lande del calcio son iguales a Bario.
# H0 = np.diag(eigenEnergies)
# H0 = np.eye(len(eigenEnergies))*np.array(eigenEnergies).reshape(-1,1)
H0 = make_diag(eigenEnergies)
return H0
@njit
def HImatrix(rabG, rabP, phidoppler, titadoppler, phiprobe, titaprobe, circularityprobe=1):
"""
Calcula la matriz de interacción Hsp + Hpd, en donde rabR es la frecuencia de rabi de
la transición Doppler SP, rabP es la frecuencia de rabi de la transición repump DP,
y las componentes ei_r y ei_p son las componentes de la polarización
del campo eléctrico incidente de doppler y repump respectivamente. Deben
estar normalizadas a 1
"""
HI = np.zeros((8, 8), dtype=np.complex_)
i, j = 1, 3
HI[i-1, j-1] = (rabG/np.sqrt(3)) * np.cos(titadoppler)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 1, 4
HI[i-1, j-1] = -(rabG/np.sqrt(3)) * np.sin(titadoppler)*np.exp(1j*phidoppler)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 2, 3
HI[i-1, j-1] = -(rabG/np.sqrt(3)) * np.sin(titadoppler)*np.exp(-1j*phidoppler)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 2, 4
HI[i-1, j-1] = -(rabG/np.sqrt(3)) * np.cos(titadoppler)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 3, 5
HI[i-1, j-1] = -(rabP/2) * np.sin(titaprobe)*(np.cos(phiprobe)-1j*np.sin(phiprobe)*circularityprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 3, 6
HI[i-1, j-1] = -(rabP/np.sqrt(3)) * np.cos(titaprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 3, 7
HI[i-1, j-1] = rabP/np.sqrt(12) * np.sin(titaprobe)*(np.cos(phiprobe)+1j*np.sin(phiprobe)*circularityprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 4, 6
HI[i-1, j-1] = -(rabP/np.sqrt(12)) * np.sin(titaprobe)*(np.cos(phiprobe)-1j*np.sin(phiprobe)*circularityprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 4, 7
HI[i-1, j-1] = -(rabP/np.sqrt(3)) * np.cos(titaprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
i, j = 4, 8
HI[i-1, j-1] = (rabP/2) * np.sin(titaprobe)*(np.cos(phiprobe)+1j*np.sin(phiprobe)*circularityprobe)
HI[j-1, i-1] = np.conjugate(HI[i-1, j-1])
return HI
# @jit
# def LtempCalculus(beta:float, drivefreq:float, forma=1):
# Hint = np.zeros((8, 8), dtype=np.complex_)
# ampg=beta*drivefreq
# ampr=beta*drivefreq*(397/866)
# Hint[0,0] = ampg
# Hint[1,1] = ampg
# Hint[4,4] = ampr
# Hint[5,5] = ampr
# Hint[6,6] = ampr
# Hint[7,7] = ampr
# if forma==1:
# Ltemp = np.zeros((64, 64), dtype=np.complex_)
# for r in range(8):
# for q in range(8):
# if r!=q:
# Ltemp[r*8+q][r*8+q] = (-1j)*(Hint[r,r] - Hint[q,q])
# if forma==2:
# # deltaKro = np.diag([1, 1, 1, 1, 1, 1, 1, 1])
# deltaKro = make_diag([1., 1., 1., 1., 1., 1., 1., 1.]).astype(np.complex_)
# # Ltemp = (-1j)*(np.kron(Hint, deltaKro) - np.kron(deltaKro, Hint))
# Ltemp = (-1j)*(kron(Hint, deltaKro) - kron(deltaKro, Hint))
# Omega = np.zeros((64, 64), dtype=np.complex_)
# for i in range(64):
# Omega[i, i] = (1j)*drivefreq
# return Ltemp, Omega
@njit
def LtempCalculus(beta:float, drivefreq:float, forma=1):
Hint = np.zeros((8, 8), dtype=np.complex_)
ampg=beta*drivefreq
ampr=beta*drivefreq*(397/866)
Hint[0,0] = ampg
Hint[1,1] = ampg
Hint[4,4] = ampr
Hint[5,5] = ampr
Hint[6,6] = ampr
Hint[7,7] = ampr
Ltemp = np.zeros((64, 64), dtype=np.complex_)
for r in range(8):
for q in range(8):
if r!=q:
Ltemp[r*8+q][r*8+q] = (-1j)*(Hint[r,r] - Hint[q,q])
Omega = np.zeros((64, 64), dtype=np.complex_)
for i in range(64):
Omega[i, i] = (1j)*drivefreq
return Ltemp, Omega
# LtempCalculus(0,1)
# raise ValueError('aaa')
@njit
def GetL1(Ltemp, L0, Omega, nmax):
"""
Devuelve Splus0 y Sminus0
"""
# Sp = (-1)*(np.matrix(np.linalg.inv(L0 - (nmax+1)*Omega))*0.5*np.matrix(Ltemp))
# Sm = (-1)*(np.matrix(np.linalg.inv(L0 + (nmax+1)*Omega))*0.5*np.matrix(Ltemp))
Sp = (-1)*np.linalg.inv(L0 - (nmax+1)*Omega).dot(0.5*Ltemp)
Sm = (-1)*np.linalg.inv(L0 + (nmax+1)*Omega).dot(0.5*Ltemp)
for n in list(range(nmax+1))[(nmax+1)::-1][0:len(list(range(nmax+1))[(nmax+1)::-1])-1]: #jaja esto solo es para que vaya de nmax a 1 bajando. debe haber algo mas facil pero kcio
# Sp = (-1)*(np.matrix(np.linalg.inv(L0 - n*Omega + (0.5*Ltemp*np.matrix(Sp))))*0.5*np.matrix(Ltemp))
# Sm = (-1)*(np.matrix(np.linalg.inv(L0 + n*Omega + (0.5*Ltemp*np.matrix(Sm))))*0.5*np.matrix(Ltemp))
Sp = (-1)*np.linalg.inv(L0 - n*Omega + (0.5*Ltemp.dot(Sp))).dot(0.5*Ltemp)
Sm = (-1)*np.linalg.inv(L0 + n*Omega + (0.5*Ltemp.dot(Sm))).dot(0.5*Ltemp)
# L1 = 0.5*np.matrix(Ltemp)*(np.matrix(Sp) + np.matrix(Sm))
L1 = 0.5*Ltemp.dot(Sp + Sm)
return L1
@njit
def EffectiveL(gPS, gPD, lwg, lwp):
"""
Siendo Heff = H + EffectiveL, calcula dicho EffectiveL que es (-0.5j)*sumatoria(CmDaga*Cm) que luego sirve para calcular el Liouvilliano
"""
Leff = np.zeros((8, 8), dtype=np.complex_)
Leff[0, 0] = 2*lwg
Leff[1, 1] = 2*lwg
Leff[2, 2] = ((2/3)+(1/3))*gPS + ((1/2) + (1/6) + (1/3))*gPD
Leff[3, 3] = ((2/3)+(1/3))*gPS + ((1/2) + (1/6) + (1/3))*gPD
Leff[4, 4] = 2*lwp
Leff[5, 5] = 2*lwp
Leff[6, 6] = 2*lwp
Leff[7, 7] = 2*lwp
return (-0.5j)*Leff
@njit
def CalculateSingleMmatrix(gPS, gPD, lwg, lwp):
"""
Si tomamos el Liuvilliano como L = (-j)*(Heff*deltak - Heffdaga*deltak) + sum(Mm),
esta funcion calcula dichos Mm, que tienen dimensión 64x64 ya que esa es la dimensión del L. Estas componentes
salen de hacer la cuenta a mano conociendo los Cm y considerando que Mm[8*(r-1)+s, 8*(k-1)+j] = Cm[r,l] + Cmdaga[j,s] = Cm[r,l] + Cm[s,j]
ya que los componentes de Cm son reales.
Esta M es la suma de las 8 matrices M.
"""
M = np.zeros((64, 64), dtype=np.complex_)
M[0,27] = (2/3)*gPS
M[9,18] = (2/3)*gPS
M[0,18] = (1/3)*gPS
M[1,19] = -(1/3)*gPS
M[8,26] = -(1/3)*gPS
M[9,27] = (1/3)*gPS
M[36,18] = (1/2)*gPD
M[37,19] = (1/np.sqrt(12))*gPD
M[44,26] = (1/np.sqrt(12))*gPD
M[45,27] = (1/6)*gPD
M[54,18] = (1/6)*gPD
M[55,19] = (1/np.sqrt(12))*gPD
M[62,26] = (1/np.sqrt(12))*gPD
M[63,27] = (1/2)*gPD
M[45,18] = (1/3)*gPD
M[46,19] = (1/3)*gPD
M[53,26] = (1/3)*gPD
M[54,27] = (1/3)*gPD
M[0,0] = 2*lwg
M[1,1] = 2*lwg
M[8,8] = 2*lwg
M[9,9] = 2*lwg
for k in [36, 37, 38, 39, 44, 45, 46, 47, 52, 53, 54, 55, 60, 61, 62, 63]:
M[k,k]=2*lwp
return M
@njit
def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3):
"""
Calcula el broadening extra semiclásico por temperatura considerando que el ion atrapado se mueve.
wlg es la longitud de onda doppler, wlp la longitud de onda repump, T la temperatura del ion en kelvin, y alpha (en rads) el ángulo
que forman ambos láseres.
"""
kboltzmann = 1.38e-23 #J/K
gammaD = (2*np.pi)*np.sqrt((1/(wlg*wlg)) + (1/(wlp*wlp)) - 2*(1/(wlg*wlp))*np.cos(alpha))*np.sqrt(kboltzmann*T/(1*mcalcio))
return gammaD
@njit
def FullL_MM(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp = 0,
phidoppler=0, titadoppler=0, phiprobe=0, titaprobe=0, beta=0,
drivefreq=2*np.pi*22.135*1e6, T = 0, alpha = 0, circularityprobe=1):
"""
Calcula el Liouvilliano total de manera explícita índice a índice. Suma aparte las componentes de las matrices M.
Es la más eficiente hasta ahora.
"""
db = dopplerBroadening(0.397e-6, 0.866e-6, alpha, T)
lwg = np.sqrt(lwg**2 + (0.83*db)**2)
lwp = np.sqrt(lwp**2 + (0.17*db)**2)
CC = EffectiveL(gPS, gPD, lwg, lwp)
Heff = H0matrix(Detg, Detp, u) + HImatrix(rabG, rabP, phidoppler, titadoppler, phiprobe, titaprobe, circularityprobe) + CC
# Heffdaga = np.matrix(Heff).getH()
Heffdaga = np.conj(np.transpose(Heff))
Lfullpartial = np.zeros((64, 64), dtype=np.complex_)
for r in range(8):
for q in range(8):
for k in range(8):
for j in range(8):
if j!=q and r!=k:
pass
elif j==q and r!=k:
if (r < 2 and k > 3) or (k < 2 and r > 3) or (r > 3 and k > 3) or (r==0 and k==1) or (r==1 and k==0) or (r==2 and k==3) or (r==3 and k==2):
#todo esto sale de analizar explicitamente la matriz y tratar de no calcular cosas de más que dan cero
pass
else:
Lfullpartial[r*8+q][k*8+j] = (-1j)*(Heff[r,k])
elif j!=q and r==k:
if (j < 2 and q > 3) or (q < 2 and j > 3) or (j > 3 and q > 3) or (j==0 and q==1) or (j==1 and q==0) or (j==2 and q==3) or (j==3 and q==2):
pass
else:
Lfullpartial[r*8+q][k*8+j] = (-1j)*(-Heffdaga[j,q])
else:
if Heff[r,k] == Heffdaga[j,q]:
pass
else:
Lfullpartial[r*8+q][k*8+j] = (-1j)*(Heff[r,k]-Heffdaga[j,q])
M = CalculateSingleMmatrix(gPS, gPD, lwg, lwp)
# L0 = np.array(np.matrix(Lfullpartial) + M)
L0 = Lfullpartial + M
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax = 3
#print(nmax)
Ltemp, Omega = LtempCalculus(beta, drivefreq)
#print(factor)
L1 = GetL1(Ltemp, L0, Omega, nmax)
Lfull = L0 + L1 #ESA CORRECCION ESTA EN L1
#HASTA ACA
#NORMALIZACION DE RHO
i = 0
while i < 64:
if i%9 == 0:
Lfull[0, i] = 1
else:
Lfull[0, i] = 0
i = i + 1
return Lfull
"""
Scripts para correr un experimento y hacer el análisis de los datos
"""
@njit
def CPTspectrum8levels_MM(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidoppler, titadoppler, phiprobe, titaprobe, Circularityprobe, beta, drivefreq, freqMin=-100, freqMax=100, freqStep=1e-1, plot=False, solvemode=1):
"""
ESTA ES LA FUNCION QUE ESTAMOS USANDO
Hace un experimento barriendo ángulos de repump con el angulo de doppler fijo.
solvemode=1: resuelve con np.linalg.solve
solvemode=2: resuelve invirtiendo L con la funcion np.linalg.inv
"""
phidoppler, titadoppler = phidoppler*(np.pi/180), titadoppler*(np.pi/180)
phiprobe, titaprobe = phiprobe*(np.pi/180), titaprobe*(np.pi/180)
DetProbeVector = 2*np.pi*np.arange(freqMin*1e6, freqMax*1e6+0*freqStep*1e6, freqStep*1e6)
Detg = 2*np.pi*Detg*1e6
#lwg, lwr, lwp = 2*np.pi*lwg*1e6, 2*np.pi*lwr*1e6, 2*np.pi*lwp*1e6
lwg, lwp = lwg*1e6, lwp*1e6
rabG = sg*gPS
rabP = sp*gPD
#u = 2*np.pi*u*1e6
Fluovector = []
# tinicial = time.time()
for Detp in DetProbeVector:
L = FullL_MM(rabG, rabP, gPS, gPD, Detg, Detp, u, lwg, lwp, phidoppler, titadoppler, phiprobe, titaprobe, beta, drivefreq, Temp, alpha, Circularityprobe)
# if solvemode == 1:
rhovectorized = np.linalg.solve(L, np.array([int(i==0) for i in range(64)],dtype=np.complex_))
Fluo = np.real(rhovectorized[18] + np.real(rhovectorized[27]))
Fluovector.append(Fluo)
# if solvemode == 2:
# Linv = np.linalg.inv(L)
# rhovectorized = [Linv[j][0] for j in range(len(Linv))]
# Fluo = np.real(rhovectorized[18] + np.real(rhovectorized[27])) #estos son los rho33 + rho44
# Fluovector.append(Fluo)
# tfinal = time.time()
# print('Done, Total time: ', round((tfinal-tinicial), 2), "s")
DetProbeVectorMHz = np.arange(freqMin, freqMax, freqStep)
# if plot:
# plt.xlabel('Probe detuning (MHz)')
# plt.ylabel('Fluorescence (A.U.)')
# plt.plot(DetProbeVectorMHz, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK')
# plt.legend()
return DetProbeVectorMHz, Fluovector
# @njit
# def lolo():
# L = FullL_MM(100,200,12,123,14)
# return np.linalg.solve(L, np.array([int(i==0) for i in range(64)],dtype=np.complex_))
# lolo()
# raise ValueError('áaa')
#%%
if __name__ == "__main__":
ub = 9.27e-24
h = 6.63e-34
c = (ub/h)*1e-4 #en unidades de MHz/G
B = 25 #campo magnetico en gauss
u = c*B
sg, sr, sp = 0.5, 1.5, 4 #parámetros de saturación del doppler y repump
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6 #anchos de linea de las transiciones
rabG, rabR, rabP = sg*gPS, sr*gPD, sp*gPD #frecuencias de rabi
lwg, lwr, lwp = 0.3, 0.3, 0.3 #ancho de linea de los laseres
Detg = -25
Detr = 20 #detuning del doppler y repump
Temp = 0.0e-3 #temperatura en K
alpha = 0*(np.pi/180) #angulo entre los láseres
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 90
phiprobe, titaprobe = 0, 90
plotCPT = False
freqMin = -50
freqMax = 50
freqStep = 5e-2
# Frequencyvector, Fluovector = CPTspectrum8levels_MM(rabG, rabR, rabP, gPS, gPD, Detg, Detr, u, lwg, lwr, lwp, Temp, alpha, phidoppler, titadoppler, phiprobe, titaprobe, phirepump, titarepump, freqMin=freqMin, freqMax=freqMax, freqStep=freqStep, plot=plotCPT, solvemode=1)
Frequencyvector, Fluovector = PerformExperiment_8levels_MM(0.9,6.2,135591138.92893547,8482300.164692441,-24.5,32500000.0,0.1,0.1,0.001,0,0,90,0,90,2.0,139078306.77442014,-54.39999999999998,26.26666666666671,0.6666666666666856,circularityprobe=1,plot=False,solvemode=1,detpvec=None)
plt.plot(Frequencyvector, [100*f for f in Fluovector], label=str(titaprobe) + 'º, T: ' + str(Temp*1e3) + ' mK')
plt.xlabel('Probe detuning (MHz)')
plt.ylabel('Fluorescence (A.U.)')
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Ploteo de datos y ajustes
@author: lolo
"""
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
#%% Importaciones extra
# /home/lolo/Dropbox/marce/LIAF/Trampa_anular/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
from Data.EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
PARAMETROS = np.load('PARAMETROS.npz',allow_pickle=True)
for var_name in PARAMETROS.keys():
globals()[var_name] = PARAMETROS[var_name]
print(f'loaded: {var_name}')
#%%
"""
Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
"""
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
folder = '../20231123_CPTconmicromocion3/Data/'
CPT_FILES = f"""
{folder}/000016262-IR_Scan_withcal_optimized
{folder}/000016239-IR_Scan_withcal_optimized
{folder}/000016240-IR_Scan_withcal_optimized
{folder}/000016241-IR_Scan_withcal_optimized
{folder}/000016244-IR_Scan_withcal_optimized
{folder}/000016255-IR_Scan_withcal_optimized
{folder}/000016256-IR_Scan_withcal_optimized
{folder}/000016257-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(CPT_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 = []
Voltages = []
for i, fname in enumerate(CPT_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']['IR1_Frequencies']))
Counts.append(np.array(data['datasets']['data_array']))
#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']))
Voltages.append(np.array(data['datasets']['scanning_voltages']))
def Split(array,n):
length=len(array)/n
splitlist = []
jj = 0
while jj<length:
partial = []
ii = 0
while ii < n:
partial.append(array[jj*n+ii])
ii = ii + 1
splitlist.append(partial)
jj = jj + 1
return splitlist
CountsSplit = []
CountsSplit.append(Split(Counts[0],len(Freqs[0])))
CountsSplit_2ions = []
CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
#%%
"""
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
La 0 no ajusta bien incluso con todos los parametros libres
De la 1 a la 11 ajustan bien
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
SUPER AJUSTE (SA)
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [1,2,3,4,5,6,7,8,9,10,11]
#SelectedCurveVec = [10]
# if not 'popt_SA_vec' in globals().keys() or len(popt_SA_vec)==0:
popt_SA_vec = []
pcov_SA_vec = []
Detuningsshort_vec = []
Counts_vec = []
Detuningslong_vec = []
FittedCounts_vec = []
Betas_vec = []
ErrorBetas_vec = []
Temp_vec = []
ErrorTemp_vec = []
DetuningsUV_vec = []
ErrorDetuningsUV_vec = []
for selectedcurve in SelectedCurveVec:
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
FreqsDR = Freqs[0]
CountsDR = CountsSplit[0][selectedcurve]
if selectedcurve==1:
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
if selectedcurve==2:
CountsDR[67]=0.5*(CountsDR[66]+CountsDR[68])
CountsDR[71]=0.5*(CountsDR[70]+CountsDR[72])
if selectedcurve==6:
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, U, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, U, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot:
return ScaledFluo1, Detunings
else:
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3, 32e6], bounds=((0, -50, 0, 0, 0, 0, 0, 0, 25e6), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3, 40e6)))
popt_SA_vec.append(popt_3_SA)
pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True)
DetuningsUV_vec.append(popt_3_SA[1])
ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
Betas_vec.append(popt_3_SA[6])
ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
Temp_vec.append(popt_3_SA[7])
ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
Detuningsshort_vec.append(Detunings_3_SA_short)
Counts_vec.append(CountsDR)
Detuningslong_vec.append(Detunings_3_SA_long)
FittedCounts_vec.append(FittedEITpi_3_SA_long)
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA)
#%%
"""
Grafico distintas variables que salieron del SUper ajuste
"""
import seaborn as sns
paleta = sns.color_palette("rocket")
medfin = 12
voltages_dcA = Voltages[0][1:medfin]
def lineal(x,a,b):
return a*x+b
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
hiperbola_or_linear = True
if hiperbola_or_linear:
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec[:medfin-1],p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec[0:medfin-1],yerr=ErrorBetas_vec[:medfin-1],fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
else:
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
print([t*1e3 for t in Temp_vec])
plt.figure()
plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec[:medfin-1]],yerr=[t*1e3 for t in ErrorTemp_vec[:medfin-1]],fmt='o',capsize=5,markersize=5,color=paleta[3])
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.axhline(0.538)
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
#plt.ylim(0,2)
#%%
"""
Ahora hago un ajuste con una hiperbola porque tiene mas sentido, por el hecho
de que en el punto optimo el ion no esta en el centro de la trampa
sino que esta a una distancia d
"""
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec[:10],p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec[:10],yerr=ErrorBetas_vec[:10],fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
from scipy.special import jv
def expo(x,tau,A,B):
return A*np.exp(x/tau)+B
def cuadratica(x,a,c):
return a*(x**2)+c
def InverseMicromotionSpectra(beta, A, det, x0, gamma, B):
ftrap=22.1
#gamma=30
P = ((jv(0, beta)**2)/((((det-x0)**2)+(0.5*gamma)**2)**2))*(-2*(det-x0))
i = 1
#print(P)
while i <= 5:
P = P + (-2*(det-x0))*((jv(i, beta))**2)/(((((det-x0)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det-x0))*(((jv(-i, beta))**2)/((((det-x0)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
#return 1/(A*P+B)
return 1/(A*P+B)
def InverseMicromotionSpectra_raw(beta, A, det, B):
ftrap=22.1
gamma=21
P = ((jv(0, beta)**2)/((((det)**2)+(0.5*gamma)**2)**2))*(-2*(det))
i = 1
#print(P)
while i <= 3:
P = P + (-2*(det))*((jv(i, beta))**2)/(((((det)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det))*(((jv(-i, beta))**2)/((((det)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
return A/P+B
"""
Temperatura vs beta con un ajuste exponencial
"""
popt_exp, pcov_exp = curve_fit(expo,Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]])
popt_quad, pcov_quad = curve_fit(cuadratica,Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]],p0=(1,10))
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec,[t*1e3 for t in Temp_vec],p0=(10,10,-10,1,20)) #esto ajusta muy bien
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec, [t*1e3 for t in Temp_vec],p0=(-10,-10,10,1,20)) #esto ajusta muy bien
popt_rho22_raw, pcov_rho22_raw = curve_fit(InverseMicromotionSpectra_raw,Betas_vec[:10], [t*1e3 for t in Temp_vec[:10]],p0=(-10, -10, 1)) #esto ajusta muy bien
print(popt_rho22_raw)
betaslong = np.arange(0,2*2.7,0.01)
print(f'Min temp predicted: {InverseMicromotionSpectra_raw(betaslong,*popt_rho22_raw)[100]}')
plt.figure()
plt.errorbar(Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]],xerr=ErrorBetas_vec[:10], yerr=[t*1e3 for t in ErrorTemp_vec[:10]],fmt='o',capsize=5,markersize=5,color=paleta[3])
#plt.plot(betaslong,expo(betaslong,*popt_exp),label='Ajuste exponencial')
#plt.plot(betaslong,cuadratica(betaslong,*popt_quad),label='Ajuste cuadratico')
#plt.plot(betaslong,InverseMicromotionSpectra(betaslong,*popt_rho22),label='Ajuste cuadratico')
plt.plot(betaslong,InverseMicromotionSpectra_raw(betaslong,*popt_rho22_raw),label='Ajuste cuadratico')
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
#plt.axhline(0.538)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Esto no es del super ajuste sino de los ajustes anteriores en donde DetDoppler y offset son puestos a mano
Aca grafico los betas con su error en funcion de la tension variada.
Ademas, hago ajuste lineal para primeros y ultimos puntos, ya que espero que
si la tension hace que la posicion del ion varie linealmente, el beta varia proporcional a dicha posicion.
"""
import seaborn as sns
def lineal(x,a,b):
return a*x+b
paleta = sns.color_palette("rocket")
betavector = [beta1,beta2,beta3,beta4,beta5,beta6,beta7,beta8,beta9]
errorbetavector = [errorbeta1,errorbeta2,errorbeta3,errorbeta4,errorbeta5,errorbeta6,errorbeta7,errorbeta8,errorbeta9]
voltages_dcA = Voltages[0][1:10]
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],betavector[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],betavector[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,betavector,yerr=errorbetavector,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
"""
Aca veo la temperatura del ion en funcion del voltaje del endcap, ya que
al cambiar la cantidad de micromocion, cambia la calidad del enfriado
"""
tempvector = np.array([temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9])*1e3
errortempvector = np.array([errortemp1,errortemp2,errortemp3,errortemp4,errortemp5,errortemp6,errortemp7,errortemp8,errortemp9])*1e3
voltages_dcA = Voltages[0][1:10]
plt.figure()
plt.errorbar(voltages_dcA,tempvector,yerr=errortempvector,fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
plt.ylim(0,2)
#%%
"""
Por las dudas, temperatura en funcion de beta
"""
plt.figure()
plt.errorbar(betavector,tempvector,yerr=errortempvector,xerr=errorbetavector,fmt='o',capsize=5,markersize=5)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Si quiero ver algun parametro del ajuste puntual. el orden es: 0:SG, 1:SP, 2:SCALE1, 3:OFFSET
"""
ki=2
plt.errorbar(np.arange(0,9,1),[popt_1[ki],popt_2[ki],popt_3[ki],popt_4[ki],popt_5[ki],popt_6[ki],popt_7[ki],popt_8[ki],popt_9[ki]],yerr=[np.sqrt(pcov_1[ki,ki]),np.sqrt(pcov_2[ki,ki]),np.sqrt(pcov_3[ki,ki]),np.sqrt(pcov_4[ki,ki]),np.sqrt(pcov_5[ki,ki]),np.sqrt(pcov_6[ki,ki]),np.sqrt(pcov_7[ki,ki]),np.sqrt(pcov_8[ki,ki]),np.sqrt(pcov_9[ki,ki])], fmt='o',capsize=3,markersize=3)
#%%
if False:
GUARDAR = {}
for var in [ kk for kk in globals().keys() if kk.startswith('pop') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.startswith('pcov') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.startswith('Fitted') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.endswith('_vec') ]:
print(var)
GUARDAR[var] = globals()[var]
np.savez('PARAMETROS.npz', **GUARDAR )
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Ploteo de datos y ajustes
@author: lolo
"""
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
#%% Importaciones extra
# /home/lolo/Dropbox/marce/LIAF/Trampa_anular/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
from Data.EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
PARAMETROS = np.load('PARAMETROS.npz',allow_pickle=True)
for var_name in PARAMETROS.keys():
globals()[var_name] = PARAMETROS[var_name]
print(f'loaded: {var_name}')
#%%
"""
Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
"""
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
# os.chdir('../20231123_CPTconmicromocion3/Data/')
folder = '../20231123_CPTconmicromocion3/Data/'
CPT_FILES = f"""
{folder}/000016262-IR_Scan_withcal_optimized
{folder}/000016239-IR_Scan_withcal_optimized
{folder}/000016240-IR_Scan_withcal_optimized
{folder}/000016241-IR_Scan_withcal_optimized
{folder}/000016244-IR_Scan_withcal_optimized
{folder}/000016255-IR_Scan_withcal_optimized
{folder}/000016256-IR_Scan_withcal_optimized
{folder}/000016257-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(CPT_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 = []
Voltages = []
for i, fname in enumerate(CPT_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']['IR1_Frequencies']))
Counts.append(np.array(data['datasets']['data_array']))
#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']))
Voltages.append(np.array(data['datasets']['scanning_voltages']))
def Split(array,n):
length=len(array)/n
splitlist = []
jj = 0
while jj<length:
partial = []
ii = 0
while ii < n:
partial.append(array[jj*n+ii])
ii = ii + 1
splitlist.append(partial)
jj = jj + 1
return splitlist
CountsSplit = []
CountsSplit.append(Split(Counts[0],len(Freqs[0])))
CountsSplit_2ions = []
CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
#%%
"""
Ploteo la cpt de referencia / plotting the reference CPT
"""
jvec = [9] # de la 1 a la 9 vale la pena, despues no
drs = [390.5, 399.5, 406, 413.5]
drive=22.1
Frequencies = Freqs[0]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Frequencies], CountsSplit[0][j], yerr=np.sqrt(CountsSplit[0][j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 1
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+3*0.8
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 1
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
t0 = time.time()
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
# print(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], dict(circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None))
print('Done, Total time: ', round((time.time()-t0), 2), "s")
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_1' in globals().keys():
popt_1, pcov_1 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_1 = FitEIT_MM_single(freqslong, *popt_1)
beta1 = popt_1[4]
errorbeta1 = np.sqrt(pcov_1[4,4])
temp1 = popt_1[5]
errortemp1 = np.sqrt(pcov_1[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_1, color='darkolivegreen', linewidth=3, label='med 1')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 2
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+1.6
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 2
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_2' in globals().keys():
popt_2, pcov_2 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_2 = FitEIT_MM_single(freqslong, *popt_2)
beta2 = popt_2[4]
errorbeta2 = np.sqrt(pcov_2[4,4])
temp2 = popt_2[5]
errortemp2 = np.sqrt(pcov_2[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2, color='darkolivegreen', linewidth=3, label='med 2')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 3
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+0.8
DetDoppler = -11.5-correccion
print(offsetxpi,DetDoppler)
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 3
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_3' in globals().keys():
popt_3, pcov_3 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_3 = FitEIT_MM_single(freqslong, *popt_3)
beta3 = popt_3[4]
errorbeta3 = np.sqrt(pcov_3[4,4])
temp3 = popt_3[5]
errortemp3 = np.sqrt(pcov_3[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_3, color='darkolivegreen', linewidth=3, label='med 3')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 4
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 4
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_4' in globals().keys():
popt_4, pcov_4 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_4 = FitEIT_MM_single(freqslong, *popt_4)
beta4 = popt_4[4]
errorbeta4 = np.sqrt(pcov_4[4,4])
temp4 = popt_4[5]
errortemp4 = np.sqrt(pcov_4[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_4, color='darkolivegreen', linewidth=3, label='med 4')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 5
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-1
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 5
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
#TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_5' in globals().keys():
popt_5, pcov_5 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_5 = FitEIT_MM_single(freqslong, *popt_5)
beta5 = popt_5[4]
errorbeta5 = np.sqrt(pcov_5[4,4])
temp5 = popt_5[5]
errortemp5 = np.sqrt(pcov_5[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_5, color='darkolivegreen', linewidth=3, label='med 5')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 6
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-2.2
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_6' in globals().keys():
popt_6, pcov_6 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 5e4, 1e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_6 = FitEIT_MM_single(freqslong, *popt_6)
beta6 = popt_6[4]
errorbeta6 = np.sqrt(pcov_6[4,4])
temp6 = popt_6[5]
errortemp6 = np.sqrt(pcov_6[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_6, color='darkolivegreen', linewidth=3, label='med 6')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 7
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-3.7
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 7
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_7' in globals().keys():
popt_7, pcov_7 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_7 = FitEIT_MM_single(freqslong, *popt_7)
beta7 = popt_7[4]
errorbeta7 = np.sqrt(pcov_7[4,4])
temp7 = popt_7[5]
errortemp7 = np.sqrt(pcov_7[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_7, color='darkolivegreen', linewidth=3, label='med 7')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 8
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-4.9
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 8
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_8' in globals().keys():
popt_8, pcov_8 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_8 = FitEIT_MM_single(freqslong, *popt_8)
beta8 = popt_8[4]
errorbeta8 = np.sqrt(pcov_8[4,4])
temp8 = popt_8[5]
errortemp8 = np.sqrt(pcov_8[5,5])
print()
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_8, color='darkolivegreen', linewidth=3, label='med 8')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 9
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 16
offsetxpi = 419+correccion-6
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 9
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
#TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
if not 'popt_9' in globals().keys():
popt_9, pcov_9 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10,10e-3)))
FittedEITpi_9 = FitEIT_MM_single(freqslong, *popt_9)
beta9 = popt_9[4]
errorbeta9 = np.sqrt(pcov_9[4,4])
temp9 = popt_9[5]
errortemp9 = np.sqrt(pcov_9[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_9, color='darkolivegreen', linewidth=3, label='med 9')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
"""
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
La 0 no ajusta bien incluso con todos los parametros libres
De la 1 a la 11 ajustan bien
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
SUPER AJUSTE (SA)
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [1,2,3,4,5,6,7,8,9,10,11]
#SelectedCurveVec = [10]
if not 'popt_SA_vec' in globals().keys() or len(popt_SA_vec)==0:
popt_SA_vec = []
pcov_SA_vec = []
Detuningsshort_vec = []
Counts_vec = []
Detuningslong_vec = []
FittedCounts_vec = []
Betas_vec = []
ErrorBetas_vec = []
Temp_vec = []
ErrorTemp_vec = []
DetuningsUV_vec = []
ErrorDetuningsUV_vec = []
for selectedcurve in SelectedCurveVec:
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
FreqsDR = Freqs[0]
CountsDR = CountsSplit[0][selectedcurve]
if selectedcurve==1:
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
if selectedcurve==2:
CountsDR[67]=0.5*(CountsDR[66]+CountsDR[68])
CountsDR[71]=0.5*(CountsDR[70]+CountsDR[72])
if selectedcurve==6:
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot:
return ScaledFluo1, Detunings
else:
return ScaledFluo1
#return ScaledFluo1
if True:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3], bounds=((0, -50, 0, 0, 0, 0, 0, 0), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3)))
popt_SA_vec.append(popt_3_SA)
pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True)
DetuningsUV_vec.append(popt_3_SA[1])
ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
Betas_vec.append(popt_3_SA[6])
ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
Temp_vec.append(popt_3_SA[7])
ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
Detuningsshort_vec.append(Detunings_3_SA_short)
Counts_vec.append(CountsDR)
Detuningslong_vec.append(Detunings_3_SA_long)
FittedCounts_vec.append(FittedEITpi_3_SA_long)
tmp_datos=(Detuningsshort_vec,Counts_vec,Detuningslong_vec,FittedCounts_vec,SelectedCurveVec)
for Detunings_3_SA_short,CountsDR,Detunings_3_SA_long,FittedEITpi_3_SA_long,selectedcurve in zip(*tmp_datos):
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA)
#%%
"""
Grafico distintas variables que salieron del SUper ajuste
"""
import seaborn as sns
paleta = sns.color_palette("rocket")
voltages_dcA = Voltages[0][1:10]
def lineal(x,a,b):
return a*x+b
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
hiperbola_or_linear = True
if hiperbola_or_linear:
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
else:
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
print([t*1e3 for t in Temp_vec])
plt.figure()
plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec],yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3])
# plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
print(f'\n\nTE FALTA DEFINIR LA VARIABLE minimum_voltage\n\n')
plt.axhline(0.538)
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
#plt.ylim(0,2)
#%%
"""
Ahora hago un ajuste con una hiperbola porque tiene mas sentido, por el hecho
de que en el punto optimo el ion no esta en el centro de la trampa
sino que esta a una distancia d
"""
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
from scipy.special import jv
def expo(x,tau,A,B):
return A*np.exp(x/tau)+B
def cuadratica(x,a,c):
return a*(x**2)+c
def InverseMicromotionSpectra(beta, A, det, x0, gamma, B):
ftrap=22.1
#gamma=30
P = ((jv(0, beta)**2)/((((det-x0)**2)+(0.5*gamma)**2)**2))*(-2*(det-x0))
i = 1
#print(P)
while i <= 5:
P = P + (-2*(det-x0))*((jv(i, beta))**2)/(((((det-x0)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det-x0))*(((jv(-i, beta))**2)/((((det-x0)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
#return 1/(A*P+B)
return 1/(A*P+B)
def InverseMicromotionSpectra_raw(beta, A, det, B):
ftrap=22.1
gamma=21
P = ((jv(0, beta)**2)/((((det)**2)+(0.5*gamma)**2)**2))*(-2*(det))
i = 1
#print(P)
while i <= 3:
P = P + (-2*(det))*((jv(i, beta))**2)/(((((det)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det))*(((jv(-i, beta))**2)/((((det)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
return A/P+B
"""
Temperatura vs
"""
popt_exp, pcov_exp = curve_fit(expo,Betas_vec,[t*1e3 for t in Temp_vec])
betaslong = np.arange(0,2.7,0.01)
plt.figure()
plt.errorbar(Betas_vec,[t*1e3 for t in Temp_vec],xerr=ErrorBetas_vec, yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.plot(betaslong,expo(betaslong,*popt_exp))
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
#plt.axhline(0.538)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Esto no es del super ajuste sino de los ajustes anteriores en donde DetDoppler y offset son puestos a mano
Aca grafico los betas con su error en funcion de la tension variada.
Ademas, hago ajuste lineal para primeros y ultimos puntos, ya que espero que
si la tension hace que la posicion del ion varie linealmente, el beta varia proporcional a dicha posicion.
"""
import seaborn as sns
def lineal(x,a,b):
return a*x+b
paleta = sns.color_palette("rocket")
betavector = [beta1,beta2,beta3,beta4,beta5,beta6,beta7,beta8,beta9]
errorbetavector = [errorbeta1,errorbeta2,errorbeta3,errorbeta4,errorbeta5,errorbeta6,errorbeta7,errorbeta8,errorbeta9]
voltages_dcA = Voltages[0][1:10]
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],betavector[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],betavector[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,betavector,yerr=errorbetavector,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
"""
Aca veo la temperatura del ion en funcion del voltaje del endcap, ya que
al cambiar la cantidad de micromocion, cambia la calidad del enfriado
"""
tempvector = np.array([temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9])*1e3
errortempvector = np.array([errortemp1,errortemp2,errortemp3,errortemp4,errortemp5,errortemp6,errortemp7,errortemp8,errortemp9])*1e3
voltages_dcA = Voltages[0][1:10]
plt.figure()
plt.errorbar(voltages_dcA,tempvector,yerr=errortempvector,fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
plt.ylim(0,2)
#%%
"""
Por las dudas, temperatura en funcion de beta
"""
plt.figure()
plt.errorbar(betavector,tempvector,yerr=errortempvector,xerr=errorbetavector,fmt='o',capsize=5,markersize=5)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Si quiero ver algun parametro del ajuste puntual. el orden es: 0:SG, 1:SP, 2:SCALE1, 3:OFFSET
"""
ki=2
plt.errorbar(np.arange(0,9,1),[popt_1[ki],popt_2[ki],popt_3[ki],popt_4[ki],popt_5[ki],popt_6[ki],popt_7[ki],popt_8[ki],popt_9[ki]],yerr=[np.sqrt(pcov_1[ki,ki]),np.sqrt(pcov_2[ki,ki]),np.sqrt(pcov_3[ki,ki]),np.sqrt(pcov_4[ki,ki]),np.sqrt(pcov_5[ki,ki]),np.sqrt(pcov_6[ki,ki]),np.sqrt(pcov_7[ki,ki]),np.sqrt(pcov_8[ki,ki]),np.sqrt(pcov_9[ki,ki])], fmt='o',capsize=3,markersize=3)
#%%
"""
AHORA VAMOS A MEDICIONES CON MAS DE UN ION!!!
"""
"""
Ploteo la cpt de referencia / plotting the reference CPT
1: 2 iones, -100 mV dcA
2: 2 iones, -150 mV dcA
3: 2 iones, -50 mV dcA
4: 2 iones, 5 voltajes (el ion se va en la 4ta medicion y en la 5ta ni esta)
5, 6 y 7: 3 iones en donde el scaneo esta centrado en distintos puntos
"""
jvec = [3] # desde la 1, pero la 4 no porque es un merge de curvitas
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
"""
Mergeo la 5, 6 y 7
"""
Freqs5 = [2*f*1e-6 for f in Freqs[5]]
Freqs6 = [2*f*1e-6 for f in Freqs[6]]
Freqs7 = [2*f*1e-6 for f in Freqs[7]]
Counts5 = Counts[5]
Counts6 = Counts[6]
Counts7 = Counts[7]
i_1_ini = 0
i_1 = 36
i_2_ini = 0
i_2 = 24
f_1 = 18
f_2 = 30
scale_1 = 0.92
scale_2 = 0.98
#Merged_freqs_test = [f-f_2 for f in Freqs6[i_2_ini:i_2]]+[f-f_1 for f in Freqs5[i_1_ini:i_1]]+Freqs7
#plt.plot(Merged_freqs_test,'o')
Merged_freqs = [f-f_2 for f in Freqs6[0:i_2]]+[f-f_1 for f in Freqs5[0:i_1]]+Freqs7
Merged_counts = [scale_2*c for c in Counts6[0:i_2]]+[scale_1*c for c in Counts5[0:i_1]]+list(Counts7)
Merged_freqs_rescaled = np.linspace(np.min(Merged_freqs),np.max(Merged_freqs),len(Merged_freqs))
#drs = [391.5, 399.5, 405.5, 414]
drs = [370,379,385,391.5]
plt.figure()
i = 0
for j in jvec:
plt.plot([f-f_1 for f in Freqs5[0:i_1]], [scale_1*c for c in Counts5[0:i_1]],'o')
plt.plot([f-f_2 for f in Freqs6[0:i_2]], [scale_2*c for c in Counts6[0:i_2]],'o')
plt.plot(Freqs7, Counts7,'o')
plt.errorbar(Merged_freqs, Merged_counts, yerr=np.sqrt(Merged_counts), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
for dr in drs:
plt.axvline(dr)
plt.axvline(dr+drive, color='red', linestyle='dashed', alpha=0.3)
plt.axvline(dr-drive, color='red', linestyle='dashed', alpha=0.3)
plt.legend()
#%%
"""
ajusto la mergeada de 3 iones
"""
raise ValueError('STOP')
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = -20
offsetxpi = 438+correccion
DetDoppler = -35-correccion-22
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [f-offsetxpi for f in Merged_freqs]
CountsDR = Merged_counts
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
import numba
@numba.jit
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, SCALE3, OFFSET, BETA1, BETA2, BETA3):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
#BETA1, BETA2, BETA3 = 0, 0, 2
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence3 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA3, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
ScaledFluo3 = np.array([f*SCALE3 for f in Fluorescence3])
return ScaledFluo1+ScaledFluo2+ScaledFluo3+OFFSET
#return ScaledFluo1
if not 'popt_3ions' in globals().keys():
popt_3ions, pcov_3ions = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.6, 6.2, 3.5e5, 3.5e5, 3.5e5, 2e3, 1, 1, 1], bounds=((0, 0, 0, 0, 0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 5e8, 7e3, 10, 10, 10)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_3ions = FitEIT_MM(freqslong, *popt_3ions)
#FittedEITpi_3ions = FitEIT_MM(freqslong, popt_3ions[0],popt_3ions[1],popt_3ions[2],popt_3ions[3],popt_3ions[4],popt_3ions[5],4,2,0)
#FittedEITpi_3ions = FitEIT_MM(freqslong, *popt_3ions)
print(popt_3ions)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_3ions, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
#%%
"""
Veo la medicion de varios voltajes uno atras de otro
Se va en medio de la medicion 4, y en la 5 ni esta
"""
jvec = [2] # desde la 1, pero la 4 no porque es un merge de curvitas
Freqs
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[4]], CountsSplit_2ions[0][j], yerr=np.sqrt(CountsSplit_2ions[0][j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
AJUSTO LA CPT DE 2 IONES CON UN MODELO EN DONDE SUMO DOS ESPECTROS CON BETAS DISTINTOS
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 27
offsetxpi = 421+correccion
DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[1]]
CountsDR = Counts[1]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 + OFFSET for f in Fluorescence2])
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
if not 'popt_2ions_1' in globals().keys():
popt_2ions_1, pcov_2ions_1 = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.9, 6.2, 3.5e3, 2.9e3, 3e3], bounds=((0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 8e3)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_2sp = FitEIT_MM(freqslong, *popt_2ions_1)
#FittedEITpi = FitEIT_MM(freqslong, 0.8, 8, 4e4, 3.5e3, 0)
# beta1_2ions = popt_2ions_1[5]
# beta2_2ions = popt_2ions_1[6]
# errbeta1_2ions = np.sqrt(pcov_2ions_1[5,5])
# errbeta2_2ions = np.sqrt(pcov_2ions_1[6,6])
"""
Estos params dan bien poniendo beta2=0 y correccion=0 y son SG, SP, SCALE1, SCALE2, OFFSET, BETA1
#array([9.03123248e-01, 6.25865542e+00, 3.47684055e+04, 2.92076804e+04, 1.34556420e+03, 3.55045904e+00])
"""
"""
Ahora considerando ambos betas, con los parametros iniciales dados por los que se obtuvieron con beta2=0
y correccion=0 dan estos parametros que son los de antes pero con BETA2 incluido:
array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
"""
#arreglito = np.array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
FittedEITpi_2ions_1 = FitEIT_MM(freqslong, *popt_2ions_1)
print(popt_2ions_1)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2ions_1, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
#%%
"""
SUPER AJUSTE PARA MED DE 2 IONES
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [3]
if not 'popt_SA_vec_2ions' in globals().keys():
popt_SA_vec_2ions = []
pcov_SA_vec_2ions = []
for selectedcurve in SelectedCurveVec:
FreqsDR = Freqs[selectedcurve]
CountsDR = Counts[selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, SCALE2, OFFSET, BETA1, BETA2, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
#SG = 0.6
#SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
if plot:
return ScaledFluo1+ScaledFluo2, Detunings
else:
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
if True:
popt_3_SA_2ions, pcov_3_SA_2ions = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[448, -42, 0.6, 8.1, 4e4, 4e4, 6e3, 1, 1.2, 0.5e-3], bounds=((0, -100,0, 0, 0,0,0,0,0, 0), (1000, 0, 2, 20,5e6, 5e6,5e4, 10, 10,10e-3)))
#popt_3_SA_2ions = [448, -42, 8e4, 6e3, 2, 0.5e-3]
popt_SA_vec_2ions.append(popt_3_SA_2ions)
pcov_SA_vec_2ions.append(pcov_3_SA_2ions)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA_2ions, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA_2ions, plot=True)
raise ValueError('Acá tenes que levantar de nuevo los valores que van')
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA_2ions)
#print(f'Detdop:{popt_3_SA[1]},popt_3_SA:{popt[0]}')
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
AJUSTO LA CPT DE 2 IONES CON UN MODELO EN DONDE SUMO DOS ESPECTROS CON BETAS DISTINTOS
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 27
offsetxpi = 421+correccion
DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[1]]
CountsDR = Counts[1]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 + OFFSET for f in Fluorescence2])
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
if not 'popt_2ions_1' in globals().keys():
popt_2ions_1, pcov_2ions_1 = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.9, 6.2, 3.5e3, 2.9e3, 3e3], bounds=((0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 8e3)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_2sp = FitEIT_MM(freqslong, *popt_2ions_1)
#FittedEITpi = FitEIT_MM(freqslong, 0.8, 8, 4e4, 3.5e3, 0)
# beta1_2ions = popt_2ions_1[5]
# beta2_2ions = popt_2ions_1[6]
# errbeta1_2ions = np.sqrt(pcov_2ions_1[5,5])
# errbeta2_2ions = np.sqrt(pcov_2ions_1[6,6])
"""
Estos params dan bien poniendo beta2=0 y correccion=0 y son SG, SP, SCALE1, SCALE2, OFFSET, BETA1
#array([9.03123248e-01, 6.25865542e+00, 3.47684055e+04, 2.92076804e+04, 1.34556420e+03, 3.55045904e+00])
"""
"""
Ahora considerando ambos betas, con los parametros iniciales dados por los que se obtuvieron con beta2=0
y correccion=0 dan estos parametros que son los de antes pero con BETA2 incluido:
array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
"""
#arreglito = np.array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
FittedEITpi_2ions_1 = FitEIT_MM(freqslong, *popt_2ions_1)
print(popt_2ions_1)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2ions_1, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
#%%
if False:
GUARDAR = {}
for var in [ kk for kk in globals().keys() if kk.startswith('pop') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.startswith('pcov') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.startswith('Fitted') ]:
print(var)
GUARDAR[var] = globals()[var]
print('')
for var in [ kk for kk in globals().keys() if kk.endswith('_vec') ]:
print(var)
GUARDAR[var] = globals()[var]
np.savez('PARAMETROS.npz', **GUARDAR )
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Ploteo de datos y ajustes
@author: lolo
"""
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
from numba import jit,njit
from time import time
#%% Importaciones extra
# /home/lolo/Dropbox/marce/LIAF/Trampa_anular/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
from Data.EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
# PARAMETROS = np.load('PARAMETROS.npz',allow_pickle=True)
# for var_name in PARAMETROS.keys():
# globals()[var_name] = PARAMETROS[var_name]
# print(f'loaded: {var_name}')
# Funciones auxiliares
from scipy.stats.distributions import t,chi2
def estadistica(datos_x,datos_y,modelo,pcov,parametros,nombres=None,alpha=0.05):
if nombres is None:
nombres = [ f'{j}' for j in range(len(parametros)) ]
# Cantidad de parámetros
P = len(parametros)
# Número de datos
N = len(datos_x)
# Grados de libertas (Degrees Of Freedom)
dof = N-P-1
# Cauculamos coordenadas del modelo
# modelo_x = datos_x if modelo_x_arr is None else modelo_x_arr
# modelo_y = modelo( modelo_x, *parametros )
# Predicción del modelo para los datos_x medidos
prediccion_modelo = modelo( datos_x, *parametros )
# Calculos de cantidades estadísticas relevantes
COV = pcov # Matriz de Covarianza
SE = np.sqrt(np.diag( COV )) # Standar Error / Error estandar de los parámetros
residuos = datos_y - prediccion_modelo # diferencia enrte el modelo y los datos
SSE = sum(( residuos )**2 ) # Resitual Sum of Squares
SST = sum(( datos_y - np.mean(datos_y))**2) # Total Sum of Squares
# http://en.wikipedia.org/wiki/Coefficient_of_determination
# Expresa el porcentaje de la varianza que logra explicar el modelos propuesto
Rsq = 1 - SSE/SST # Coeficiente de determinación
Rsq_adj = 1-(1-Rsq) * (N-1)/(N-P-1) # Coeficiente de determinación Ajustado
# https://en.wikipedia.org/wiki/Pearson_correlation_coefficient#In_least_squares_regression_analysis
# Expresa la correlación que hay entre los datos y la predicción del modelo
r_pearson = np.corrcoef( datos_y , prediccion_modelo )[0,1]
# Reduced chi squared
# https://en.wikipedia.org/wiki/Reduced_chi-squared_statistic
chi2_ = sum( residuos**2 )/N
chi2_red = sum( residuos**2 )/(N-P)
# Chi squared test
chi2_test = sum( residuos**2 / abs(prediccion_modelo) )
# p-value del ajuste
p_val = chi2(dof).cdf( chi2_test )
sT = t.ppf(1.0 - alpha/2.0, N - P ) # student T multiplier
CI = sT * SE # Confidence Interval
print('R-squared ',Rsq)
print('R-sq_adjusted',Rsq_adj)
print('chi2 ',chi2_)
print('chi2_reduced ',chi2_red)
print('chi2_test ',chi2_test)
print('r-pearson ',r_pearson)
print('p-value ',p_val)
print('')
print('Error Estandard (SE):')
for i in range(P):
print(f'parametro[{nombres[i]:>5s}]: ' , parametros[i], ' ± ' , SE[i])
print('')
print('Intervalo de confianza al '+str((1-alpha)*100)+'%:')
for i in range(P):
print(f'parametro[{nombres[i]:>5s}]: ' , parametros[i], ' ± ' , CI[i])
return dict(R2=Rsq,R2_adj=Rsq_adj,chi2=chi2_,chi2_red=chi2_red,
chi2_test=chi2_test,r=r_pearson,pvalue=p_val,
SE=SE,CI=CI)
#%%
"""
Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
"""
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
# os.chdir('../20231123_CPTconmicromocion3/Data/')
folder = '../20231123_CPTconmicromocion3/Data/'
CPT_FILES = f"""
{folder}/000016262-IR_Scan_withcal_optimized
{folder}/000016239-IR_Scan_withcal_optimized
{folder}/000016240-IR_Scan_withcal_optimized
{folder}/000016241-IR_Scan_withcal_optimized
{folder}/000016244-IR_Scan_withcal_optimized
{folder}/000016255-IR_Scan_withcal_optimized
{folder}/000016256-IR_Scan_withcal_optimized
{folder}/000016257-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(CPT_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 = []
Voltages = []
for i, fname in enumerate(CPT_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']['IR1_Frequencies']))
Counts.append(np.array(data['datasets']['data_array']))
#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']))
Voltages.append(np.array(data['datasets']['scanning_voltages']))
def Split(array,n):
length=len(array)/n
splitlist = []
jj = 0
while jj<length:
partial = []
ii = 0
while ii < n:
partial.append(array[jj*n+ii])
ii = ii + 1
splitlist.append(partial)
jj = jj + 1
return splitlist
CountsSplit = []
CountsSplit.append(Split(Counts[0],len(Freqs[0])))
CountsSplit_2ions = []
CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
#%% Cargo parámetros fiteados de antes
PARAMETROS = np.load('analisis_superajuste_PARAMETROS.npz',allow_pickle=True)
for var_name in PARAMETROS.keys():
globals()[var_name] = PARAMETROS[var_name]
print(f'loaded: {var_name}')
if False:
# Esto es para correr en caso de necesidad de limpiar todos los vectores de parametros
print('Limpio los vectores de parámetros')
for var in [ kk for kk in globals().keys() if kk.endswith('_vec') ]:
print(f'del {var}')
del(globals()[var])
#%% Definiciones de Numba
@jit
def FitEIT_MM_single_plot(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u,
DopplerLaserLinewidth, ProbeLaserLinewidth,
TEMP, alpha, phidoppler, titadoppler,
phiprobe, titaprobe, BETA1, drivefreq,
min(freqs), max(freqs)+(freqs[1]-freqs[0]),
freqs[1]-freqs[0], circularityprobe=CircPr,
plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1, Detunings
@jit
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
"Esta verison de la función devuelve sólo el eje y, para usar de modelo en un ajuste"
return FitEIT_MM_single_plot(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP)[0]
param_names = 'offset DetDoppler SG SP SCALE1 OFFSET BETA1 TEMP'.split()
#%%
"""
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
La 0 no ajusta bien incluso con todos los parametros libres
De la 1 a la 11 ajustan bien
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
"""
SUPER AJUSTE (SA)
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [1,2,3,4,5,6,7,8,9,10,11]
#SelectedCurveVec = [10]
CircPr = 1
alpha = 0
t0 = time()
if not 'popt_SA_vec' in globals().keys() or len(popt_SA_vec)==0:
popt_SA_vec = []
pcov_SA_vec = []
Detuningsshort_vec = []
Counts_vec = []
Detuningslong_vec = []
FittedCounts_vec = []
Betas_vec = []
ErrorBetas_vec = []
Temp_vec = []
ErrorTemp_vec = []
DetuningsUV_vec = []
ErrorDetuningsUV_vec = []
Estadistica_vec = []
for selectedcurve in SelectedCurveVec:
print(f"{round(time()-t0,1):6.1f}: Procesando la curva {selectedcurve}")
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
FreqsDR = Freqs[0]
CountsDR = CountsSplit[0][selectedcurve]
if selectedcurve==1:
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
if selectedcurve==2:
CountsDR[67]=0.5*(CountsDR[66]+CountsDR[68])
CountsDR[71]=0.5*(CountsDR[70]+CountsDR[72])
if selectedcurve==6:
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
if True:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3], bounds=((0, -50, 0, 0, 0, 0, 0, 0), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3)))
popt_SA_vec.append(popt_3_SA)
pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single_plot(FreqsDR, *popt_3_SA)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single_plot(freqslong, *popt_3_SA)
# estadistica(datos_x,datos_y,modelo,pcov,parametros,nombres=None,alpha=0.05)
est_tmp = estadistica(FreqsDR,CountsDR,FitEIT_MM_single,pcov_3_SA,popt_3_SA,
nombres=param_names,alpha=0.05)
Estadistica_vec.append(est_tmp)
DetuningsUV_vec.append(popt_3_SA[1])
ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
Betas_vec.append(popt_3_SA[6])
ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
Temp_vec.append(popt_3_SA[7])
ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
Detuningsshort_vec.append(Detunings_3_SA_short)
Counts_vec.append(CountsDR)
Detuningslong_vec.append(Detunings_3_SA_long)
FittedCounts_vec.append(FittedEITpi_3_SA_long)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Graficamos todos los fiteos
# tmp_datos=(Detuningsshort_vec,Counts_vec,Detuningslong_vec,FittedCounts_vec,SelectedCurveVec)
# for Detunings_3_SA_short,CountsDR,Detunings_3_SA_long,FittedEITpi_3_SA_long,selectedcurve in zip(*tmp_datos):
# plt.figure()
# plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
# plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
# #plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
# plt.xlabel('Detuning (MHz)')
# plt.ylabel('Counts')
# plt.legend(loc='upper left', fontsize=20)
# plt.grid()
# print(f'listo med {selectedcurve}')
# print(popt_3_SA)
fig, axx = plt.subplots( 3,4, figsize=(13,8) , constrained_layout=True, sharex=True , sharey=True )
fig.set_constrained_layout_pads(w_pad=2/72, h_pad=2/72, hspace=0, wspace=0)
tmp_datos=(Detuningsshort_vec,Counts_vec,Detuningslong_vec,FittedCounts_vec,SelectedCurveVec,axx.flatten())
for Detunings_3_SA_short,CountsDR,Detunings_3_SA_long,FittedEITpi_3_SA_long,selectedcurve,ax in zip(*tmp_datos):
ax.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.3, capsize=2, markersize=2)
ax.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='black', linewidth=2, label=f'med {selectedcurve}', alpha=0.7)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
# ax.set_xlabel('Detuning (MHz)')
# ax.set_ylabel('Counts')
ax.legend(loc='upper left', fontsize=12)
ax.grid(True, ls=":")
print(f'listo med {selectedcurve}')
print(popt_3_SA)
for ax in axx[:,0]:
ax.set_ylabel('Counts')
for ax in axx[-1,:]:
ax.set_xlabel('Detuning (MHz)')
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Inspección de parámetros
param_names = 'offset DetDoppler SG SP SCALE1 OFFSET BETA1 TEMP'.split()
err_vecs = np.array([ np.sqrt(np.diag(el)) for el in pcov_SA_vec ])
num_med = np.arange(len(pcov_SA_vec)) +1
r2_values = np.array([ el['R2_adj'] for el in Estadistica_vec ])
fig, axx = plt.subplots( len(popt_SA_vec[0])+1,1, figsize=(13,8) , constrained_layout=True, sharex=True , sharey=False )
fig.set_constrained_layout_pads(w_pad=2/72, h_pad=2/72, hspace=0, wspace=0)
for ax,param_vec,err_vec,par_name in zip(axx,popt_SA_vec.T,err_vecs.T,param_names) :
ax.plot(num_med, param_vec, '.-')
ax.errorbar( num_med, param_vec, yerr=err_vec,
fmt='s', mfc='none', elinewidth = 1, capsize=3, ms=1)
ax.grid(True, ls=":", color='lightgray')
ax.set_ylabel(par_name)
ax=axx[-1]
ax.plot( num_med , r2_values, '.-')
ax.set_ylabel(r'$R^2$')
ax.grid(True, ls=":", color='lightgray')
fig.align_ylabels()
ax.set_xticks(num_med)
ax.set_xlabel('Num. de medición')
#%%
"""
Grafico distintas variables que salieron del SUper ajuste
"""
import seaborn as sns
paleta = sns.color_palette("rocket")
voltages_dcA = Voltages[0][1:10]
def lineal(x,a,b):
return a*x+b
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
hiperbola_or_linear = True
if hiperbola_or_linear:
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
else:
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
print([t*1e3 for t in Temp_vec])
plt.figure()
plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec],yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3])
# plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
print(f'\n\nTE FALTA DEFINIR LA VARIABLE minimum_voltage\n\n')
plt.axhline(0.538)
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
#plt.ylim(0,2)
#%%
"""
Ahora hago un ajuste con una hiperbola porque tiene mas sentido, por el hecho
de que en el punto optimo el ion no esta en el centro de la trampa
sino que esta a una distancia d
"""
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
from scipy.special import jv
def expo(x,tau,A,B):
return A*np.exp(x/tau)+B
def cuadratica(x,a,c):
return a*(x**2)+c
def InverseMicromotionSpectra(beta, A, det, x0, gamma, B):
ftrap=22.1
#gamma=30
P = ((jv(0, beta)**2)/((((det-x0)**2)+(0.5*gamma)**2)**2))*(-2*(det-x0))
i = 1
#print(P)
while i <= 5:
P = P + (-2*(det-x0))*((jv(i, beta))**2)/(((((det-x0)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det-x0))*(((jv(-i, beta))**2)/((((det-x0)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
#return 1/(A*P+B)
return 1/(A*P+B)
def InverseMicromotionSpectra_raw(beta, A, det, B):
ftrap=22.1
gamma=21
P = ((jv(0, beta)**2)/((((det)**2)+(0.5*gamma)**2)**2))*(-2*(det))
i = 1
#print(P)
while i <= 3:
P = P + (-2*(det))*((jv(i, beta))**2)/(((((det)+i*ftrap)**2)+(0.5*gamma)**2)**2) + (-2*(det))*(((jv(-i, beta))**2)/((((det)-i*ftrap)**2)+(0.5*gamma)**2)**2)
i = i + 1
#print(P)
return A/P+B
"""
Temperatura vs beta con un ajuste exponencial
"""
popt_exp, pcov_exp = curve_fit(expo,Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]])
popt_quad, pcov_quad = curve_fit(cuadratica,Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]],p0=(1,10))
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec,[t*1e3 for t in Temp_vec],p0=(10,10,-10,1,20)) #esto ajusta muy bien
#popt_rho22, pcov_rho22 = curve_fit(InverseMicromotionSpectra,Betas_vec, [t*1e3 for t in Temp_vec],p0=(-10,-10,10,1,20)) #esto ajusta muy bien
popt_rho22_raw, pcov_rho22_raw = curve_fit(InverseMicromotionSpectra_raw,Betas_vec[:10], [t*1e3 for t in Temp_vec[:10]],p0=(-10, -10, 1)) #esto ajusta muy bien
print(popt_rho22_raw)
betaslong = np.arange(0,2*2.7,0.01)
print(f'Min temp predicted: {InverseMicromotionSpectra_raw(betaslong,*popt_rho22_raw)[100]}')
plt.figure()
plt.errorbar(Betas_vec[:10],[t*1e3 for t in Temp_vec[:10]],xerr=ErrorBetas_vec[:10], yerr=[t*1e3 for t in ErrorTemp_vec[:10]],fmt='o',capsize=5,markersize=5,color=paleta[3])
#plt.plot(betaslong,expo(betaslong,*popt_exp),label='Ajuste exponencial')
#plt.plot(betaslong,cuadratica(betaslong,*popt_quad),label='Ajuste cuadratico')
#plt.plot(betaslong,InverseMicromotionSpectra(betaslong,*popt_rho22),label='Ajuste cuadratico')
plt.plot(betaslong,InverseMicromotionSpectra_raw(betaslong,*popt_rho22_raw),label='Ajuste cuadratico')
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
#plt.axhline(0.538)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Esto no es del super ajuste sino de los ajustes anteriores en donde DetDoppler y offset son puestos a mano
Aca grafico los betas con su error en funcion de la tension variada.
Ademas, hago ajuste lineal para primeros y ultimos puntos, ya que espero que
si la tension hace que la posicion del ion varie linealmente, el beta varia proporcional a dicha posicion.
"""
import seaborn as sns
def lineal(x,a,b):
return a*x+b
paleta = sns.color_palette("rocket")
betavector = [beta1,beta2,beta3,beta4,beta5,beta6,beta7,beta8,beta9]
errorbetavector = [errorbeta1,errorbeta2,errorbeta3,errorbeta4,errorbeta5,errorbeta6,errorbeta7,errorbeta8,errorbeta9]
voltages_dcA = Voltages[0][1:10]
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],betavector[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],betavector[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,betavector,yerr=errorbetavector,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
"""
Aca veo la temperatura del ion en funcion del voltaje del endcap, ya que
al cambiar la cantidad de micromocion, cambia la calidad del enfriado
"""
tempvector = np.array([temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9])*1e3
errortempvector = np.array([errortemp1,errortemp2,errortemp3,errortemp4,errortemp5,errortemp6,errortemp7,errortemp8,errortemp9])*1e3
voltages_dcA = Voltages[0][1:10]
plt.figure()
plt.errorbar(voltages_dcA,tempvector,yerr=errortempvector,fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
plt.ylim(0,2)
#%%
"""
Por las dudas, temperatura en funcion de beta
"""
plt.figure()
plt.errorbar(betavector,tempvector,yerr=errortempvector,xerr=errorbetavector,fmt='o',capsize=5,markersize=5)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Si quiero ver algun parametro del ajuste puntual. el orden es: 0:SG, 1:SP, 2:SCALE1, 3:OFFSET
"""
ki=2
plt.errorbar(np.arange(0,9,1),[popt_1[ki],popt_2[ki],popt_3[ki],popt_4[ki],popt_5[ki],popt_6[ki],popt_7[ki],popt_8[ki],popt_9[ki]],yerr=[np.sqrt(pcov_1[ki,ki]),np.sqrt(pcov_2[ki,ki]),np.sqrt(pcov_3[ki,ki]),np.sqrt(pcov_4[ki,ki]),np.sqrt(pcov_5[ki,ki]),np.sqrt(pcov_6[ki,ki]),np.sqrt(pcov_7[ki,ki]),np.sqrt(pcov_8[ki,ki]),np.sqrt(pcov_9[ki,ki])], fmt='o',capsize=3,markersize=3)
#%%
if False:
GUARDAR = {}
# for var in [ kk for kk in globals().keys() if kk.startswith('pop') ]:
# print(var)
# GUARDAR[var] = globals()[var]
# print('')
# for var in [ kk for kk in globals().keys() if kk.startswith('pcov') ]:
# print(var)
# GUARDAR[var] = globals()[var]
# print('')
# for var in [ kk for kk in globals().keys() if kk.startswith('Fitted') ]:
# print(var)
# GUARDAR[var] = globals()[var]
# print('')
for var in [ kk for kk in globals().keys() if kk.endswith('_vec') ]:
print(var)
GUARDAR[var] = globals()[var]
np.savez('analisis_superajuste_PARAMETROS.npz', **GUARDAR )
...@@ -413,14 +413,16 @@ for selectedcurve in selectedcurvevec: ...@@ -413,14 +413,16 @@ for selectedcurve in selectedcurvevec:
return ScaledFluo1+ScaledFluo2 return ScaledFluo1+ScaledFluo2
#return ScaledFluo1 #return ScaledFluo1
def FitEIT_MM_1ion(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, plot=False):
def FitEIT_MM_1ion(Freqs, offset1, offset2, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1): #def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8 #BETA = 1.8
# SG = 0.6 # SG = 0.6
# SP = 8.1 # SP = 8.1
# TEMP = 0.2e-3 # TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs] freqs = [2*f*1e-6-offset1 for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
#Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None) #Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
......
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
"""
Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
"""
#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/20231123_CPTconmicromocion3/Data/')
CPT_FILES = """000016262-IR_Scan_withcal_optimized
000016239-IR_Scan_withcal_optimized
000016240-IR_Scan_withcal_optimized
000016241-IR_Scan_withcal_optimized
000016244-IR_Scan_withcal_optimized
000016255-IR_Scan_withcal_optimized
000016256-IR_Scan_withcal_optimized
000016257-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(CPT_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 = []
Voltages = []
for i, fname in enumerate(CPT_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']['IR1_Frequencies']))
Counts.append(np.array(data['datasets']['data_array']))
#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']))
Voltages.append(np.array(data['datasets']['scanning_voltages']))
def Split(array,n):
length=len(array)/n
splitlist = []
jj = 0
while jj<length:
partial = []
ii = 0
while ii < n:
partial.append(array[jj*n+ii])
ii = ii + 1
splitlist.append(partial)
jj = jj + 1
return splitlist
CountsSplit = []
CountsSplit.append(Split(Counts[0],len(Freqs[0])))
CountsSplit_2ions = []
CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
#%%
"""
Ploteo la cpt de referencia / plotting the reference CPT
"""
jvec = [4] # de la 1 a la 9 vale la pena, despues no
drs = [390.5, 399.5, 406, 413.5]
drive=22.1
Frequencies = Freqs[0]
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Frequencies], CountsSplit[0][j], yerr=np.sqrt(CountsSplit[0][j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 1
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+3*0.8
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 1
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_1, pcov_1 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_1 = FitEIT_MM_single(freqslong, *popt_1)
beta1 = popt_1[4]
errorbeta1 = np.sqrt(pcov_1[4,4])
temp1 = popt_1[5]
errortemp1 = np.sqrt(pcov_1[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_1, color='darkolivegreen', linewidth=3, label='med 1')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 2
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+1.6
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 2
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_2, pcov_2 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_2 = FitEIT_MM_single(freqslong, *popt_2)
beta2 = popt_2[4]
errorbeta2 = np.sqrt(pcov_2[4,4])
temp2 = popt_2[5]
errortemp2 = np.sqrt(pcov_2[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2, color='darkolivegreen', linewidth=3, label='med 2')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 3
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion+0.8
DetDoppler = -11.5-correccion
print(offsetxpi,DetDoppler)
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 3
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3, pcov_3 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_3 = FitEIT_MM_single(freqslong, *popt_3)
beta3 = popt_3[4]
errorbeta3 = np.sqrt(pcov_3[4,4])
temp3 = popt_3[5]
errortemp3 = np.sqrt(pcov_3[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_3, color='darkolivegreen', linewidth=3, label='med 3')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 4
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 4
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_4, pcov_4 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_4 = FitEIT_MM_single(freqslong, *popt_4)
beta4 = popt_4[4]
errorbeta4 = np.sqrt(pcov_4[4,4])
temp4 = popt_4[5]
errortemp4 = np.sqrt(pcov_4[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_4, color='darkolivegreen', linewidth=3, label='med 4')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 5
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-1
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 5
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
#TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_5, pcov_5 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_5 = FitEIT_MM_single(freqslong, *popt_5)
beta5 = popt_5[4]
errorbeta5 = np.sqrt(pcov_5[4,4])
temp5 = popt_5[5]
errortemp5 = np.sqrt(pcov_5[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_5, color='darkolivegreen', linewidth=3, label='med 5')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 6
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-2.2
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_6, pcov_6 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 5e4, 1e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_6 = FitEIT_MM_single(freqslong, *popt_6)
beta6 = popt_6[4]
errorbeta6 = np.sqrt(pcov_6[4,4])
temp6 = popt_6[5]
errortemp6 = np.sqrt(pcov_6[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_6, color='darkolivegreen', linewidth=3, label='med 6')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 7
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-3.7
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 7
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_7, pcov_7 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_7 = FitEIT_MM_single(freqslong, *popt_7)
beta7 = popt_7[4]
errorbeta7 = np.sqrt(pcov_7[4,4])
temp7 = popt_7[5]
errortemp7 = np.sqrt(pcov_7[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_7, color='darkolivegreen', linewidth=3, label='med 7')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 8
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion-4.9
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 8
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = False
if do_fit:
popt_8, pcov_8 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10, 10e-3)))
FittedEITpi_8 = FitEIT_MM_single(freqslong, *popt_8)
beta8 = popt_8[4]
errorbeta8 = np.sqrt(pcov_8[4,4])
temp8 = popt_8[5]
errortemp8 = np.sqrt(pcov_8[5,5])
print()
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_8, color='darkolivegreen', linewidth=3, label='med 8')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
MEDICION 9
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 16
offsetxpi = 419+correccion-6
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 9
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
#TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_9, pcov_9 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 2, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 5e4, 5e4, 10,10e-3)))
FittedEITpi_9 = FitEIT_MM_single(freqslong, *popt_9)
beta9 = popt_9[4]
errorbeta9 = np.sqrt(pcov_9[4,4])
temp9 = popt_9[5]
errortemp9 = np.sqrt(pcov_9[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_9, color='darkolivegreen', linewidth=3, label='med 9')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
"""
AHORA INTENTO SUPER AJUSTES O SEA CON OFFSETXPI Y DETDOPPLER INCLUIDOS
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
SUPER AJUSTE (SA)
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [1,2,3,4,5,6,7,8,9]
#SelectedCurveVec = [9]
popt_SA_vec = []
pcov_SA_vec = []
Detuningsshort_vec = []
Counts_vec = []
Detuningslong_vec = []
FittedCounts_vec = []
Betas_vec = []
ErrorBetas_vec = []
Temp_vec = []
ErrorTemp_vec = []
DetuningsUV_vec = []
ErrorDetuningsUV_vec = []
for selectedcurve in SelectedCurveVec:
#selectedcurve = 2 #IMPORTANTE: SELECCIONA LA MEDICION
FreqsDR = Freqs[0]
CountsDR = CountsSplit[0][selectedcurve]
if selectedcurve==1:
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
if selectedcurve==2:
CountsDR[67]=0.5*(CountsDR[66]+CountsDR[68])
CountsDR[71]=0.5*(CountsDR[70]+CountsDR[72])
if selectedcurve==6:
CountsDR[1]=0.5*(CountsDR[0]+CountsDR[2])
CountsDR[76]=0.5*(CountsDR[75]+CountsDR[77])
if selectedcurve==7:
CountsDR[117]=0.5*(CountsDR[116]+CountsDR[118])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, OFFSET, BETA1, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot:
return ScaledFluo1, Detunings
else:
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3_SA, pcov_3_SA = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[430, -25, 0.9, 6.2, 3e4, 1.34e3, 2, (np.pi**2)*1e-3], bounds=((0, -50, 0, 0, 0, 0, 0, 0), (1000, 0, 2, 20, 5e4, 5e4, 10, (np.pi**2)*10e-3)))
popt_SA_vec.append(popt_3_SA)
pcov_SA_vec.append(pcov_3_SA)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA, plot=True)
DetuningsUV_vec.append(popt_3_SA[1])
ErrorDetuningsUV_vec.append(np.sqrt(pcov_3_SA[1,1]))
Betas_vec.append(popt_3_SA[6])
ErrorBetas_vec.append(np.sqrt(pcov_3_SA[6,6]))
Temp_vec.append(popt_3_SA[7])
ErrorTemp_vec.append(np.sqrt(pcov_3_SA[7,7]))
Detuningsshort_vec.append(Detunings_3_SA_short)
Counts_vec.append(CountsDR)
Detuningslong_vec.append(Detunings_3_SA_long)
FittedCounts_vec.append(FittedEITpi_3_SA_long)
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA)
#%%
"""
Grafico distintas variables que salieron del SUper ajuste
"""
import seaborn as sns
paleta = sns.color_palette("rocket")
voltages_dcA = Voltages[0][1:10]
def lineal(x,a,b):
return a*x+b
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
hiperbola_or_linear = True
if hiperbola_or_linear:
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
else:
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],Betas_vec[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],Betas_vec[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
print([t*1e3 for t in Temp_vec])
plt.figure()
plt.errorbar(voltages_dcA,[t*1e3 for t in Temp_vec],yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.axhline(0.538)
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
#plt.ylim(0,2)
#%%
"""
Ahora hago un ajuste con una hiperbola porque tiene mas sentido, por el hecho
de que en el punto optimo el ion no esta en el centro de la trampa
sino que esta a una distancia d
"""
def hiperbola(x,a,b,c,x0):
return a*np.sqrt(((x-x0)**2+c**2))+b
popthip,pcovhip = curve_fit(hiperbola,voltages_dcA,Betas_vec,p0=(100,0.1,1,-0.15))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
plt.errorbar(voltages_dcA,Betas_vec,yerr=ErrorBetas_vec,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xhip,hiperbola(xhip,*popthip))
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
def expo(x,tau,A,B):
return A*np.exp(x/tau)+B
def cuadratica(x,a,c):
return a*(x**2)+c
"""
Temperatura vs beta con un aju8ste exponencial
"""
popt_exp, pcov_exp = curve_fit(expo,Betas_vec,[t*1e3 for t in Temp_vec])
popt_quad, pcov_quad = curve_fit(cuadratica,Betas_vec,[t*1e3 for t in Temp_vec],p0=(1,10))
betaslong = np.arange(0,2.7,0.01)
plt.figure()
plt.errorbar(Betas_vec,[t*1e3 for t in Temp_vec],xerr=ErrorBetas_vec, yerr=[t*1e3 for t in ErrorTemp_vec],fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.plot(betaslong,expo(betaslong,*popt_exp),label='Ajuste exponencial')
plt.plot(betaslong,cuadratica(betaslong,*popt_quad),label='Ajuste cuadratico')
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
#plt.axhline(0.538)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Esto no es del super ajuste sino de los ajustes anteriores en donde DetDoppler y offset son puestos a mano
Aca grafico los betas con su error en funcion de la tension variada.
Ademas, hago ajuste lineal para primeros y ultimos puntos, ya que espero que
si la tension hace que la posicion del ion varie linealmente, el beta varia proporcional a dicha posicion.
"""
import seaborn as sns
def lineal(x,a,b):
return a*x+b
paleta = sns.color_palette("rocket")
betavector = [beta1,beta2,beta3,beta4,beta5,beta6,beta7,beta8,beta9]
errorbetavector = [errorbeta1,errorbeta2,errorbeta3,errorbeta4,errorbeta5,errorbeta6,errorbeta7,errorbeta8,errorbeta9]
voltages_dcA = Voltages[0][1:10]
poptini,pcovini = curve_fit(lineal,voltages_dcA[0:3],betavector[0:3])
poptfin,pcovfin = curve_fit(lineal,voltages_dcA[4:],betavector[4:])
minimum_voltage = -(poptini[1]-poptfin[1])/(poptini[0]-poptfin[0]) #voltaje donde se intersectan las rectas, es decir, donde deberia estar el minimo de micromocion
minimum_modulationfactor = lineal(minimum_voltage,*poptini) #es lo mismo si pongo *poptfin
xini = np.linspace(-0.23,-0.13,100)
xfin = np.linspace(-0.15,0.005,100)
plt.figure()
plt.errorbar(voltages_dcA,betavector,yerr=errorbetavector,fmt='o',capsize=5,markersize=5,color=paleta[1])
plt.plot(xini,lineal(xini,*poptini))
plt.plot(xfin,lineal(xfin,*poptfin))
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
plt.grid()
#%%
"""
Aca veo la temperatura del ion en funcion del voltaje del endcap, ya que
al cambiar la cantidad de micromocion, cambia la calidad del enfriado
"""
tempvector = np.array([temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9])*1e3
errortempvector = np.array([errortemp1,errortemp2,errortemp3,errortemp4,errortemp5,errortemp6,errortemp7,errortemp8,errortemp9])*1e3
voltages_dcA = Voltages[0][1:10]
plt.figure()
plt.errorbar(voltages_dcA,tempvector,yerr=errortempvector,fmt='o',capsize=5,markersize=5,color=paleta[3])
plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
plt.xlabel('Endcap voltage (V)')
plt.ylabel('Temperature (mK)')
plt.grid()
plt.ylim(0,2)
#%%
"""
Por las dudas, temperatura en funcion de beta
"""
plt.figure()
plt.errorbar(betavector,tempvector,yerr=errortempvector,xerr=errorbetavector,fmt='o',capsize=5,markersize=5)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.grid()
#%%
"""
Si quiero ver algun parametro del ajuste puntual. el orden es: 0:SG, 1:SP, 2:SCALE1, 3:OFFSET
"""
ki=2
plt.errorbar(np.arange(0,9,1),[popt_1[ki],popt_2[ki],popt_3[ki],popt_4[ki],popt_5[ki],popt_6[ki],popt_7[ki],popt_8[ki],popt_9[ki]],yerr=[np.sqrt(pcov_1[ki,ki]),np.sqrt(pcov_2[ki,ki]),np.sqrt(pcov_3[ki,ki]),np.sqrt(pcov_4[ki,ki]),np.sqrt(pcov_5[ki,ki]),np.sqrt(pcov_6[ki,ki]),np.sqrt(pcov_7[ki,ki]),np.sqrt(pcov_8[ki,ki]),np.sqrt(pcov_9[ki,ki])], fmt='o',capsize=3,markersize=3)
#%%
"""
AHORA VAMOS A MEDICIONES CON MAS DE UN ION!!!
"""
"""
Ploteo la cpt de referencia / plotting the reference CPT
1: 2 iones, -100 mV dcA
2: 2 iones, -150 mV dcA
3: 2 iones, -50 mV dcA
4: 2 iones, 5 voltajes (el ion se va en la 4ta medicion y en la 5ta ni esta)
5, 6 y 7: 3 iones en donde el scaneo esta centrado en distintos puntos
"""
jvec = [3] # desde la 1, pero la 4 no porque es un merge de curvitas
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
"""
Mergeo la 5, 6 y 7
"""
Freqs5 = [2*f*1e-6 for f in Freqs[5]]
Freqs6 = [2*f*1e-6 for f in Freqs[6]]
Freqs7 = [2*f*1e-6 for f in Freqs[7]]
Counts5 = Counts[5]
Counts6 = Counts[6]
Counts7 = Counts[7]
i_1_ini = 0
i_1 = 36
i_2_ini = 0
i_2 = 24
f_1 = 18
f_2 = 30
scale_1 = 0.92
scale_2 = 0.98
#Merged_freqs_test = [f-f_2 for f in Freqs6[i_2_ini:i_2]]+[f-f_1 for f in Freqs5[i_1_ini:i_1]]+Freqs7
#plt.plot(Merged_freqs_test,'o')
Merged_freqs = [f-f_2 for f in Freqs6[0:i_2]]+[f-f_1 for f in Freqs5[0:i_1]]+Freqs7
Merged_counts = [scale_2*c for c in Counts6[0:i_2]]+[scale_1*c for c in Counts5[0:i_1]]+list(Counts7)
Merged_freqs_rescaled = np.linspace(np.min(Merged_freqs),np.max(Merged_freqs),len(Merged_freqs))
#drs = [391.5, 399.5, 405.5, 414]
drs = [370,379,385,391.5]
plt.figure()
i = 0
for j in jvec:
plt.plot([f-f_1 for f in Freqs5[0:i_1]], [scale_1*c for c in Counts5[0:i_1]],'o')
plt.plot([f-f_2 for f in Freqs6[0:i_2]], [scale_2*c for c in Counts6[0:i_2]],'o')
plt.plot(Freqs7, Counts7,'o')
plt.errorbar(Merged_freqs, Merged_counts, yerr=np.sqrt(Merged_counts), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
for dr in drs:
plt.axvline(dr)
plt.axvline(dr+drive, color='red', linestyle='dashed', alpha=0.3)
plt.axvline(dr-drive, color='red', linestyle='dashed', alpha=0.3)
plt.legend()
#%%
"""
ajusto la mergeada de 3 iones
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = -20
offsetxpi = 438+correccion
DetDoppler = -35-correccion-22
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [f-offsetxpi for f in Merged_freqs]
CountsDR = Merged_counts
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, SCALE3, OFFSET, BETA1, BETA2, BETA3):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
#BETA1, BETA2, BETA3 = 0, 0, 2
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence3 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA3, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
ScaledFluo3 = np.array([f*SCALE3 for f in Fluorescence3])
return ScaledFluo1+ScaledFluo2+ScaledFluo3+OFFSET
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3ions, pcov_3ions = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.6, 6.2, 3.5e5, 3.5e5, 3.5e5, 2e3, 1, 1, 1], bounds=((0, 0, 0, 0, 0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 5e8, 7e3, 10, 10, 10)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_3ions = FitEIT_MM(freqslong, *popt_3ions)
#FittedEITpi_3ions = FitEIT_MM(freqslong, popt_3ions[0],popt_3ions[1],popt_3ions[2],popt_3ions[3],popt_3ions[4],popt_3ions[5],4,2,0)
#FittedEITpi_3ions = FitEIT_MM(freqslong, *popt_3ions)
print(popt_3ions)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_3ions, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
#%%
"""
Veo la medicion de varios voltajes uno atras de otro
Se va en medio de la medicion 4, y en la 5 ni esta
"""
jvec = [2] # desde la 1, pero la 4 no porque es un merge de curvitas
Freqs
plt.figure()
i = 0
for j in jvec:
plt.errorbar([2*f*1e-6 for f in Freqs[4]], CountsSplit_2ions[0][j], yerr=np.sqrt(CountsSplit_2ions[0][j]), fmt='o', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#for dr in drs:
# plt.axvline(dr)
#plt.axvline(dr+drive)
plt.legend()
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
AJUSTO LA CPT DE 2 IONES CON UN MODELO EN DONDE SUMO DOS ESPECTROS CON BETAS DISTINTOS
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 27
offsetxpi = 421+correccion
DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[1]]
CountsDR = Counts[1]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 + OFFSET for f in Fluorescence2])
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
do_fit = True
if do_fit:
popt_2ions_1, pcov_2ions_1 = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.9, 6.2, 3.5e3, 2.9e3, 3e3], bounds=((0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 8e3)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_2sp = FitEIT_MM(freqslong, *popt_2ions_1)
#FittedEITpi = FitEIT_MM(freqslong, 0.8, 8, 4e4, 3.5e3, 0)
# beta1_2ions = popt_2ions_1[5]
# beta2_2ions = popt_2ions_1[6]
# errbeta1_2ions = np.sqrt(pcov_2ions_1[5,5])
# errbeta2_2ions = np.sqrt(pcov_2ions_1[6,6])
"""
Estos params dan bien poniendo beta2=0 y correccion=0 y son SG, SP, SCALE1, SCALE2, OFFSET, BETA1
#array([9.03123248e-01, 6.25865542e+00, 3.47684055e+04, 2.92076804e+04, 1.34556420e+03, 3.55045904e+00])
"""
"""
Ahora considerando ambos betas, con los parametros iniciales dados por los que se obtuvieron con beta2=0
y correccion=0 dan estos parametros que son los de antes pero con BETA2 incluido:
array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
"""
#arreglito = np.array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
FittedEITpi_2ions_1 = FitEIT_MM(freqslong, *popt_2ions_1)
print(popt_2ions_1)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2ions_1, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
#%%
"""
SUPER AJUSTE PARA MED DE 2 IONES
"""
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
#DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
SelectedCurveVec = [3]
popt_SA_vec_2ions = []
pcov_SA_vec_2ions = []
for selectedcurve in SelectedCurveVec:
FreqsDR = Freqs[selectedcurve]
CountsDR = Counts[selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(Freqs, offset, DetDoppler, SG, SP, SCALE1, SCALE2, OFFSET, BETA1, BETA2, TEMP, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
#SG = 0.6
#SP = 8.1
# TEMP = 0.2e-3
freqs = [2*f*1e-6-offset for f in Freqs]
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 for f in Fluorescence2])
if plot:
return ScaledFluo1+ScaledFluo2, Detunings
else:
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
do_fit = True
if do_fit:
popt_3_SA_2ions, pcov_3_SA_2ions = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[448, -42, 0.6, 8.1, 4e4, 4e4, 6e3, 1, 1.2, 0.5e-3], bounds=((0, -100,0, 0, 0,0,0,0,0, 0), (1000, 0, 2, 20,5e6, 5e6,5e4, 10, 10,10e-3)))
#popt_3_SA_2ions = [448, -42, 8e4, 6e3, 2, 0.5e-3]
popt_SA_vec_2ions.append(popt_3_SA_2ions)
pcov_SA_vec_2ions.append(pcov_3_SA_2ions)
FittedEITpi_3_SA_short, Detunings_3_SA_short = FitEIT_MM_single(FreqsDR, *popt_3_SA_2ions, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_3_SA_long, Detunings_3_SA_long = FitEIT_MM_single(freqslong, *popt_3_SA_2ions, plot=True)
plt.figure()
plt.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_3_SA_long, FittedEITpi_3_SA_long, color='darkolivegreen', linewidth=3, label=f'med {selectedcurve}')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
print(f'listo med {selectedcurve}')
print(popt_3_SA_2ions)
#print(f'Detdop:{popt_3_SA[1]},popt_3_SA:{popt[0]}')
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
"""
AJUSTO LA CPT DE 2 IONES CON UN MODELO EN DONDE SUMO DOS ESPECTROS CON BETAS DISTINTOS
"""
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 27
offsetxpi = 421+correccion
DetDoppler = -16-correccion+5
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[1]]
CountsDR = Counts[1]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM(freqs, SG, SP, SCALE1, SCALE2, OFFSET):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
TEMP = 0.1e-3
BETA1, BETA2 = 3, 0
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence2 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA2, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
ScaledFluo2 = np.array([f*SCALE2 + OFFSET for f in Fluorescence2])
return ScaledFluo1+ScaledFluo2
#return ScaledFluo1
do_fit = True
if do_fit:
popt_2ions_1, pcov_2ions_1 = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.9, 6.2, 3.5e3, 2.9e3, 3e3], bounds=((0, 0, 0, 0, 0), (2, 20, 5e8, 5e8, 8e3)))
#popt, pcov = curve_fit(FitEIT_MM, FreqsDR, CountsDR, p0=[0.8, 8, 4e4, 3.5e3, 0], bounds=((0, 0, 0, 0, 0), (2, 15, 1e5, 1e5, 10)))
#array([7.12876797e-01, 7.92474752e+00, 4.29735308e+04, 1.74240582e+04,
#1.53401696e+03, 1.17073206e-06, 2.53804151e+00])
FittedEITpi_2sp = FitEIT_MM(freqslong, *popt_2ions_1)
#FittedEITpi = FitEIT_MM(freqslong, 0.8, 8, 4e4, 3.5e3, 0)
# beta1_2ions = popt_2ions_1[5]
# beta2_2ions = popt_2ions_1[6]
# errbeta1_2ions = np.sqrt(pcov_2ions_1[5,5])
# errbeta2_2ions = np.sqrt(pcov_2ions_1[6,6])
"""
Estos params dan bien poniendo beta2=0 y correccion=0 y son SG, SP, SCALE1, SCALE2, OFFSET, BETA1
#array([9.03123248e-01, 6.25865542e+00, 3.47684055e+04, 2.92076804e+04, 1.34556420e+03, 3.55045904e+00])
"""
"""
Ahora considerando ambos betas, con los parametros iniciales dados por los que se obtuvieron con beta2=0
y correccion=0 dan estos parametros que son los de antes pero con BETA2 incluido:
array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
"""
#arreglito = np.array([8.52685426e-01, 7.42939084e+00, 3.61998310e+04, 3.40160472e+04, 8.62651715e+02, 3.89756335e+00, 7.64867601e-01])
FittedEITpi_2ions_1 = FitEIT_MM(freqslong, *popt_2ions_1)
print(popt_2ions_1)
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_2ions_1, color='darkgreen', linewidth=3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.title(f'Corr:{correccion},DetD:{DetDoppler}')
plt.grid()
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
"""
CPT con tres laseres pero lso dos IR son el mismo entonces las DD son mas finas
"""
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211223_CPT_DosLaseres_v07_ChristmasSpecial\Data
ALL_FILES = """000016420-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']['IR1_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']))
#%%
#Barriendo angulo del IR con tisa apagado
jvec = [0]
jselected = jvec
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', capsize=2, markersize=2)
#plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=f'Amp Tisa: {AmpTisa[i]}', mb arkersize=3)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
plt.legend()
#%%
from scipy.optimize import curve_fit
import time
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 90
phiprobe = 0
titaprobe = 0.1
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
noiseamplitude = 0
selectedcurve=0
FreqsDR = Freqs[selectedcurve]
CountsDR = Counts[selectedcurve]
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_1ion(Freqs, offset, DetDoppler, DetRepump, SG, SP, SR, SCALE1, OFFSET, TEMP, U, plot=False):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
# BETA1 = 0
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
# U = 32.5e6
freqs = [2*f*1e-6-offset for f in Freqs]
#Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings, Fluorescence1 = GenerateNoisyCPT_fit(SG, SR, SP, gPS, gPD, DetDoppler, DetRepump, U, DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, [titaprobe], phirepump, titarepump, freqs, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
if plot:
return ScaledFluo1, Detunings
else:
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_1, pcov_1 = curve_fit(FitEIT_MM_1ion, FreqsDR, CountsDR, p0=[430, -25, 12, 0.9, 6.2, 3, 3e4, 2e3, 0.5e-3, 32e6], bounds=((0, -100, -20, 0, 0, 0, 0, 0, 0,20e6), (1000, 0, 50, 2, 20, 20, 5e6, 5e4, 15e-3,40e6)))
FittedEITpi_1_short, Detunings_1_short = FitEIT_MM_1ion(FreqsDR, *popt_1, plot=True)
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
FittedEITpi_1_long, Detunings_1_long = FitEIT_MM_1ion(freqslong, *popt_1, plot=True)
#%%
plt.figure()
plt.errorbar(Detunings_1_short, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='red', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detunings_1_long, FittedEITpi_1_long, color='darkolivegreen', linewidth=3, label='med 1')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
#plt.xlim(-20,0)
plt.legend(loc='upper left', fontsize=20)
plt.grid()
#%%
u = 32.5e6
B = (u/(2*np.pi))/c
correccion = 8 #con 8 fitea bien
offsetxpi = 440+1+correccion
DetDoppler = -5.0-correccion
FreqsDRpi_3 = [2*f*1e-6-offsetxpi+14 for f in Freqs_B[5]]
CountsDRpi_3 = Counts_B[5]
freqslongpi_3 = np.arange(min(FreqsDRpi_3), max(FreqsDRpi_3)+FreqsDRpi_3[1]-FreqsDRpi_3[0], 0.1*(FreqsDRpi_3[1]-FreqsDRpi_3[0]))
#[1.71811842e+04 3.34325038e-17]
def FitEITpi(freqs, SG, SP):
temp = 2e-3
MeasuredFreq, MeasuredFluo = GenerateNoisyCPT_fit(SG, sr, SP, gPS, gPD, DetDoppler, DetRepump, u, DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth, temp, alpha, phidoppler, titadoppler, phiprobe, [titaprobe], phirepump, titarepump, freqs, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
FinalFluo = [f*6.554e4 + 1.863e3 for f in MeasuredFluo]
return FinalFluo
popt_tisaoff, pcov_tisaoff = curve_fit(FitEITpi, FreqsDRpi_3, CountsDRpi_3, p0=[0.5, 4.5], bounds=((0, 0), (2, 10)))
print(popt_tisaoff)
Sat_3 = popt_tisaoff[0]
Det_3 = popt_tisaoff[1]
FittedEITpi_3 = FitEITpi(freqslongpi_3, *popt_tisaoff)
plt.figure()
plt.errorbar(FreqsDRpi_3, CountsDRpi_3, yerr=2*np.sqrt(CountsDRpi_3), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi_3, FittedEITpi_3)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
FreqsCalibradas_B = FreqsDRpi_3
...@@ -14,7 +14,7 @@ Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A ...@@ -14,7 +14,7 @@ Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data #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/20231123_CPTconmicromocion3/Data/') os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20231218_CPT_muri/Data')
CPT_FILES = """000016262-IR_Scan_withcal_optimized CPT_FILES = """000016262-IR_Scan_withcal_optimized
000016239-IR_Scan_withcal_optimized 000016239-IR_Scan_withcal_optimized
...@@ -111,7 +111,84 @@ plt.grid() ...@@ -111,7 +111,84 @@ plt.grid()
plt.legend() plt.legend()
#%%
from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels_MM
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
Temp = 0.5e-3
sg = 0.544
sp = 4.5
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 32.5e6
#B = (u/(2*np.pi))/c
correccion = 13
offsetxpi = 419+correccion
DetDoppler = -11.5-correccion
gPS, gPD, = 2*np.pi*21.58e6, 2*np.pi*1.35e6
alpha = 0
drivefreq = 2*np.pi*22.135*1e6
selectedcurve = 4
FreqsDR = [2*f*1e-6-offsetxpi for f in Freqs[0]]
CountsDR = CountsSplit[0][selectedcurve]
CountsDR[100]=0.5*(CountsDR[99]+CountsDR[101])
CountsDR[105]=0.5*(CountsDR[104]+CountsDR[106])
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
CircPr = 1
alpha = 0
def FitEIT_MM_single(freqs, SG, SP, SCALE1, OFFSET, BETA1, TEMP):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
ScaledFluo1 = np.array([f*SCALE1 + OFFSET for f in Fluorescence1])
return ScaledFluo1
#return ScaledFluo1
do_fit = True
if do_fit:
popt_1, pcov_1 = curve_fit(FitEIT_MM_single, FreqsDR, CountsDR, p0=[0.9, 6.2, 3e4, 1.34e3, 0, 1e-3], bounds=((0, 0, 0, 0, 0, 0), (2, 20, 7e4, 5e4, 0.000001, 15e-3)))
FittedEITpi_1 = FitEIT_MM_single(freqslong, *popt_1)
beta1 = popt_1[4]
errorbeta1 = np.sqrt(pcov_1[4,4])
temp1 = popt_1[5]
errortemp1 = np.sqrt(pcov_1[5,5])
plt.figure()
plt.errorbar(FreqsDR, CountsDR, yerr=2*np.sqrt(CountsDR), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(freqslong, FittedEITpi_1, color='darkolivegreen', linewidth=3, label='med 1')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
plt.legend(loc='upper left', fontsize=20)
plt.grid()
...@@ -15,7 +15,7 @@ import numpy as np ...@@ -15,7 +15,7 @@ import numpy as np
import time import time
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from scipy.signal import argrelextrema from scipy.signal import argrelextrema
#from EITfit.MM_eightLevel_2repumps_python_scripts import CPTspectrum8levels_MM from EITfit.MM_eightLevel_2repumps_python_scripts import CPTspectrum8levels_MM
import random import random
from scipy.signal import savgol_filter as sf from scipy.signal import savgol_filter as sf
......
...@@ -233,7 +233,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3): ...@@ -233,7 +233,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3):
kboltzmann = 1.38e-23 #J/K kboltzmann = 1.38e-23 #J/K
gammaD = (2*np.pi)*np.sqrt((1/(wlg*wlg)) + (1/(wlp*wlp)) - 2*(1/(wlg*wlp))*np.cos(alpha))*np.sqrt(kboltzmann*T/(2*mcalcio)) gammaD = (2*np.pi)*np.sqrt((1/(wlg*wlg)) + (1/(wlp*wlp)) - 2*(1/(wlg*wlp))*np.cos(alpha))*np.sqrt(kboltzmann*T/(mcalcio))
return gammaD return gammaD
...@@ -249,8 +249,14 @@ def FullL_MM(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, l ...@@ -249,8 +249,14 @@ def FullL_MM(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, l
db = dopplerBroadening(0.397e-6, 0.866e-6, alpha, T) db = dopplerBroadening(0.397e-6, 0.866e-6, alpha, T)
lwg = np.sqrt(lwg**2 + db**2) kg = 1/397
lwp = np.sqrt(lwp**2 + db**2) kp = 1/866
fg = kg**2/(kg**2+kp**2)
fp = kp**2/(kg**2+kp**2)
lwg = np.sqrt(lwg**2 + (fg*db)**2)
lwp = np.sqrt(lwp**2 + (fp*db)**2)
CC = EffectiveL(gPS, gPD, lwg, lwp) CC = EffectiveL(gPS, gPD, lwg, lwp)
......
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