Commit 3ef727a9 authored by Nicolas Nunez Barreto's avatar Nicolas Nunez Barreto
parents a0718351 86aaf205
......@@ -218,7 +218,7 @@ j = 26
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
popt, pcov = curve_fit(Lorentzian, FreqsChosen, CountsChosen)
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
......
......@@ -259,7 +259,7 @@ freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-
#plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='dcB=-1.16 V')
#plt.plot(freqslong, Lorentzian(freqslong, *popt))
plt.plot(freqslong, Lorentzian(freqslong, *popt))
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
......@@ -287,7 +287,7 @@ freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-
#plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='dcB=-1.20 V')
#plt.plot(freqslong, Lorentzian(freqslong, *popt))
plt.plot(freqslong, Lorentzian(freqslong, *popt))
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
......@@ -347,7 +347,7 @@ freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-
#plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='dcB=-1.24 V')
#plt.plot(freqslong, Lorentzian(freqslong, *popt))
plt.plot(freqslong, Lorentzian(freqslong, *popt))
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
......@@ -376,7 +376,7 @@ freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-
#plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='dcB=-1.26 V')
#plt.plot(freqslong, Lorentzian(freqslong, *popt))
plt.plot(freqslong, Lorentzian(freqslong, *popt))
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
......
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
# Solo levanto algunos experimentos
Calib_Files = """000004263-UV_Scan_withcalib_Haeffner
000004265-UV_Scan_withcalib_Haeffner
000004270-UV_Scan_withcalib_Haeffner
000004273-UV_Scan_withcalib_Haeffner
000004275-UV_Scan_withcalib_Haeffner
000004282-UV_Scan_withcalib_Haeffner
000004301-UV_Scan_withcalib_Haeffner
000004303-UV_Scan_withcalib_Haeffner"""
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211013_EspectrosUV\Data
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()))
#%%
Amps = []
Freqs = []
Counts = []
for i, fname in enumerate(Calib_Files.split()):
print(SeeKeys(Calib_Files))
print(i)
print(fname)
data = h5py.File(fname+'.h5', 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'
print(list(data['datasets'].keys()))
Amps.append(np.array(data['datasets']['UV_Amplitudes']))
Freqs.append(np.array(data['datasets']['UV_Frequencies']))
Counts.append(np.array(data['datasets']['counts_spectrum']))
#def GetBackground(countsper100ms, )
#%%
def Lorentzian(f, A, gamma, x0):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + 10 #40 es el piso de ruido estimado
j = 1 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
portion = 0.05
popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='4 uW')
plt.plot(freqslong, Lorentzian(freqslong, *popt), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz')
#%%
def Lorentzian(f, A, gamma, x0, C):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + C #40 es el piso de ruido estimado
j = 4 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
portion = 0.05
popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[1e3, 40, 210, 100])
freqslong = np.arange(min(FreqsChosen)-100, max(FreqsChosen)+100, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.figure()
plt.plot(FreqsChosen, CountsChosen, 'o', label='1 uW')
plt.plot(freqslong, Lorentzian(freqslong, *popt), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.axhline(popt[-1])
plt.ylim(50, 1100)
plt.legend()
#%% COMPARATIVA DE AMBOS DONDE SE VE QUE UNO ES MAS FINO
def Lorentzian(f, A, gamma, x0):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + 10 #40 es el piso de ruido estimado
j = 1 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
plt.figure()
plt.plot(FreqsChosen, [c/max(CountsChosen) for c in CountsChosen], 'o', label='4 uW')
#plt.plot(freqslong, Lorentzian(freqslong, *popt), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz')
j = 4 #UV_cooling en 90 MHz
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
#popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
#plt.figure()
plt.plot(FreqsChosen, [c/max(CountsChosen) for c in CountsChosen], 'o', label='1 uW')
#plt.plot(freqslong, Lorentzian(freqslong, *popt), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.legend()
#%%
def Lorentzian(f, A, gamma, x0, C):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + C #40 es el piso de ruido estimado
j = 5 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
portion = 0.6
#popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[1e3, 40, 210, 100])
popt, pcov = curve_fit(Lorentzian, FreqsChosen[:int(portion*len(FreqsChosen))], CountsChosen[:int(portion*len(FreqsChosen))], p0=[1e3, 40, 210, 100])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.figure()
plt.plot([f-popt[2] for f in FreqsChosen], CountsChosen, 'o', label='1 uW')
plt.plot([f-popt[2] for f in freqslong], Lorentzian(freqslong, *popt), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
plt.axhline(popt[-1])
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz')
#%%
def Lorentzian(f, A, gamma, x0, C):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + C #40 es el piso de ruido estimado
j = 6 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
portion = 1
#popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[1e3, 40, 210, 100])
popt, pcov = curve_fit(Lorentzian, FreqsChosen[:int(portion*len(FreqsChosen))], CountsChosen[:int(portion*len(FreqsChosen))], p0=[1e3, 40, 210, 100])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
plt.figure()
plt.plot([f-popt[2] for f in FreqsChosen], CountsChosen/max(CountsChosen), 'o', label='2.5 uW')
plt.plot([f-popt[2] for f in freqslong], Lorentzian(freqslong, *popt)/max(CountsChosen), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
#plt.axhline(popt[-1])
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz')
def Lorentzian(f, A, gamma, x0):
return (A/np.pi)*0.5*gamma/(((f-x0)**2)+((0.5*gamma)**2)) + 30 #40 es el piso de ruido estimado
j = 7 #UV_cooling en 90 MHz
UV_cooling = 90
FreqsChosen = [2*f*1e-6 for f in Freqs[j]]
CountsChosen = Counts[j]
portion = 1
#popt, pcov = curve_fit(Lorentzian, FreqsChosen[int(portion*len(FreqsChosen)):], CountsChosen[int(portion*len(FreqsChosen)):], p0=[1e3, 40, 210, 100])
popt, pcov = curve_fit(Lorentzian, FreqsChosen[:int(portion*len(FreqsChosen))], CountsChosen[:int(portion*len(FreqsChosen))], p0=[1e3, 40, 210])
freqslong = np.arange(min(FreqsChosen)-10, max(FreqsChosen)+10, (FreqsChosen[1]-FreqsChosen[0])*0.01)
#plt.figure()
plt.plot([f-popt[2] for f in FreqsChosen], CountsChosen/max(CountsChosen), 'o', label='2.5 uW')
plt.plot([f-popt[2] for f in freqslong], Lorentzian(freqslong, *popt)/max(CountsChosen), label=f'FWHM {round(popt[1])} MHz')
#plt.axvline(popt[2]-22.1, linestyle='--', linewidth=1)
#plt.axvline(popt[2]+22.1, linestyle='--', linewidth=1)
#plt.axvline(2*UV_cooling, linestyle='--', linewidth=1)
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('Cuentas')
#plt.axhline(popt[-1])
plt.legend()
print(f'Ancho medido: {round(popt[1])} MHz')
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
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211019_CPT_primeras4DR\Data
# Solo levanto algunos experimentos
ALL_FILES = """000004475-IR_Scan_withcal_optimized
000004476-IR_Scan_withcal_optimized
000004477-IR_Scan_withcal_optimized
000004478-IR_Scan_withcal_optimized
000004479-IR_Scan_withcal_optimized
000004480-IR_Scan_withcal_optimized
000004481-IR_Scan_withcal_optimized
000004482-IR_Scan_withcal_optimized
000004483-IR_Scan_withcal_optimized
000004484-IR_Scan_withcal_optimized
000004485-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\artiq_master\results\2021-07-14\16
Counts = []
Freqs = []
for i, fname in enumerate(ALL_FILES.split()):
print(i)
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']['IR_Frequencies']))
Counts.append(np.array(data['datasets']['counts_spectrum']))
#%%
j = 10
plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.grid()
......@@ -395,11 +395,26 @@ popt, pcov = curve_fit(FitEITpi, FreqsDRpi, CountsDRpi, sigma=np.sqrt(CountsDRpi
print(popt)
DetRepumpFit = popt[-1]
SatParRepumpFit = popt[2]
SatParDopFit = popt[0]
SatParDopFit = popt[1]
FittedEITpi = FitEITpi(freqslongpi, *popt)
#%%
plt.figure()
plt.errorbar(FreqsDRpi, CountsDRpi, yerr=1*np.sqrt(CountsDRpi), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi, FittedEITpi)
ms = 20
cs = 10
lwidth = 10
fs = 30
plt.figure(figsize=(15,15))
plt.errorbar(FreqsDRpi, [(c-9.05e2)*100/7e4 for c in CountsDRpi], yerr=[1*np.sqrt(c)*100/7e4 for c in CountsDRpi], fmt='o', capsize=cs, markersize=ms, color='rebeccapurple')
plt.plot(freqslongpi, [(c-9.05e2)*100/7e4 for c in FittedEITpi], linewidth=lwidth, color='purple', alpha=0.7)
plt.xlabel('Detuning (MHz)', fontsize=fs)
plt.ylabel('Fluorescence (a.u.)', fontsize=fs)
plt.yticks([7, 8, 9, 10], fontsize=fs)
plt.xticks([-80, -60, -40, -20, 0], fontsize=fs)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
#%%
......@@ -572,7 +587,7 @@ plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[
#%%
import matplotlib
matplotlib.rcParams.update({'font.size': 18})
matplotlib.rcParams.update({'font.size': 10})
fig, ax = plt.subplots(1,2, figsize=(14,6))
......
......@@ -22,9 +22,6 @@ ALL_FILES = """000005717-IR_Scan_withcal_optimized
000005724-IR_Scan_withcal_optimized
000005725-IR_Scan_withcal_optimized
000005726-IR_Scan_withcal_optimized
000005728-IR_Scan_withcal_optimized
000005729-IR_Scan_withcal_optimized
000005730-IR_Scan_withcal_optimized
000005910-IR_Scan_withcal_optimized
000005911-IR_Scan_withcal_optimized
000005912-IR_Scan_withcal_optimized
......@@ -249,6 +246,10 @@ plt.grid()
#%%
"""
FIGURA PARA EL PAPER CPT 2 LASERES, 1 REPUMP
"""
#FITEOSSSSS
......@@ -287,24 +288,56 @@ CountsDRpi_1 = Counts[12]
freqslongpi_1 = np.arange(min(FreqsDRpi_1), max(FreqsDRpi_1)+FreqsDRpi_1[1]-FreqsDRpi_1[0], 0.1*(FreqsDRpi_1[1]-FreqsDRpi_1[0]))
def FitEITpi(freqs, SG, SP, scale, offset):
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*scale + offset for f in MeasuredFluo]
def FitEITpi(freqs, SG, SP, T):
#temp = 4.7e-3
MeasuredFreq, MeasuredFluo = GenerateNoisyCPT_fit(SG, sr, SP, gPS, gPD, DetDoppler, DetRepump, u, DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth, T, alpha, phidoppler, titadoppler, phiprobe, [titaprobe], phirepump, titarepump, freqs, plot=False, solvemode=1, detpvec=None, noiseamplitude=noiseamplitude)
FinalFluo = [f*5.986e4 + 2.0905e3 for f in MeasuredFluo]
return FinalFluo
popt, pcov = curve_fit(FitEITpi, FreqsDRpi_1, CountsDRpi_1, p0=[1, 10, 1e4, 1e4], bounds=(0, [2, 30, 1e6, 1e6]))
popt, pcov = curve_fit(FitEITpi, FreqsDRpi_1, CountsDRpi_1, p0=[1, 10, 4e-3], bounds=(0, [2, 30, 1e-2]))
print(popt)
#scale = popt[2]
#offset = popt[3]
scale = 5.986e4
offset = 2.0905e3
FittedEITpi_1 = FitEITpi(freqslongpi_1, *popt)
plt.figure()
plt.errorbar(FreqsDRpi_1, CountsDRpi_1, yerr=2*np.sqrt(CountsDRpi_1), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi_1, FittedEITpi_1)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
from scipy.signal import savgol_filter as sf
import seaborn as sns
colors=sns.color_palette("rocket", 3)
colorscomp = sns.color_palette("viridis", 10)
plt.style.use('seaborn-ticks')
winl = 9
po = 3
FiltCounts = np.array([(c-offset)*100/scale for c in sf(CountsDRpi_1, winl, po)])
ErrorCounts = np.array([1*np.sqrt(c/scale) for c in CountsDRpi_1])
plt.figure()
plt.plot(FreqsDRpi_1, FiltCounts, 'o', markersize=3, color='navy')
plt.fill_between(FreqsDRpi_1, FiltCounts+ErrorCounts, FiltCounts-ErrorCounts, color='lightblue')
plt.plot(freqslongpi_1, [(c-offset)*100/scale for c in FittedEITpi_1], label='Fitted spectrum', color='darkviolet')
plt.legend()
plt.xlim(-54, 28)
plt.xlabel('Detuning probe (MHz)')
plt.ylabel('Fluorescence (a.u.)')
plt.grid()
#%%
#Esto es un ajuste de lorenziana por las afueras de la curva y la resta con el ajuste CPT para ver la profundidad de los picos
......@@ -457,16 +490,28 @@ plt.plot(freqslongpi_3, FittedEITpi_3)
#%%
import seaborn as sns
sns.set_theme(style="whitegrid")
#sns.set_theme(style="whitegrid")
sns.set_palette("rocket")
NormCountsDRpi_2 = [(c-popt[3])/popt[2] for c in CountsDRpi_2]
NormCountsDRpi_3 = [(c-popt[3])/popt[2] for c in CountsDRpi_3]
NormCountsDRpi_1 = [(c-popt[3])/popt[2] for c in CountsDRpi_1]
#NormCountsDRpi_2 = [(c-popt[3])/popt[2] for c in CountsDRpi_2]
#NormCountsDRpi_3 = [(c-popt[3])/popt[2] for c in CountsDRpi_3]
#NormCountsDRpi_1 = [(c-popt[3])/popt[2] for c in CountsDRpi_1]
#NormFittedEITpi_2 = [(c-popt[3])/popt[2] for c in FittedEITpi_2]
#NormFittedEITpi_3 = [(c-popt[3])/popt[2] for c in FittedEITpi_3]
#NormFittedEITpi_1 = [(c-popt[3])/popt[2] for c in FittedEITpi_1]
NormCountsDRpi_2 = [(c-0)/popt[2] for c in CountsDRpi_2]
NormCountsDRpi_3 = [(c-0)/popt[2] for c in CountsDRpi_3]
NormCountsDRpi_1 = [(c-0)/popt[2] for c in CountsDRpi_1]
NormFittedEITpi_2 = [(c-0)/popt[2] for c in FittedEITpi_2]
NormFittedEITpi_3 = [(c-0)/popt[2] for c in FittedEITpi_3]
NormFittedEITpi_1 = [(c-0)/popt[2] for c in FittedEITpi_1]
NormFittedEITpi_2 = [(c-popt[3])/popt[2] for c in FittedEITpi_2]
NormFittedEITpi_3 = [(c-popt[3])/popt[2] for c in FittedEITpi_3]
NormFittedEITpi_1 = [(c-popt[3])/popt[2] for c in FittedEITpi_1]
plt.figure()
......@@ -477,7 +522,7 @@ plt.errorbar(FreqsDRpi_3, NormCountsDRpi_3, yerr=(np.sqrt(CountsDRpi_3))/popt[2]
plt.plot(freqslongpi_2, NormFittedEITpi_1, zorder=2)
plt.errorbar(FreqsDRpi_2, NormCountsDRpi_1, yerr=(np.sqrt(CountsDRpi_1))/popt[2], fmt='o', capsize=2, markersize=2, label=f'Sat Rep: 0', zorder=1)
plt.legend(markerscale=3, loc='lower right')
plt.ylim(0.018, 0.14)
#plt.ylim(0.018, 0.14)
plt.xlim(-55, 35)
plt.xlabel('Repump Detuning [MHz]')
plt.ylabel('Norm. Fluorescence [a.u.]')
......
......@@ -189,6 +189,85 @@ plt.ylabel('counts')
plt.grid()
#plt.legend()
#%%
#Variando potencia UV
jvec = [16]
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', label=f'Amp Tisa: {AmpTisa[i]}', capsize=2, markersize=2)
i = i + 1
plt.xlabel('Frecuencia (MHz)')
plt.ylabel('counts')
plt.grid()
#plt.legend(
#%%
#FITEOSSSSS
#Variando la polarizacion del UV
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
T = 0.6e-3
sg = 0.49
sp = 4
sr = 0
DetRepump = 0
lw = 0.1
DopplerLaserLinewidth, RepumpLaserLinewidth, ProbeLaserLinewidth = lw, lw, lw #ancho de linea de los laseres
u = 33.5e6
B = (u/(2*np.pi))/c
correccion = 8 #con 8 fitea bien
offsetxpi = 440+1+correccion
DetDoppler = -14-correccion
FreqsDRpi_1 = [2*f*1e-6-offsetxpi+14 for f in Freqs[16]]
CountsDRpi_1 = Counts[16]
freqslongpi_1 = np.arange(min(FreqsDRpi_1), max(FreqsDRpi_1)+FreqsDRpi_1[1]-FreqsDRpi_1[0], 0.1*(FreqsDRpi_1[1]-FreqsDRpi_1[0]))
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*5.95591183e4 + 8.6e2 for f in MeasuredFluo]
return FinalFluo
popt, pcov = curve_fit(FitEITpi, FreqsDRpi_1, CountsDRpi_1, p0=[0.7, 4], bounds=(0, [2, 30]))
print(popt)
FittedEITpi_1 = FitEITpi(freqslongpi_1, *popt)
plt.figure()
plt.errorbar(FreqsDRpi_1, CountsDRpi_1, yerr=2*np.sqrt(CountsDRpi_1), fmt='o', capsize=2, markersize=2)
plt.plot(freqslongpi_1, FittedEITpi_1)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
#%%
#AHORA SI: VARIANDO POTENCIA TISA, CON DOS IR EN SIGMAM M SIGMAM
......
......@@ -55,6 +55,21 @@ 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']))
Counts_B = []
Freqs_B = []
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_B.append(np.array(data['datasets']['IR_Frequencies']))
Counts_B.append(np.array(data['datasets']['counts_spectrum']))
#%%
......@@ -127,6 +142,126 @@ plt.legend()
#%%
"""
Bloque para calibrar eje x en figura
"""
#Ajuste con el Tisa apagado primero para calibrar el eje X en el plot que voy a mostrar
phidoppler, titadoppler = 0, 90
phirepump, titarepump = 0, 0
phiprobe = 0
titaprobe = 90
T = 0.6e-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 = 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
Scale_B = 6.554e4
Offset_B = 1.863e3
#%%
#Aca pongo solo 3 que son los mismos angulos de las curvas barriendo angulo TISA (para mostrar)
jselected_B = [3, 2, 4, 1, 5, 0]
Angsselected_B = ['Off', 0, 'Off', 15, 'Off', 90]
#jselected = [2, 6, 7, 4]
#Angsselected = ['Off', 0, 15, 90]
fig, ax = plt.subplots(1, 3, figsize=(20, 6))
cs = 1
ms = 4
fs = 25
ax[0].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[1]], yerr=np.sqrt(Counts_B[jselected_B[1]]), fmt='o', label='TISA ON', capsize=cs, markersize=ms)
ax[0].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[0]], yerr=np.sqrt(Counts_B[jselected_B[0]]), fmt='o', label='TISA OFF', capsize=cs, markersize=ms)
#ax[0].set_ylim(0, 2100)
ax[0].set_title(f'TISA ang: {Angsselected_B[1]}º', fontsize=fs)
ax[0].set_xlabel('Detuning (MHz)', fontsize=fs)
ax[0].set_ylabel('Counts', fontsize=fs)
#ax[0].set_yticks(np.arange(0, 2500, 500))
#ax[0].set_yticklabels(np.arange(0, 2500, 500), fontsize=fs)
#ax[0].set_xticks(np.arange(-50, 50, 25))
#ax[0].set_xticklabels(np.arange(-50, 50, 25), fontsize=fs)
ax[0].grid()
ax[1].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[3]], yerr=np.sqrt(Counts_B[jselected_B[2]]), fmt='o', label='TISA ON', capsize=cs, markersize=ms)
ax[1].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[2]], yerr=np.sqrt(Counts_B[jselected_B[0]]), fmt='o', label='TISA OFF', capsize=cs, markersize=ms)
#ax[1].set_ylim(0, 2100)
ax[1].set_title(f'TISA ang: {Angsselected_B[3]}º', fontsize=fs)
ax[1].set_xlabel('Detuning (MHz)', fontsize=fs)
ax[1].set_ylabel('Counts', fontsize=fs)
#ax[1].set_yticks(np.arange(0, 2500, 500))
#ax[1].set_yticklabels(np.arange(0, 2500, 500), fontsize=fs)
#ax[1].set_xticks(np.arange(-50, 50, 25))
#ax[1].set_xticklabels(np.arange(-50, 50, 25), fontsize=fs)
ax[1].grid()
ax[2].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[5]], yerr=np.sqrt(Counts_B[jselected_B[4]]), fmt='o', label='TISA ON', capsize=cs, markersize=ms)
ax[2].errorbar(FreqsCalibradas_B, Counts_B[jselected_B[4]], yerr=np.sqrt(Counts_B[jselected_B[0]]), fmt='o', label='TISA OFF', capsize=cs, markersize=ms)
#ax[2].set_ylim(0, 2100)
ax[2].set_title(f'TISA ang: {Angsselected_B[5]}º', fontsize=fs)
ax[2].set_xlabel('Detuning (MHz)', fontsize=fs)
ax[2].set_ylabel('Counts', fontsize=fs)
#ax[2].set_yticks(np.arange(0, 2500, 500))
#ax[2].set_yticklabels(np.arange(0, 2500, 500), fontsize=fs)
#ax[2].set_xticks(np.arange(-50, 50, 25))
#ax[2].set_xticklabels(np.arange(-50, 50, 25), fontsize=fs)
ax[2].grid()
fig.tight_layout()
#%%
#Aca veo como poniendo tisa en sigma se rompen las 4 resonancias oscuras
......
0.000000000000000000e+00 3.000000000000000000e+01 6.000000000000000000e+01 9.000000000000000000e+01 1.500000000000000000e+01 4.500000000000000000e+01 7.500000000000000000e+01
1.784693448063240095e-01 2.108427153120442377e-01 2.091073548113952796e-01 2.187264577655991249e-01 1.895357908431558047e-01 2.191180900537179066e-01 2.304649447016792752e-01
0.000000000000000000e+00 3.000000000000000000e+01 6.000000000000000000e+01 9.000000000000000000e+01 1.500000000000000000e+01 4.500000000000000000e+01 7.500000000000000000e+01
2.379691345730698959e-01 2.488013995521680122e-01 2.395849375251260516e-01 2.243382206115963617e-01 2.468988235645363516e-01 2.585188884870380233e-01 2.491457615156644767e-01
0.000000000000000000e+00 3.000000000000000000e+01 6.000000000000000000e+01 9.000000000000000000e+01 1.500000000000000000e+01 4.500000000000000000e+01 7.500000000000000000e+01
2.634466295782048606e-01 2.601718393967488718e-01 2.325020388682937644e-01 2.179410819521661047e-01 2.628764862581587924e-01 2.650688532186117885e-01 2.313931198017891155e-01
0.000000000000000000e+00 3.000000000000000000e+01 6.000000000000000000e+01 9.000000000000000000e+01 1.500000000000000000e+01 4.500000000000000000e+01 7.500000000000000000e+01
1.745838324094645955e-01 2.015920452755217973e-01 2.122611830210968942e-01 2.318558139647002025e-01 1.911124674842025473e-01 2.083885942837055416e-01 2.287847404371309845e-01
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