Commit 81cb19fc authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto

tutti

parent f0d6c3a7
......@@ -22,7 +22,7 @@ Calib_Files = """000004167-UV_Scan_withcalib_Haeffner
000004233-UV_Scan_withcalib_Haeffner"""
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211006_EspectrosUV_FixedScript//Data//')
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211006_EspectrosUV_FixedScript\Data
......@@ -47,7 +47,14 @@ for i, fname in enumerate(Calib_Files.split()):
Amps.append(np.array(data['datasets']['UV_Amplitudes']))
Freqs.append(np.array(data['datasets']['UV_Frequencies']))
Counts.append(np.array(data['datasets']['counts_spectrum']))
#%%
#kvec = [10]
plt.figure()
for k in kvec:
plt.plot([2*f*1e-6 for f in Freqs[k]], Counts[k],'o')
#%%
......@@ -190,7 +197,7 @@ print(f'Ancho medido: {round(popt[1])} MHz, cooling en {(popt[2]-2*UV_cooling)/2
m = 6.6e-26
c = 3e8
T = 100e-6
T = 10e-3
kb=1.38e-23
hbar=1.03e-34
f0 = 755e12
......@@ -198,19 +205,12 @@ f0 = 755e12
fL = 22
fG = np.sqrt(8*kb*T*np.log(2)/(m*c*c))*f0*1e-6
print(fG)
print('ancho gaussiano: ',fG)
"""
wl = 589e-9
T = 300
m2 = 3.5e-23
fG2 = 2*np.pi*(4*np.pi/wl)*np.sqrt(kb*T*2*np.log(2)/(m2))*1e-6
print(fG2)
"""
fV = 0.5*fL + np.sqrt((fL**2)/4 + fG**2)
print(fV)
fV = 0.5346*fL + np.sqrt((fL**2)*0.2166 + fG**2)
print('ancho voigt: ', fV)
#%% en teoria esto esta "bien compensado" con -1.21 V en dcB
......@@ -242,7 +242,7 @@ plt.grid()
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz, cooling en {(popt[2]-2*UV_cooling)/23} det/gamma')
#%%
j = 7
UV_cooling = 90
......
......@@ -10,6 +10,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211019_CPT_primeras4DR\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211019_CPT_primeras4DR//Data')
# Solo levanto algunos experimentos
ALL_FILES = """000004475-IR_Scan_withcal_optimized
000004476-IR_Scan_withcal_optimized
......@@ -49,7 +51,7 @@ for i, fname in enumerate(ALL_FILES.split()):
#%%
j = 10
j = 0
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-')
......
......@@ -10,6 +10,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211020_CPT_DosLaseres\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211020_CPT_DosLaseres//Data')
ALL_FILES = """000004585-IR_Scan_withcal_optimized
000004586-IR_Scan_withcal_optimized
000004587-IR_Scan_withcal_optimized
......@@ -61,6 +63,17 @@ for i, fname in enumerate(ALL_FILES.split()):
AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
"""
visualizacion
"""
jvec = [0]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
j = 4 #Amp tisa = 0
......
......@@ -10,6 +10,9 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211026_CPT_DosLaseres_v02\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211026_CPT_DosLaseres_v02//Data')
ALL_FILES = """000004758-IR_Scan_withcal_optimized
000004759-IR_Scan_withcal_optimized
000004760-IR_Scan_withcal_optimized
......@@ -63,6 +66,17 @@ for i, fname in enumerate(ALL_FILES.split()):
Counts.append(np.array(data['datasets']['counts_spectrum']))
AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
"""
visualizacion
"""
jvec = [0]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
......
......@@ -10,6 +10,12 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211101_CPT_DosLaseres_v03\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211101_CPT_DosLaseres_v03//Data')
"""
Interesante aca: graficos de cpt en funcion de potencias uv
"""
ALL_FILES = """000004961-IR_Scan_withcal_optimized
000004962-IR_Scan_withcal_optimized
000004963-IR_Scan_withcal_optimized
......
......@@ -11,6 +11,7 @@ from scipy import interpolate
#BUENAS MEDICIONES VARIANDO PARAMETROS
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211101_CPT_DosLaseres_v03\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211101_CPT_DosLaseres_v03//Data')
ALL_FILES = """000005054-IR_Scan_withcal_optimized
000005055-IR_Scan_withcal_optimized
......@@ -83,7 +84,7 @@ ALL_FILES = """000005054-IR_Scan_withcal_optimized
000004973-IR_Scan_withcal_optimized
000005010-IR_Scan_withcal_optimized
"""
[14, 13, 18, 17, 16, 15]
def SeeKeys(files):
for i, fname in enumerate(files.split()):
......@@ -116,6 +117,17 @@ for i, fname in enumerate(ALL_FILES.split()):
UVCPTAmp.append(np.array(data['datasets']['UV_CPT_amp']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
"""
visualizacion
"""
jvec = [68]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
#VARIANDO POTENCIA ir
#Poca estadistica, 5k mediciones, Tisa apagado, pot uv = 10 uW (90 MHz, 0.3), pot IR @ 200° = 20 uW
......@@ -369,10 +381,11 @@ DetRepump = 20
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
noiseamplitude = 0
u = 33.5e6
B = (u/(2*np.pi))/c
# B = (u/(2*np.pi))/c
correccion = 8 #con 10 fitea bien
......@@ -501,7 +514,7 @@ DetRepump = 0
u = 32.5e6
B = (u/(2*np.pi))/c
#B = (u/(2*np.pi))/c
correccion = 17
......
......@@ -12,7 +12,7 @@ import numpy as np
import time
import matplotlib.pyplot as plt
from scipy.signal import argrelextrema
from threeLevel_2repumps_linealpol_python_scripts import CPTspectrum8levels, CPTspectrum8levels_fixedRabi
#from threeLevel_2repumps_linealpol_python_scripts import CPTspectrum8levels, CPTspectrum8levels_fixedRabi
import random
from scipy.signal import savgol_filter as sf
......
......@@ -301,8 +301,7 @@ def FullL_efficient(rabG, rabR, rabP, gPS = 0, gPD = 0, Detg = 0, Detr = 0, Detp
M = CalculateSingleMmatrix(gPS, gPD, lwg, lwr, lwp)
L0 = np.array(np.matrix(Lfullpartial) + M)
nmax = 1
print('hola')
nmax = 5
Lminus, Lplus, DeltaBar = Lplusminus(Detr, Detp, phirepump, titarepump)
factor1 = np.exp(1j*0.2*np.pi)
factor2 = np.exp(-1j*0.2*np.pi)
......@@ -451,7 +450,7 @@ def CPTspectrum8levels_fixedRabi(sg, sr, sp, gPS, gPD, Detg, Detr, u, lwg, lwr,
return DetProbeVectorMHz, Fluovector
#%%
if __name__ == "__main__":
ub = 9.27e-24
h = 6.63e-34
......
......@@ -11,6 +11,7 @@ from scipy import interpolate
#BUENAS MEDICIONES VARIANDO PARAMETROS
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211115_CPT_DosLaseres_v04\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211115_CPT_DosLaseres_v04//Data')
ALL_FILES = """000005717-IR_Scan_withcal_optimized
000005718-IR_Scan_withcal_optimized
......@@ -60,6 +61,17 @@ for i, fname in enumerate(ALL_FILES.split()):
UVCPTAmp.append(np.array(data['datasets']['UV_CPT_amp']))
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
"""
visualizacion
"""
jvec = [14]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
#VARIANDO POTENCIA TISA
#Poca estadistica, 15k mediciones
......
......@@ -19,7 +19,9 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211115_CPT_DosLaseres_v04\Data
os.chdir('C:/Users/Usuario/Documents/artiq/artiq_experiments/analisis/plots/20211115_CPT_DosLaseres_v04/Data')
#os.chdir('C:/Users/Usuario/Documents/artiq/artiq_experiments/analisis/plots/20211115_CPT_DosLaseres_v04/Data')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211115_CPT_DosLaseres_v04//Data')
ALL_FILES = """000005717-IR_Scan_withcal_optimized
000005718-IR_Scan_withcal_optimized
......@@ -75,6 +77,17 @@ for i, fname in enumerate(ALL_FILES.split()):
VectoresResta = []
#%%
"""
visualizacion
"""
jvec = [17]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
#VARIANDO POTENCIA TISA
#Poca estadistica, 15k mediciones
......
......@@ -12,6 +12,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211201_CPT_DosLaseres_v05\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211201_CPT_DosLaseres_v05//Data')
ALL_FILES = """000006238-IR_Scan_withcal_optimized
000006239-IR_Scan_withcal_optimized
000006247-IR_Scan_withcal_optimized
......@@ -81,7 +83,7 @@ for i, fname in enumerate(ALL_FILES.split()):
#%%
#VARIANDO POTENCIA IR se ve que aparecen las DR
jvec = [1]
jvec = [32]
plt.figure()
......
......@@ -12,6 +12,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211216_CPT_DosLaseres_v06\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211216_CPT_DosLaseres_v06//Data')
ALL_FILES = """000006557-IR_Scan_withcal_optimized
000006558-IR_Scan_withcal_optimized
000006559-IR_Scan_withcal_optimized
......@@ -54,6 +56,16 @@ for i, fname in enumerate(ALL_FILES.split()):
No_measures.append(np.array(data['datasets']['no_measures']))
#%%
"""
visualizacion
"""
jvec = [0]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
......
......@@ -12,6 +12,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211223_CPT_DosLaseres_v07_ChristmasSpecial\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20211223_CPT_DosLaseres_v07_ChristmasSpecial//Data')
ALL_FILES = """000006832-IR_Scan_withcal_optimized
000006833-IR_Scan_withcal_optimized
000006834-IR_Scan_withcal_optimized
......@@ -70,6 +72,16 @@ for i, fname in enumerate(ALL_FILES.split()):
Freqs_B.append(np.array(data['datasets']['IR_Frequencies']))
Counts_B.append(np.array(data['datasets']['counts_spectrum']))
#%%
"""
visualizacion
"""
jvec = [0]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
......
......@@ -12,6 +12,8 @@ from scipy import interpolate
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20220106_CPT_DosLaseres_v08_TISA_DR//Data')
ALL_FILES = """000007003-IR_Scan_withcal_optimized
000007004-IR_Scan_withcal_optimized
000007005-IR_Scan_withcal_optimized
......@@ -72,6 +74,19 @@ for i, fname in enumerate(ALL_FILES.split()):
Freqs_A.append(np.array(data['datasets']['IR_Frequencies']))
Counts_A.append(np.array(data['datasets']['counts_spectrum']))
#%%
"""
visualizacion
"""
jvec = [1]
plt.figure()
for j in jvec:
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j],'o')
#%%
#Barriendo angulo del IR con tisa apagado y prendido
......
......@@ -100,14 +100,14 @@ def MicromotionSpectra(det, A, beta, x0):
P = A*(jv(0, beta)**2)/(((det-x0)**2)+(0.5*gamma)**2)+100
i = 1
#print(P)
while i <= 2:
while i <= 3:
P = P + A*((jv(i, beta))**2)/((((det-x0)+i*ftrap)**2)+(0.5*gamma)**2) + A*((jv(-i, beta))**2)/((((det-x0)-i*ftrap)**2)+(0.5*gamma)**2)
i = i + 1
#print(P)
return P
jvec = [7] #UV_cooling en 90 MHz
jvec = [0] #UV_cooling en 90 MHz
"""
plt.figure()
......
......@@ -12,7 +12,9 @@ from scipy import interpolate
Calib_Files = """000007324-UV_Scan_withcalib_Haeffner
"""
"""
No da bien, da 51 MHz de ancho
"""
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220503_EspectrosUVnuevos\Data
......
......@@ -21,6 +21,8 @@ Calib_Files = """000007324-UV_Scan_withcalib_Haeffner
#directory = '/home/liaf-murib/Documents/Artiq/artiq_experiments/analisis/plots/20220520_EspectrosUVyCPT_descompensacion/Data/'
directory = '/home/nico/Documents/artiq_experiments/analisis/plots/20220520_EspectrosUVyCPT_descompensacion/Data/'
directory = 'C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20220520_EspectrosUVyCPT_descompensacion//Data//'
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220503_EspectrosUVnuevos\Data
......@@ -66,7 +68,7 @@ def Lorentzian(f, A, x0, gamma, offset):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + offset #40 es el piso de ruido estimado
jvec = [4] #UV_cooling en 90 MHz
jvec = [6] #UV_cooling en 90 MHz
plt.figure()
......@@ -104,9 +106,9 @@ from scipy.optimize import curve_fit
def Lorentzian(f, A, gamma, x0):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2))
def MicromotionSpectra(det, A, beta, x0, offset):
def MicromotionSpectra(det, A, beta, x0, offset, gamma):
ftrap=22.1
gamma= 29
#gamma= 40
P = A*(jv(0, beta)**2)/(((det-x0)**2)+(0.5*gamma)**2)+ offset
i = 1
#print(P)
......@@ -117,7 +119,7 @@ def MicromotionSpectra(det, A, beta, x0, offset):
return P
jvec = [7] #UV_cooling en 90 MHz
jvec = [6] #UV_cooling en 90 MHz
"""
plt.figure()
......@@ -154,7 +156,7 @@ for j in jvec:
portion = 0.
popt, pcov = curve_fit(MicromotionSpectra, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):],p0=[100000,1.5,220,200], bounds=((7000,0.1,200,-500),(1000000,10,300,500)))
popt, pcov = curve_fit(MicromotionSpectra, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):],p0=[100000,1.5,220,200, 22], bounds=((7000,0.1,200,-500, 0),(1000000,10,300,500,100)))
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
......
......@@ -16,6 +16,7 @@ ALL_FILES = """000010146-IR_Scan_withcal_optimized
000010147-IR_Scan_withcal_optimized
"""
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230306_DD_DarkResonancesAnalysis//Data')
def SeeKeys(files):
for i, fname in enumerate(files.split()):
......
......@@ -12,7 +12,9 @@ from scipy import interpolate
#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/20230321_heatingrate/Data/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230321_heatingrate/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230321_heatingrate//Data')
CPT_FILES = """000010420-IR_Scan_withcal_optimized
000010436-IR_Scan_withcal_optimized
......@@ -210,9 +212,11 @@ I simulate CPT curves with all the previous parameters but with varying temperat
TempVecTeorico = list(np.arange(0.3,1,0.1))+list(np.arange(1, 31, 1))
CurvasTeoricas = []
counter = 0
for tempi in TempVecTeorico:
print(counter+1,'/',len(TempVecTeorico))
CurvasTeoricas.append(FitEITpi(freqslongpi, *popt_fullcpt[:-1], tempi*1e-3))
counter = counter + 1
#%%
......@@ -233,16 +237,35 @@ plt.plot(freqslongpi[i_DR], curva_ref[i_DR],'o')
"""
ploteo algunos CPTs teoricos para algunas temperaturas
Plotting some theory cpt curves for some temperatures
Figura para la tesis
"""
import seaborn as sns
plt.plot(freqslongpi, CurvasTeoricas[0])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[0][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[10])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[10][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[20])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[20][i_DR],'o',markersize=10)
plt.xlabel('Detuning (MHz)')
plt.ylabel('Fluorescence')
k1, k2, k3, k4 = 0, 6, 11, 20
paleta = sns.color_palette("coolwarm", 11)
color1 = paleta[0]
color2 = paleta[2]
color3 = paleta[8]
color4 = paleta[10]
lw = 3
plt.figure(figsize=(4,4))
plt.plot(freqslongpi, CurvasTeoricas[k1], color=color1, linewidth=lw, alpha=0.8)
plt.plot(freqslongpi[i_DR], CurvasTeoricas[k1][i_DR],'o', color=color1,markersize=12,mec='black')
plt.plot(freqslongpi, CurvasTeoricas[k2], color=color2, linewidth=lw, alpha=0.8)
plt.plot(freqslongpi[i_DR], CurvasTeoricas[k2][i_DR],'o', color=color2,markersize=12,mec='black')
plt.plot(freqslongpi, CurvasTeoricas[k3], color=color3, linewidth=lw, alpha=0.8)
plt.plot(freqslongpi[i_DR], CurvasTeoricas[k3][i_DR],'o', color=color3,markersize=12,mec='black')
plt.plot(freqslongpi, CurvasTeoricas[k4], color=color4, linewidth=lw, alpha=0.8)
plt.plot(freqslongpi[i_DR], CurvasTeoricas[k4][i_DR],'o', color=color4,markersize=12,mec='black')
plt.xlabel('Desintonía IR (MHz)')
plt.ylabel('Fluorescencia teórica')
plt.xlim(-50,15)
plt.grid()
......@@ -289,12 +312,6 @@ plt.errorbar([t*1e3 for t in Heating_tim], Heating_med, yerr=ErrorHeating_med, f
plt.ylabel('Cuentas de DR medidas')
plt.xlabel('Heating time (s)')
def lineal(x,a,b):
return a*x+b
#p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas, sigma=Error_Temperaturas_interpoladas)
p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas)
#%%
"""
......@@ -302,8 +319,15 @@ Grafico finalmente el plot del heating rate de la trampa
Finally I plot the heating rate of the trap
"""
def lineal(x,a):
return a*x+0.5
plt.figure()
#p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas, sigma=Error_Temperaturas_interpoladas)
p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas)
plt.figure(figsize=(5,7))
#plt.plot(Heating_tim_ms,Temperaturas_interpoladas,'o')
plt.errorbar(Heating_tim_ms,Temperaturas_interpoladas, yerr=np.array(Error_Temperaturas_interpoladas), fmt='o', capsize=2, markersize=7, color='black')
plt.plot(Heating_tim_ms, lineal(np.array(Heating_tim_ms), *p1), color='red')
......@@ -314,7 +338,7 @@ plt.xticks([0, 5, 10, 15, 20 ,25, 30, 35], fontname='STIXGeneral', fontsize=15)
plt.yticks([0, 5, 10, 15], fontname='STIXGeneral', fontsize=15)
plt.title(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms', fontname='STIXGeneral', fontsize=15)
plt.tight_layout()
plt.savefig('Fig_heatingrate.svg')
#plt.savefig('Fig_heatingrate.svg')
print(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms')
......@@ -396,6 +420,8 @@ to obtain saturation parameters
jvec = [7,8,9,10,11,12]
jvec = [7,9,11, 12]
plt.figure()
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, label='Without heating')
......
This diff is collapsed.
......@@ -8,17 +8,19 @@ from scipy.optimize import curve_fit
import os
from scipy import interpolate
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230421_CPTconmicromocion/Data/')
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230421_CPTconmicromocion/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230421_CPTconmicromocion//Data')
CPT_FILES = """000011071-IR_Scan_withcal_optimized
000011072-IR_Scan_withcal_optimized
000011073-IR_Scan_withcal_optimized
"""
"""
Aca hay una med partida en 3 pero la verdad bastante fea e inajustable
"""
def SeeKeys(files):
for i, fname in enumerate(files.split()):
......@@ -28,8 +30,6 @@ def SeeKeys(files):
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 = []
......@@ -194,236 +194,6 @@ for dr in DRs:
plt.plot(freqslongpi, FittedEITpi[1:])
#%%
#ignorar de aca para abajo por ahora
#%%
#i_DR = 955
DRs = [-31, -22, -16.5, -8]
plt.figure()
plt.errorbar(FreqsDRpi, CountsDRpi, yerr=2*np.sqrt(CountsDRpi), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi[:-1], FittedEITpi)
for dr in DRs:
dr = dr+4.7
plt.axvline(dr, color='red',alpha=0.2)
plt.axvline(dr+22.1, color='green',alpha=0.2)
plt.axvline(dr-22.1, color='black',alpha=0.2)
#plt.axvline(DetDoppler-22.1)
#plt.axvline(DetDoppler+22.1)
#plt.plot(freqslongpi[i_DR], FittedEITpi[i_DR],'o', color='red', markersize=12)
plt.xlabel('Detuning (MHz)')
plt.ylabel('Counts')
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
#%%
"""
Simulo CPTs con todos esos parámetros para distintas temperaturas
I simulate CPT curves with all the previous parameters but with varying temperatures
"""
TempVecTeorico = list(np.arange(0.3,1,0.1))+list(np.arange(1, 31, 1))
CurvasTeoricas = []
for tempi in TempVecTeorico:
CurvasTeoricas.append(FitEITpi(freqslongpi, *popt_fullcpt[:-1], tempi*1e-3))
#%%
"""
Acá agarro la primera y busco el valor i_DR que corresponde a la resonancia oscura de interés
With the first one, I look for the value i_DR which corresponds to the dark resonance of interest
"""
curva_ref = CurvasTeoricas[0]
i_DR = 955
plt.figure()
plt.plot(freqslongpi, curva_ref)
plt.plot(freqslongpi[i_DR], curva_ref[i_DR],'o')
#%%
"""
ploteo algunos CPTs teoricos para algunas temperaturas
Plotting some theory cpt curves for some temperatures
"""
plt.plot(freqslongpi, CurvasTeoricas[0])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[0][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[10])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[10][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[20])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[20][i_DR],'o',markersize=10)
plt.xlabel('Detuning (MHz)')
plt.ylabel('Fluorescence')
plt.grid()
#%%
"""
Ahora interpolo los valores teóricos de las profundidades de esas resonancias
y aplico la interpolación a las mediciones para obtener temperaturas.
Luego, grafico las temperaturas en función de los tiempos de calentamiento.
Now I interpolate the theoretical values of the depths of those resonances
and apply the interpolation to the measurements to obtain temperatures.
After that, I plot the temperatures with respect to the heating times
"""
from scipy.interpolate import interp1d
FluosDRTeo = [CurvasTeoricas[k][i_DR] for k in range(len(CurvasTeoricas))]
interpolado = interp1d(FluosDRTeo, TempVecTeorico) #creo funcion que interpola
meas = 0
maxi = 9 #valor maximo, dsp el ion se calento
Heating_tim = Times[meas][:maxi]
Heating_tim_ms = [t*1e3 for t in Heating_tim]
Heating_med = [2*c for c in Counts_heating[meas][:maxi]]
ErrorHeating_med = [2*np.sqrt(c) for c in Counts_heating[meas][:maxi]]
Temperaturas_interpoladas = [float(interpolado(h)) for h in Heating_med]
Error_Temperaturas_interpoladas = [float(interpolado(Heating_med[k]+0.5*ErrorHeating_med[k]))-Temperaturas_interpoladas[k] for k in range(len(Heating_med))]
plt.figure()
plt.plot(FluosDRTeo, [1*t for t in TempVecTeorico], 'o', color='orange')
plt.plot(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000), interpolado(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000)))
plt.xlabel('Cuentas de DR teoricas')
plt.ylabel('Temperatura (mK)')
plt.figure()
#plt.plot(Heating_med, Heating_tim, 'o', color='blue')
plt.errorbar([t*1e3 for t in Heating_tim], Heating_med, yerr=ErrorHeating_med, fmt='o', capsize=2, markersize=5)
plt.ylabel('Cuentas de DR medidas')
plt.xlabel('Heating time (s)')
def lineal(x,a,b):
return a*x+b
#p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas, sigma=Error_Temperaturas_interpoladas)
p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas)
#%%
"""
Grafico finalmente el plot del heating rate de la trampa
Finally I plot the heating rate of the trap
"""
plt.figure()
#plt.plot(Heating_tim_ms,Temperaturas_interpoladas,'o')
plt.errorbar(Heating_tim_ms,Temperaturas_interpoladas, yerr=np.array(Error_Temperaturas_interpoladas), fmt='o', capsize=2, markersize=7, color='black')
plt.plot(Heating_tim_ms, lineal(np.array(Heating_tim_ms), *p1), color='red')
plt.xlabel('Heating time (ms)', fontname='STIXGeneral', fontsize=15)
plt.ylabel('Temperature (mK)', fontname='STIXGeneral', fontsize=15)
plt.grid()
plt.xticks([0, 5, 10, 15, 20 ,25, 30, 35], fontname='STIXGeneral', fontsize=15)
plt.yticks([0, 5, 10, 15], fontname='STIXGeneral', fontsize=15)
plt.title(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms', fontname='STIXGeneral', fontsize=15)
plt.tight_layout()
plt.savefig('Fig_heatingrate.svg')
print(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms')
#%%
"""
Ahora voy a ver CPT enteras con tiempos de calentamiento distintos.
Now I see whole CPT curves with different heating times
"""
jvec = [3, 4]
plt.figure()
i = 0
for j in jvec:
if j==4:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==3:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='5 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
jvec = [1, 2]
plt.figure()
i = 0
for j in jvec:
if j==2:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==1:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='1 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
#%%
"""
La siguiente curva probablemente no este bien medida ya que inmediatamente
despues, los laseres se deslockearon. La dejo por las dudas.
This curve is probably not well measured...
"""
jvec = [5, 6]
plt.figure()
i = 0
for j in jvec:
if j==6:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==5:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='10 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,3900)
plt.grid()
plt.legend()
plt.title('Ojo: medicion condicionada por derivas')
#%%
"""
Ahora ploteo 6 curvas cpt para distintos valores de potencia del UV
This is a plot of 6 different cpt curves for 6 different UV powers. I should fit them
to obtain saturation parameters
"""
jvec = [7,8,9,10,11,12]
plt.figure()
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, label='Without heating')
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
#plt.ylim(1000,2900)
plt.grid()
#plt.legend()
......@@ -8,11 +8,15 @@ from scipy.optimize import curve_fit
import os
from scipy import interpolate
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
"""
Tengo que ver bien que datita hay aca
"""
#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/20230424_CPT_TemperatureSens/Data/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230424_CPT_TemperatureSens/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230424_CPT_TemperatureSens//Data')
#os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20230424_CPT_TemperatureSens/Data/')
......@@ -35,7 +39,7 @@ HEATING_FILES = """000015318-IR_Scan_withcal_optimized
000011344-IR_Scan_withcal_optimized
"""
CPT_FILES = ''
#CPT_FILES = ''
for i in range(0,20):
CPT_FILES = CPT_FILES + f'0000153{39 + i}-IR_Scan_withcal_optimized\n'
......@@ -290,210 +294,3 @@ FittedEIT = FitEIT(freqslongCPT, *popt_fullcpt_noheat)
#%%
"""
Simulo CPTs con todos esos parámetros para distintas temperaturas
I simulate CPT curves with all the previous parameters but with varying temperatures
"""
TempVecTeorico = list(np.arange(0.3,1,0.1))+list(np.arange(1, 31, 1))
CurvasTeoricas = []
for tempi in TempVecTeorico:
CurvasTeoricas.append(FitEITpi(freqslongpi, *popt_fullcpt[:-1], tempi*1e-3))
#%%
"""
Acá agarro la primera y busco el valor i_DR que corresponde a la resonancia oscura de interés
With the first one, I look for the value i_DR which corresponds to the dark resonance of interest
"""
curva_ref = CurvasTeoricas[0]
i_DR = 955
plt.figure()
plt.plot(freqslongpi, curva_ref)
plt.plot(freqslongpi[i_DR], curva_ref[i_DR],'o')
#%%
"""
ploteo algunos CPTs teoricos para algunas temperaturas
Plotting some theory cpt curves for some temperatures
"""
plt.plot(freqslongpi, CurvasTeoricas[0])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[0][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[10])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[10][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[20])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[20][i_DR],'o',markersize=10)
plt.xlabel('Detuning (MHz)')
plt.ylabel('Fluorescence')
plt.grid()
#%%
"""
Ahora interpolo los valores teóricos de las profundidades de esas resonancias
y aplico la interpolación a las mediciones para obtener temperaturas.
Luego, grafico las temperaturas en función de los tiempos de calentamiento.
Now I interpolate the theoretical values of the depths of those resonances
and apply the interpolation to the measurements to obtain temperatures.
After that, I plot the temperatures with respect to the heating times
"""
from scipy.interpolate import interp1d
FluosDRTeo = [CurvasTeoricas[k][i_DR] for k in range(len(CurvasTeoricas))]
interpolado = interp1d(FluosDRTeo, TempVecTeorico) #creo funcion que interpola
meas = 0
maxi = 9 #valor maximo, dsp el ion se calento
Heating_tim = Times[meas][:maxi]
Heating_tim_ms = [t*1e3 for t in Heating_tim]
Heating_med = [2*c for c in Counts_heating[meas][:maxi]]
ErrorHeating_med = [2*np.sqrt(c) for c in Counts_heating[meas][:maxi]]
Temperaturas_interpoladas = [float(interpolado(h)) for h in Heating_med]
Error_Temperaturas_interpoladas = [float(interpolado(Heating_med[k]+0.5*ErrorHeating_med[k]))-Temperaturas_interpoladas[k] for k in range(len(Heating_med))]
plt.figure()
plt.plot(FluosDRTeo, [1*t for t in TempVecTeorico], 'o', color='orange')
plt.plot(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000), interpolado(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000)))
plt.xlabel('Cuentas de DR teoricas')
plt.ylabel('Temperatura (mK)')
plt.figure()
#plt.plot(Heating_med, Heating_tim, 'o', color='blue')
plt.errorbar([t*1e3 for t in Heating_tim], Heating_med, yerr=ErrorHeating_med, fmt='o', capsize=2, markersize=5)
plt.ylabel('Cuentas de DR medidas')
plt.xlabel('Heating time (s)')
def lineal(x,a,b):
return a*x+b
#p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas, sigma=Error_Temperaturas_interpoladas)
p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas)
#%%
"""
Grafico finalmente el plot del heating rate de la trampa
Finally I plot the heating rate of the trap
"""
plt.figure()
#plt.plot(Heating_tim_ms,Temperaturas_interpoladas,'o')
plt.errorbar(Heating_tim_ms,Temperaturas_interpoladas, yerr=np.array(Error_Temperaturas_interpoladas), fmt='o', capsize=2, markersize=7, color='black')
plt.plot(Heating_tim_ms, lineal(np.array(Heating_tim_ms), *p1), color='red')
plt.xlabel('Heating time (ms)', fontname='STIXGeneral', fontsize=15)
plt.ylabel('Temperature (mK)', fontname='STIXGeneral', fontsize=15)
plt.grid()
plt.xticks([0, 5, 10, 15, 20 ,25, 30, 35], fontname='STIXGeneral', fontsize=15)
plt.yticks([0, 5, 10, 15], fontname='STIXGeneral', fontsize=15)
plt.title(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms', fontname='STIXGeneral', fontsize=15)
plt.tight_layout()
plt.savefig('Fig_heatingrate.svg')
print(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms')
#%%
"""
Ahora voy a ver CPT enteras con tiempos de calentamiento distintos.
Now I see whole CPT curves with different heating times
"""
jvec = [3, 4]
plt.figure()
i = 0
for j in jvec:
if j==4:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==3:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='5 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
jvec = [1, 2]
plt.figure()
i = 0
for j in jvec:
if j==2:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==1:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='1 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
#%%
"""
La siguiente curva probablemente no este bien medida ya que inmediatamente
despues, los laseres se deslockearon. La dejo por las dudas.
This curve is probably not well measured...
"""
jvec = [5, 6]
plt.figure()
i = 0
for j in jvec:
if j==6:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==5:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='10 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,3900)
plt.grid()
plt.legend()
plt.title('Ojo: medicion condicionada por derivas')
#%%
"""
Ahora ploteo 6 curvas cpt para distintos valores de potencia del UV
This is a plot of 6 different cpt curves for 6 different UV powers. I should fit them
to obtain saturation parameters
"""
jvec = [7,8,9,10,11,12]
plt.figure()
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, label='Without heating')
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
#plt.ylim(1000,2900)
plt.grid()
#plt.legend()
......@@ -64,7 +64,7 @@ def Lorentzian(f, A, x0, gamma, offset):
#primero muestro las meds 0 y 1 que son dos mediciones con potencia UV quizas un poco
#alta pero en la segunda el ion esta un poquito mejor compensado y se ve cómo se afina el espectro
jvec = [0,1]
jvec = [6,7,8]
plt.figure()
......@@ -75,20 +75,20 @@ for j in jvec:
portion = 0.
popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[12000, 208, 30, 30])
#popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[12000, 208, 30, 30])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.errorbar(FreqsChosen, CountsChosen, yerr=np.sqrt(np.array(CountsChosen)), fmt='o', capsize=5, markersize=5)
#plt.plot(freqslong, Lorentzian(freqslong, popt[0], popt[1], popt[2]), label=f'FWHM {round(popt[1])} MHz')
plt.plot(freqslong, Lorentzian(freqslong, popt[0], popt[1], popt[2], popt[3]), label=f'FWHM {round(popt[2],1)} MHz')
#plt.plot(freqslong, Lorentzian(freqslong, popt[0], popt[1], popt[2], popt[3]), label=f'FWHM {round(popt[2],1)} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.legend()
print(f'Ancho medido: {round(popt[2])} MHz')
#print(f'Ancho medido: {round(popt[2])} MHz')
#%%
......@@ -98,9 +98,9 @@ from scipy.optimize import curve_fit
def Lorentzian(f, A, gamma, x0):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2))
def MicromotionSpectra(det, A, beta, x0):
def MicromotionSpectra(det, A, beta, x0, gamma):
ftrap=22.1
gamma=37
#gamma=28
P = A*(jv(0, beta)**2)/(((det-x0)**2)+(0.5*gamma)**2)+100
i = 1
#print(P)
......@@ -111,7 +111,7 @@ def MicromotionSpectra(det, A, beta, x0):
return P
jvec = [1] #UV_cooling en 90 MHz
jvec = [7] #UV_cooling en 90 MHz
plt.figure()
......@@ -123,8 +123,8 @@ for j in jvec:
portion = 0.
popt, pcov = curve_fit(MicromotionSpectra, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):],p0=[100000,0.1,215], bounds=((0,0,0),(10000000,10,300)))
popt, pcov = curve_fit(MicromotionSpectra, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):],p0=[100000,0.1,215, 22], bounds=((0,0,0, 0),(10000000,10,300, 100)))
print(popt)
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.errorbar(FreqsChosen, CountsChosen, yerr=np.sqrt(np.array(CountsChosen)), fmt='o', capsize=5, markersize=5)
......@@ -143,6 +143,7 @@ for j in jvec:
from scipy.special import jv
def Lorentzian(f, A, x0, gamma, offset):
offset = 50
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + offset #40 es el piso de ruido estimado
#para tres potencias distintas del UV:
......@@ -169,7 +170,7 @@ for j in jvec:
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.legend()
print(popt)
print(f'Ancho medido: {round(popt[2])} MHz')
......@@ -182,7 +183,7 @@ def Lorentzian(f, A, gamma, x0):
def MicromotionSpectra(det, A, beta, x0, gamma):
ftrap=22.1
#gamma=30
#gamma=35
P = A*(jv(0, beta)**2)/(((det-x0)**2)+(0.5*gamma)**2)+100
i = 1
#print(P)
......
......@@ -12,8 +12,8 @@ from scipy import interpolate
#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/20230804_RotationalDopplerShift/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230804_RotationalDopplerShift/Data')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230804_RotationalDopplerShift//Data')
MOTIONAL_FILES = """000013968-IR_Scan_withcal_optimized
000013970-IR_Scan_withcal_optimized
......
......@@ -12,9 +12,9 @@ from scipy import interpolate
#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/20230817_RotationalDopplerShift_v4/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230817_RotationalDopplerShift_v4/Data')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230817_RotationalDopplerShift_v4//Data')
"""
en este codigo ploteo espectros CPT de resonancias D-D para configuracion +2/+2 y +2/-2 (usando pentaprisma)
......
......@@ -12,7 +12,9 @@ from scipy import interpolate
#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/20230817_RotationalDopplerShift_v4/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230817_RotationalDopplerShift_v4/Data')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230817_RotationalDopplerShift_v4//Data')
"""
ACA HAY FIGURAS PARA PAPER
......@@ -308,7 +310,7 @@ mmlocmedvec = [0,1,2]
plt.figure(figsize=(2.5,2.1))
plotpm = 0
plotmm = 1
plotmm = 0
generalscale = 0.7
......@@ -425,7 +427,7 @@ plt.xlim(-10,7)
plt.grid()
plt.tight_layout()
plt.legend(fontsize=14,markerscale=5)
plt.savefig('/home/nico/Nextcloud/Nico/Doctorado/Charlas/2023 Europe/sensitivityofparalellantiparalell.pdf')
#plt.savefig('/home/nico/Nextcloud/Nico/Doctorado/Charlas/2023 Europe/sensitivityofparalellantiparalell.pdf')
#%%
......@@ -504,7 +506,7 @@ plt.xlim(-3,3)
plt.grid()
plt.tight_layout()
#plt.legend(fontsize=14,markerscale=5)
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2024 Rotational Doppler Effect/Figuras/Material/fig1_c.pdf')
#plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2024 Rotational Doppler Effect/Figuras/Material/fig1_c.pdf')
#%%
......@@ -561,7 +563,7 @@ plt.xlim(-10,7)
plt.grid()
plt.tight_layout()
plt.legend(fontsize=14,markerscale=5)
plt.savefig('/home/nico/Nextcloud/Nico/Doctorado/Charlas/2023 Europe/sensitivityofparalellantiparalell.pdf')
#plt.savefig('/home/nico/Nextcloud/Nico/Doctorado/Charlas/2023 Europe/sensitivityofparalellantiparalell.pdf')
......
......@@ -12,9 +12,16 @@ from scipy import interpolate
#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/20230817_RotationalDopplerShift_v5/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230817_RotationalDopplerShift_v5/Data')
"""
no hay savefigs
"""
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230817_RotationalDopplerShift_v5//Data')
"""
en este codigo ploteo espectros CPT de resonancias D-D para configuracion +2/+2 y +2/-2 (usando pentaprisma)
"""
......@@ -320,7 +327,7 @@ orderleft = [4,5,6,7,8,3,2,1,0]
orderright = [4,3,2,1,0,5,6,7,8]
IntLeftFinal = [x for _, x in sorted(zip(orderleft, Intensityleft))]
IntRightFinal = [x for _, x in sorted(zip(orderright, Intensityright))]
IntRightFinal = [x for _, x in sorted(zip(orderright, Intensityright))]file:///C:/Users/nicon/Nextcloud/Nico/Doctorado/Tesis/Tesis_doctorado/Chapters/figures/Cap7/Fig11/20211101_CPT_DosLaseres_v03/CPT_plotter_20211102_variandoSR.py
PmLeftDR1Final = [x for _, x in sorted(zip(orderleft, pmleftdepthsdr1))]
PmRightDR1Final = [x for _, x in sorted(zip(orderright, pmrightdepthsdr1))]
......
......@@ -8,11 +8,10 @@ from scipy.optimize import curve_fit
import os
from scipy import interpolate
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230906_CPTconmicromocion2/Data/')
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230906_CPTconmicromocion2/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230906_CPTconmicromocion2//Data')
CPT_FILES = """000015243-IR_Scan_withcal_optimized
"""
......
......@@ -12,8 +12,9 @@ from scipy import interpolate
#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/20230912_RotationalDopplerShift_v6/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20230912_RotationalDopplerShift_v6/Data')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230912_RotationalDopplerShift_v6//Data')
"""
en este codigo ploteo espectros CPT de resonancias D-D para configuracion +2/+2 y +2/-2 (usando pentaprisma)
......
......@@ -8,13 +8,17 @@ from scipy.optimize import curve_fit
import os
from scipy import interpolate
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
"""
Creo que aca hay meds de calentamiento en funcion de detuning del UV
"""
#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/20230424_CPT_TemperatureSens/Data/')
os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20230920_CPT_TemperatureSens_v2/Data/')
#os.chdir('/home/muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20230920_CPT_TemperatureSens_v2/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20230920_CPT_TemperatureSens_v2//Data')
CPT_FILES = """000011345-IR_Scan_withcal_optimized
000011331-IR_Scan_withcal_optimized
......@@ -98,7 +102,7 @@ for i, fname in enumerate(HEATING_FILES.split()):
Ploteo las cpt de referencia / plotting the reference CPT
"""
jvec = [0,8]
jvec = [5,6,7,8]
plt.figure()
i = 0
......@@ -277,213 +281,3 @@ FittedEIT = FitEIT(freqslongCPT, *popt_fullcpt_noheat)
#%%
"""
Simulo CPTs con todos esos parámetros para distintas temperaturas
I simulate CPT curves with all the previous parameters but with varying temperatures
"""
TempVecTeorico = list(np.arange(0.3,1,0.1))+list(np.arange(1, 31, 1))
CurvasTeoricas = []
for tempi in TempVecTeorico:
CurvasTeoricas.append(FitEITpi(freqslongpi, *popt_fullcpt[:-1], tempi*1e-3))
#%%
"""
Acá agarro la primera y busco el valor i_DR que corresponde a la resonancia oscura de interés
With the first one, I look for the value i_DR which corresponds to the dark resonance of interest
"""
curva_ref = CurvasTeoricas[0]
i_DR = 955
plt.figure()
plt.plot(freqslongpi, curva_ref)
plt.plot(freqslongpi[i_DR], curva_ref[i_DR],'o')
#%%
"""
ploteo algunos CPTs teoricos para algunas temperaturas
Plotting some theory cpt curves for some temperatures
"""
plt.plot(freqslongpi, CurvasTeoricas[0])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[0][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[10])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[10][i_DR],'o',markersize=10)
plt.plot(freqslongpi, CurvasTeoricas[20])
plt.plot(freqslongpi[i_DR], CurvasTeoricas[20][i_DR],'o',markersize=10)
plt.xlabel('Detuning (MHz)')
plt.ylabel('Fluorescence')
plt.grid()
#%%
"""
Ahora interpolo los valores teóricos de las profundidades de esas resonancias
y aplico la interpolación a las mediciones para obtener temperaturas.
Luego, grafico las temperaturas en función de los tiempos de calentamiento.
Now I interpolate the theoretical values of the depths of those resonances
and apply the interpolation to the measurements to obtain temperatures.
After that, I plot the temperatures with respect to the heating times
"""
from scipy.interpolate import interp1d
FluosDRTeo = [CurvasTeoricas[k][i_DR] for k in range(len(CurvasTeoricas))]
interpolado = interp1d(FluosDRTeo, TempVecTeorico) #creo funcion que interpola
meas = 0
maxi = 9 #valor maximo, dsp el ion se calento
Heating_tim = Times[meas][:maxi]
Heating_tim_ms = [t*1e3 for t in Heating_tim]
Heating_med = [2*c for c in Counts_heating[meas][:maxi]]
ErrorHeating_med = [2*np.sqrt(c) for c in Counts_heating[meas][:maxi]]
Temperaturas_interpoladas = [float(interpolado(h)) for h in Heating_med]
Error_Temperaturas_interpoladas = [float(interpolado(Heating_med[k]+0.5*ErrorHeating_med[k]))-Temperaturas_interpoladas[k] for k in range(len(Heating_med))]
plt.figure()
plt.plot(FluosDRTeo, [1*t for t in TempVecTeorico], 'o', color='orange')
plt.plot(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000), interpolado(np.linspace(FluosDRTeo[0],FluosDRTeo[-1],1000)))
plt.xlabel('Cuentas de DR teoricas')
plt.ylabel('Temperatura (mK)')
plt.figure()
#plt.plot(Heating_med, Heating_tim, 'o', color='blue')
plt.errorbar([t*1e3 for t in Heating_tim], Heating_med, yerr=ErrorHeating_med, fmt='o', capsize=2, markersize=5)
plt.ylabel('Cuentas de DR medidas')
plt.xlabel('Heating time (s)')
def lineal(x,a,b):
return a*x+b
#p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas, sigma=Error_Temperaturas_interpoladas)
p1,p2 = curve_fit(lineal, Heating_tim_ms, Temperaturas_interpoladas)
#%%
"""
Grafico finalmente el plot del heating rate de la trampa
Finally I plot the heating rate of the trap
"""
plt.figure()
#plt.plot(Heating_tim_ms,Temperaturas_interpoladas,'o')
plt.errorbar(Heating_tim_ms,Temperaturas_interpoladas, yerr=np.array(Error_Temperaturas_interpoladas), fmt='o', capsize=2, markersize=7, color='black')
plt.plot(Heating_tim_ms, lineal(np.array(Heating_tim_ms), *p1), color='red')
plt.xlabel('Heating time (ms)', fontname='STIXGeneral', fontsize=15)
plt.ylabel('Temperature (mK)', fontname='STIXGeneral', fontsize=15)
plt.grid()
plt.xticks([0, 5, 10, 15, 20 ,25, 30, 35], fontname='STIXGeneral', fontsize=15)
plt.yticks([0, 5, 10, 15], fontname='STIXGeneral', fontsize=15)
plt.title(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms', fontname='STIXGeneral', fontsize=15)
plt.tight_layout()
plt.savefig('Fig_heatingrate.svg')
print(f'Heating rate: ({round(p1[0],2)} +- {round(np.sqrt(p2[0][0]),2)}) mK/ms')
#%%
"""
Ahora voy a ver CPT enteras con tiempos de calentamiento distintos.
Now I see whole CPT curves with different heating times
"""
jvec = [3, 4]
plt.figure()
i = 0
for j in jvec:
if j==4:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==3:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='5 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
jvec = [1, 2]
plt.figure()
i = 0
for j in jvec:
if j==2:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==1:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='1 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,2900)
plt.grid()
plt.legend()
#%%
"""
La siguiente curva probablemente no este bien medida ya que inmediatamente
despues, los laseres se deslockearon. La dejo por las dudas.
This curve is probably not well measured...
"""
jvec = [5, 6]
plt.figure()
i = 0
for j in jvec:
if j==6:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='Without heating')
elif j==5:
plt.errorbar([2*f*1e-6 for f in Freqs[j]], Counts[j], yerr=np.sqrt(Counts[j]), fmt='o', capsize=2, markersize=2, label='10 ms heating')
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.ylim(1000,3900)
plt.grid()
plt.legend()
plt.title('Ojo: medicion condicionada por derivas')
#%%
"""
Ahora ploteo 6 curvas cpt para distintos valores de potencia del UV
This is a plot of 6 different cpt curves for 6 different UV powers. I should fit them
to obtain saturation parameters
"""
jvec = [7,8,9,10,11,12]
plt.figure()
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, label='Without heating')
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
#plt.ylim(1000,2900)
plt.grid()
#plt.legend()
Te mando el detalle de las mediciones con su número y qué es.
Igualmente, todo está en los datasets, pero te tiro algunas pautas
generales:
-Si el dataset heating=1 es porque antes de medir hubo una etapa de
calentamiento con los parámetros que dicen "heating" (incluyendo
t_heating). Si dice 0, fue sin heating y hay que ignorar todos esos
parámetros.
-Respecto a esto, en realidad "heating" es relativo, porque hubo
mediciones en donde los parámetros de heating daban enfriado (si la
freq del UV estaba al rojo). Consideremos heating mas bien como
"preparación de estado", y si no hay heating el estado es el dado porel enfriamiento.
-Los parámetros de enfriado son los mismos para todas las mediciones.
-Algo para resaltar es que el tiempo de exposición del PMT ahora fue
de 200 us (antes era 50) porque ayer me di cuenta de que podemos
subirlo asi las mediciones duran menos.
-Todo el resto de los parámetros de cada medición están en los
datasets. La potencia del IR para todas las mediciones debería haber
sido de 70 uW, y las polarizaciones de ambos láseres sigma+ + sigma-
(horizontales, con el campo vertical).
Ahora sí las mediciones hechas:
- Variando t_heating, con uv_cpt_amp=0.11, con la freq de heating del
UV al azul y potencia del UV heating constante: 15281 a 15299 (la
primera y la última son sin heating simplemente para tener por si
derivó algo).
-15300, 15301: dos curvas, sin y con heating, para menos uv_cpt_amp
(0.09)
-15302, 15303: dos curvas, sin y con heating, para menos uv_cpt_amp (0.07)
-15304 a 15307: curvas con heating para uv_cpt_amp=0.07 (podés
combinarlas con la 15302 y 15303).
-15308 a 15312: curvas con heating para uv_cpt_amp=0.09 (podés
combinarlas con las 15300 y 15301).
Hasta acá, todas las curvas tienen una frecuencia de uv_heating de 125
MHz, que vi que servía para calentar. Ahora voy a cambiar esa
frecuencia, y para algunos valores va a enfriar.
-15313 a 15317: con uv_cpt_amp=0.11 y uv_heating_freq = 110 MHz, para
distintos t_heating. Se ve que las resonancias no se mueven mucho, o
sea, no calienta.
-15318: una sin heating para seguir monitoreando derivas.
Ahora voy a barrer la frecuencia del Heating para ver si se ve el
punto en donde empieza a calentar. Para ello, también varío la
uv_heating_amp, usando como referencia una curva de calibración del
aom del uv (para que siempre tenga la misma potencia de heating, sino
es trampa).
-15319 a 15327: con uv_cpt_amp=0.09, calentando 200 us, para
frecuencias de calentado desde 90 a 130 MHz (acordate que la
frecuencia real es el doble), de pasos de a 5 Mhz, ajustando la amp
del uv apropiadamente.
-15328 a 15336: lo mismo que antes pero calentando 100 us. La 15337 es
igual a la 15336 pero con uv_heating_amp un puntito más alto.
-15338: la curva al dia siguiente sin heating, se ve que derivo un toquecito.
-Desde 15339 en adelante, variando la frecuencia del heating pero de a
pasos de a 1 Mhz (en cada curva vas a encontrar la frecuencia
correspondiente), y calentando 100 us.
Eso es todo por ahora, si mido más cosas te aviso.
\ No newline at end of file
......@@ -12,9 +12,10 @@ 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/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20231123_CPTconmicromocion3//Data')
CPT_FILES = """000016262-IR_Scan_withcal_optimized
000016239-IR_Scan_withcal_optimized
......@@ -90,7 +91,7 @@ CountsSplit_2ions.append(Split(Counts[4],len(Freqs[4])))
Ploteo curvas para ver que tal son
"""
jvec = [4] # de la 1 a la 9 vale la pena, despues no
jvec = [8] # de la 1 a la 9 vale la pena, despues no
Frequencies = Freqs[0]
......@@ -117,7 +118,7 @@ De la 1 a la 11 ajustan bien. Ignoro las demas
"""
from EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
#from EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
from scipy.optimize import curve_fit
import time
......@@ -152,9 +153,9 @@ alpha = 0
drivefreq = 2*np.pi*22.135*1e6
#SelectedCurveVec = [1,2,3,4,5,6,7,8,9,10,11]
SelectedCurveVec = [1,2,3,4,5,6,7,8,9]
SelectedCurveVec = [4]
#SelectedCurveVec = [4]
popt_SA_vec = []
pcov_SA_vec = []
......@@ -221,11 +222,11 @@ for selectedcurve in SelectedCurveVec:
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)-1*5e6, max(FreqsDR)+FreqsDR[1]-FreqsDR[0]-1*5e6, 0.1*(FreqsDR[1]-FreqsDR[0]))
freqslong = np.arange(min(FreqsDR), max(FreqsDR)+FreqsDR[1]-FreqsDR[0], 0.1*(FreqsDR[1]-FreqsDR[0]))
popt_3_SA[4]=1
popt_3_SA[5]=0
popt_3_SA[6]=0
# popt_3_SA[4]=1
# popt_3_SA[5]=0
# popt_3_SA[6]=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])
......@@ -256,18 +257,61 @@ for selectedcurve in SelectedCurveVec:
#%%
"""
Creo las 9 figuras con espectros con micromocion.
Despues veo cuales pongo
"""
k_total = [0,1,2,3,4,5,6,7,8]
#k_total=[0]
fs = 10
for k in k_total:
plt.figure(figsize=(2,1.8))
#plt.errorbar(Detuningsshort_vec[k], Counts_vec[k], yerr=1*np.sqrt(Counts_vec[k]), fmt='o', color='darkgreen', alpha=0.5, capsize=2, markersize=2)
plt.plot(Detuningsshort_vec[k], Counts_vec[k], 'o', color='darkgreen', alpha=0.8, markersize=2)
plt.plot(Detuningslong_vec[k], [1*f for f in FittedCounts_vec[k]], color='black', linewidth=1.5, 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('Desintonía IR (MHz)',fontsize=fs)
plt.ylabel('Cuentas',fontsize=fs)
plt.xlim(-53,28)
#plt.legend(loc='upper left', fontsize=20)
plt.grid(alpha=0.5)
#plt.xlim(-60,18)
plt.tight_layout()
plt.savefig(f'C://Users//nicon//Nextcloud//Nico//Doctorado//Tesis//Tesis_doctorado//Chapters//figures//Cap7//Fig5//Subplots//plot_{k}.pdf')
#%%
"""
Muestro primero dos
"""
k_total = [3,1]
#k_total=[0]
fs = 10
for k in k_total:
plt.figure(figsize=(3.3,2.9))
plt.errorbar(Detuningsshort_vec[k], Counts_vec[k], yerr=1*np.sqrt(Counts_vec[k]), fmt='o', color='darkblue', alpha=0.5, capsize=2, markersize=2)
#plt.plot(Detuningsshort_vec[k], Counts_vec[k], 'o', color='darkgreen', alpha=0.8, markersize=2)
plt.plot(Detuningslong_vec[k], [1*f for f in FittedCounts_vec[k]], color='black', linewidth=1.5, 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('Desintonía IR (MHz)',fontsize=fs)
plt.ylabel('Cuentas',fontsize=fs)
plt.xlim(-53,26)
#plt.legend(loc='upper left', fontsize=20)
plt.grid(alpha=0.5)
#plt.xlim(-60,18)
plt.tight_layout()
plt.savefig(f'C://Users//nicon//Nextcloud//Nico//Doctorado//Tesis//Tesis_doctorado//Chapters//figures//Cap7//Fig5//plot_{k}.pdf')
plt.figure(figsize=(0.8*5,0.7*3))
#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, [100*f for f in 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(r'$\Delta_{\mathrm{IR}}$ (MHz)',fontsize=10)
plt.ylabel('Fluorescence (arb. units)',fontsize=10)
#plt.legend(loc='upper left', fontsize=20)
plt.grid()
plt.xlim(-60,18)
plt.tight_layout()
plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2023 Micromotion CPT/Drafts/cpt_fig1_v2.pdf')
......@@ -275,12 +319,14 @@ plt.savefig('/home/nico/Nextcloud/G_liaf/Publicaciones/Papers/2023 Micromotion C
#%%
"""
Grafico distintas variables que salieron del SUper ajuste
Esto es solo monitoreo. El grafico de la tesis viene despues
"""
import seaborn as sns
paleta = sns.color_palette("rocket")
medfin = 11
medfin = 10
voltages_dcA = Voltages[0][1:medfin]
......@@ -349,12 +395,16 @@ plt.grid()
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
Grafico tesis
"""
def hiperbola(x,a,b,c,x0):
#b=0
return np.sqrt((a*(x-x0)**2+c**2))+b
medfin = 11
medfin = 10
voltages_dcA = Voltages[0][1:medfin]
......@@ -364,19 +414,24 @@ errorhip = np.sqrt(np.diag(pcovhip))
xhip = np.linspace(-0.23,0.005,200)
plt.figure()
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.xlabel('Endcap voltage (V)')
plt.ylabel('Modulation factor')
#plt.yscale('log')
fs=10
plt.figure(figsize=(3,3.3))
plt.errorbar([v*4 for v in voltages_dcA],Betas_vec[:medfin-1],yerr=ErrorBetas_vec[:medfin-1],fmt='o',capsize=3,markersize=5,color='red')
plt.plot([v*4 for v in xhip],hiperbola(xhip,*popthip),color='slateblue')
plt.xlabel('Voltaje electrodo DC (V)', fontsize=fs)
plt.ylabel(r'Factor de modulación $\beta$', fontsize=fs)
plt.xlim(-0.9,-0.02)
plt.ylim(-0.05,3)
plt.xticks([-0.8,-0.6,-0.4,-0.2],fontsize=fs)
plt.yticks([0, 0.5, 1, 1.5, 2, 2.5, 3],fontsize=fs)
plt.grid()
plt.tight_layout()
betacero = popthip[2]+popthip[1]
error_betacero = np.sqrt((errorhip[1])**2+(errorhip[2])**2+2*pcovhip[1,2])
print(f'Beta_0 = {betacero} pm {error_betacero}')
plt.savefig('C://Users//nicon//Nextcloud//Nico//Doctorado//Tesis//Tesis_doctorado//Chapters//figures//Cap7//Fig6//Subplots//plot_betas.pdf')
#%%
......@@ -504,23 +559,39 @@ print(f'errores: {np.sqrt(np.diag(pcov_rho22_balance))}')
k_plot = 9
plt.figure()
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,[t*1e3 for t in FinalTemp(betaslong,*popt_rho22_balance)],label='Ajuste con espectro modulado')
plt.plot(betaslong,[t*1e3 for t in FinalTemp_withoutC(betaslong,*popt_rho22_balance)],label='With RF heating')
plt.plot(betaslong,[t*1e3 for t in FinalTemp_withoutmicromotion(betaslong,*popt_rho22_balance_noMM)],label='Without RF heating')
#%%
"""
Grafico tesis
"""
import seaborn as sns
paleta=sns.color_palette("tab10")
color1,color2,color3,color4=0,1,2,3
#plt.plot(betaslong,FinalTemp_fixedall(betaslong,*popt_rho22_balance),label='Ajuste con espectro modulado')
# plt.xlim(-0.1,1.1)
#plt.ylim(0,1)
#plt.axvline(minimum_voltage,linestyle='dashed',color='grey')
fs = 10
plt.figure(figsize=(4,4 ))
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',color=paleta[color1],capsize=5,markersize=5,zorder=2)
#plt.plot(betaslong,[t*1e3 for t in FinalTemp(betaslong,*popt_rho22_balance)],label='Ajuste con espectro modulado')
plt.plot(betaslong,[t*1e3 for t in FinalTemp_withoutC(betaslong,*popt_rho22_balance)],color=paleta[color2],label='Modelo con calentamiento RF',zorder=0)
plt.plot(betaslong,[t*1e3 for t in FinalTemp_withoutmicromotion(betaslong,*popt_rho22_balance_noMM)],color=paleta[color3],linestyle='dashed',label='Modelo sin calentamiento RF')
plt.xlim(0,2.8)
plt.ylim(0,11)
plt.axhline(0.55,color='grey',alpha=0.5, linewidth=4,label='Temperatura Doppler')
#plt.axhline(0.538)
plt.xlabel('Modulation factor')
plt.ylabel('Temperature (mK)')
plt.xlabel(r'Factor de modulación $\beta$', fontsize=fs)
plt.ylabel('Temperatura (mK)', fontsize=fs)
plt.xticks([0,0.5,1,1.5,2,2.5], fontsize=fs)
plt.yticks([0,2,4,6,8,10], fontsize=fs)
plt.legend()
plt.grid()
plt.grid(alpha=0.5)
plt.tight_layout()
plt.savefig('C://Users//nicon//Nextcloud//Nico//Doctorado//Tesis//Tesis_doctorado//Chapters//figures//Cap7//Fig7.pdf')
#%%
"""
......
......@@ -123,7 +123,7 @@ for kk in range(len(MultiCounts)):
Ploteo la cpt de referencia / plotting the reference CPT
"""
jvec = [0] # de la 1 a la 9 vale la pena, despues no
jvec = [0] # de la 1 a la 9 vale la pena, despues n
plt.figure()
......@@ -191,7 +191,7 @@ cwd = os.getcwd()
os.chdir('../20231123_CPTconmicromocion3')
from Data.EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
os.chdir(cwd)
#%%
# from Data.EITfit.lolo_modelo_full_8niveles import PerformExperiment_8levels_MM
......@@ -621,7 +621,7 @@ for selectedcurve in selectedcurvevec:
# plt.plot(detunings,'o')
#%%
#from EITfit.MM_eightLevel_2repumps_AnalysisFunctions import PerformExperiment_8levels
from scipy.optimize import curve_fit
import time
......@@ -844,7 +844,7 @@ for i in range(len(popt_vecs)):
betas1s.append(popt_vecs[i][7])
betas2s.append(popt_vecs[i][8])
temps.append(popt_vecs[i][9])
detunings.append(popt_vecs[i][])
detunings.append(popt_vecs[i][5])
for i in range(len(popt_vecs2)):
betas1s.append(popt_vecs2[i][7])
......
......@@ -12,8 +12,8 @@ from scipy import interpolate
CPT con tres laseres pero lso dos IR son el mismo entonces las DD son mas finas
"""
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20231218_CPT_DosLaseres_Reflotoajustes/Data/')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20231218_CPT_DosLaseres_Reflotoajustes/Data/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20231218_CPT_DosLaseres_Reflotoajustes//Data')
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211223_CPT_DosLaseres_v07_ChristmasSpecial\Data
......@@ -151,18 +151,42 @@ Spr = popt_1[4]
Srep = popt_1[5]
#%%
"""
Figura tesis CPT con dos IR sin dephasing entre ellos (misma fuente laser)
"""
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
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')
ms = 2
cs = 2
lwidth = 1
fs = 10
plt.figure(figsize=(3.4,3.3))
plt.errorbar(Detunings_1_short, CountsDR, yerr=1*np.sqrt(CountsDR), fmt='o', color='maroon', alpha=0.5, capsize=cs, markersize=ms)
plt.plot(Detunings_1_long, FittedEITpi_1_long, linewidth=lwidth, color='maroon')
#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()
plt.xlabel('Desintonía IR1 (MHz)', fontsize=fs)
plt.ylabel('Cuentas', fontsize=fs)
plt.yticks([3000, 3500, 4000, 4500, 5000, 5500], fontsize=fs)
plt.xticks([-40,-20,0,20], fontsize=fs)
plt.ylim(3150, 5600)
plt.xlim(-40, 30)
plt.grid(alpha=0.5)
plt.tight_layout()
plt.tick_params(axis='x', which='major', pad=1)
plt.tick_params(axis='y', which='major', pad=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.savefig('C://Users//nicon//Nextcloud//Nico//Doctorado//Tesis//Tesis_doctorado//Chapters//figures//Cap7//Fig11b.pdf', bbox_inches='tight')
#%%
"""
Este bloque no se que hace, pero no es relevante
"""
u = 32.5e6
B = (u/(2*np.pi))/c
......
......@@ -14,9 +14,17 @@ 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
ALL_FILES = """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
000016262-IR_Scan_withcal_optimized
"""
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20231218_CPT_muri//Data')
def SeeKeys(files):
for i, fname in enumerate(files.split()):
......@@ -55,7 +63,7 @@ for i, fname in enumerate(ALL_FILES.split()):
#Barriendo angulo del IR con tisa apagado
jvec = [0]
jvec = [6]
jselected = jvec
......@@ -71,132 +79,6 @@ 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
4.285714285714285587e+00 5.142857142857143238e+00 6.000000000000000000e+00 6.857142857142857650e+00 7.714285714285714413e+00 8.571428571428571175e+00 9.428571428571428825e+00 1.028571428571428648e+01 1.114285714285714413e+01 1.200000000000000000e+01 1.285714285714285765e+01 1.371428571428571530e+01 1.457142857142857295e+01 1.542857142857142883e+01 1.628571428571428825e+01 1.714285714285714235e+01 1.800000000000000000e+01 1.885714285714285765e+01 1.971428571428571530e+01 2.057142857142857295e+01 2.142857142857143060e+01 2.228571428571428825e+01 2.314285714285714235e+01 2.400000000000000000e+01 2.485714285714285765e+01 2.571428571428571530e+01 2.657142857142857295e+01 2.742857142857143060e+01 2.828571428571428825e+01 2.914285714285714590e+01
8.390686142192715913e-02 1.424253791611179709e-01 2.345580801321455189e-01 2.727885832090695128e-01 3.245632267059693765e-01 3.977197840793597061e-01 4.091112258691737003e-01 4.421368836642362021e-01 4.739247135044875048e-01 5.174802875276045544e-01 5.354585509740790172e-01 6.097745807499634907e-01 5.951798298738165682e-01 6.525819627069209261e-01 6.584243191252793226e-01 7.376072019121755474e-01 7.378541286258453180e-01 7.358990175108310883e-01 7.124659834505044920e-01 7.167837989641449026e-01 7.175124810553604737e-01 7.566970597370953344e-01 7.745856431104966022e-01 7.470409892524372264e-01 7.769069830233513718e-01 7.371708014289579669e-01 7.194199526390143706e-01 7.672221147761533189e-01 8.114839540561025188e-01 7.741573609460445926e-01
4.285714285714285587e+00 8.390686142192715913e-02
5.142857142857143238e+00 1.424253791611179709e-01
6.000000000000000000e+00 2.345580801321455189e-01
6.857142857142857650e+00 2.727885832090695128e-01
7.714285714285714413e+00 3.245632267059693765e-01
8.571428571428571175e+00 3.977197840793597061e-01
9.428571428571428825e+00 4.091112258691737003e-01
1.028571428571428648e+01 4.421368836642362021e-01
1.114285714285714413e+01 4.739247135044875048e-01
1.200000000000000000e+01 5.174802875276045544e-01
1.285714285714285765e+01 5.354585509740790172e-01
1.371428571428571530e+01 6.097745807499634907e-01
1.457142857142857295e+01 5.951798298738165682e-01
1.542857142857142883e+01 6.525819627069209261e-01
1.628571428571428825e+01 6.584243191252793226e-01
1.714285714285714235e+01 7.376072019121755474e-01
1.800000000000000000e+01 7.378541286258453180e-01
1.885714285714285765e+01 7.358990175108310883e-01
1.971428571428571530e+01 7.124659834505044920e-01
2.057142857142857295e+01 7.167837989641449026e-01
2.142857142857143060e+01 7.175124810553604737e-01
2.228571428571428825e+01 7.566970597370953344e-01
2.314285714285714235e+01 7.745856431104966022e-01
2.400000000000000000e+01 7.470409892524372264e-01
2.485714285714285765e+01 7.769069830233513718e-01
2.571428571428571530e+01 7.371708014289579669e-01
2.657142857142857295e+01 7.194199526390143706e-01
2.742857142857143060e+01 7.672221147761533189e-01
2.828571428571428825e+01 8.114839540561025188e-01
2.914285714285714590e+01 7.741573609460445926e-01
5.434492047916164581e-02
5.197738492766598023e-02
5.035641219674288904e-02
5.567609594837701070e-02
5.388323472248535834e-02
5.172291085160966861e-02
4.991250656951392445e-02
4.796809139657864929e-02
4.504731609292664252e-02
4.532269804948897696e-02
4.432748288317098218e-02
4.229005231699299594e-02
4.194875229443972148e-02
3.917962472310585614e-02
3.873596988524656559e-02
3.769961121831831574e-02
3.870501457079822405e-02
3.893510105757547884e-02
3.907094693877281172e-02
3.868668771920748956e-02
3.900431648182418193e-02
3.758579916218984796e-02
3.637156105086664787e-02
3.675968051602922920e-02
3.520234663899190347e-02
3.635473649826690551e-02
3.677164396591762335e-02
3.540698287337937233e-02
3.364307564070161821e-02
4.019887779739222261e-02
......@@ -8,11 +8,8 @@ from scipy.optimize import curve_fit
import os
from scipy import interpolate
#Mediciones barriendo angulo del TISA y viendo kicking de resonancias oscuras
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20240312_RotationalDopplerShift_news/Data')
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20240312_RotationalDopplerShift_news/Data')
"""
......@@ -555,7 +552,7 @@ Intento ajustar con un modelo con bessels
Uso los primeros tres puntos de la medicion con haz chico y el resto con el haz grande
"""
from scipy.optimize import curve_fit
from scipy.special import jv
def modelo3(r,a,b,c):
#c=1
......@@ -563,31 +560,43 @@ def modelo3(r,a,b,c):
return s
#return a*(s/(1+c*s))
rfit = np.arange(x1,len(Intensityver2)*20+x2,20)
scale = 140/6
rfit = [r/scale for r in np.arange(x1,len(Intensityver2)*20+x2,20)]
yfit = [pmdepthsdrver1[0],pmdepthsdrver1[1],pmdepthsdrver1[2]] + [p for p in pmdepthsdrver2]
yerro = [errorpmdepthsdrver1[0],errorpmdepthsdrver1[1],errorpmdepthsdrver1[2]] + [p for p in errorpmdepthsdrver2]
data_ajuste = np.savetxt('data_ajuste2.txt',np.transpose(np.array([rfit,yfit])))
error_ajuste = np.savetxt('errores_ajuste.txt',np.transpose(np.array([yerro])))
np.savetxt('data_ajuste.txt',np.array([rfit,yfit]))
popt,pcov = curve_fit(modelo3,rfit,yfit)
# rfit = np.arange(x2,len(Intensityver2)*20+x2,20)
# yfit = [p for p in pmdepthsdrver2]
rlong = np.arange(-20.1,1000,1)
rlong = np.arange(-20.1/scale,1000/scale,1/scale)
popt,pcov = curve_fit(modelo3,rfit,yfit,p0=(10,100,2))
popt,pcov = curve_fit(modelo3,rfit,yfit,p0=(10,10,2))
print(popt)
plt.figure()
plt.errorbar(np.arange(x1,len(Intensityver1)*20+x1,20), [p for p in pmdepthsdrver1], yerr= errorpmdepthsdrver1, fmt='o',color='red', capsize=3, markersize=8,zorder=1)
plt.plot([x*20 for x in xchicofinal],[i/np.max(IntensityChico) for i in IntensityChico],'o',color='red',alpha=0.3)
plt.errorbar([r/scale for r in np.arange(x1,len(Intensityver1)*20+x1,20)], [p for p in pmdepthsdrver1], yerr= errorpmdepthsdrver1, fmt='o',color='red', capsize=3, markersize=8,zorder=1)
plt.plot([x*20/scale for x in xchicofinal],[i/np.max(IntensityChico) for i in IntensityChico],'o',color='red',alpha=0.3)
plt.errorbar(np.arange(x2,len(Intensityver2)*20+x2,20), [p for p in pmdepthsdrver2], yerr= errorpmdepthsdrver2, fmt='o',color='blue', capsize=3, markersize=8,zorder=1)
plt.plot([x*20 for x in xgrandefinal],[i/np.max(IntensityGrande) for i in IntensityGrande],'o',color='blue',alpha=0.3)
plt.errorbar([r/scale for r in np.arange(x2,len(Intensityver2)*20+x2,20)], [p for p in pmdepthsdrver2], yerr= errorpmdepthsdrver2, fmt='o',color='blue', capsize=3, markersize=8,zorder=1)
plt.plot([x*20/scale for x in xgrandefinal],[i/np.max(IntensityGrande) for i in IntensityGrande],'o',color='blue',alpha=0.3)
plt.plot(rlong,modelo3(rlong,*popt),zorder=2,color='green',linewidth=3,label=r'$I(r)=a\,(J_0(\frac{b}{r}))^2$')
plt.xlim(-10,600+x2+10)
plt.xlim(-10/scale,(600+x2+10)/scale)
#lt.legend()
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
"""
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/20240312_RotationalDopplerShift_news/Data/CPT/')
os.chdir('C://Users//nicon//Doctorado//artiq_experiments//analisis//plots//20240429_Loadingsteps//Data')
ALL_FILES = """000017749-InOut
000017750-InOut
"""
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 = []
Times = []
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.
Times.append(np.array(data['datasets']['time']))
Counts.append(np.array(data['datasets']['counts']))
#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
Times_sum = np.array(list(Times[0])+list([t+Times[0][-1] for t in Times[1][1:]]))
Counts_sum = np.array(list(Counts[0])+list(Counts[1][1:]))
init=150
plt.figure()
plt.errorbar([t-Times_sum[init] for t in Times_sum[init:]], Counts_sum[init:], yerr=np.sqrt(Counts_sum[init:]), fmt='o', capsize=2, markersize=2)
plt.xlabel('Tiempo (s)')
plt.ylabel('Cuentas')
plt.grid()
# plt.figure()
# plt.hist(Counts_sum[init:],400)
# #plt.xlim(2000,5000)
\ No newline at end of file
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