Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artiq_experiments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
artiq_experiments
Commits
10a38c15
Commit
10a38c15
authored
Dec 22, 2023
by
Muriel Bonetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cambios en las carpetas con _muri y en Thermometry_v2. Incluyo todo lo relacionado a promediados
parent
9034d4f4
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2352 additions
and
80 deletions
+2352
-80
MM_eightLevel_2repumps_AnalysisFunctions.py
...2/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
+39
-10
MM_eightLevel_2repumps_CPTPlotter.py
...eSens_v2/Data/EITfit/MM_eightLevel_2repumps_CPTPlotter.py
+210
-52
MM_eightLevel_2repumps_python_scripts.py
...s_v2/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
+25
-13
CPT_plotter_20231123.py
analisis/plots/20231218_CPT_muri/CPT_plotter_20231123.py
+1788
-0
CPT_plotter_20231218.py
analisis/plots/20231218_CPT_muri/CPT_plotter_20231218.py
+202
-0
CPT_plotter_20231218_muri.py
...isis/plots/20231218_CPT_muri/CPT_plotter_20231218_muri.py
+78
-1
MM_eightLevel_2repumps_AnalysisFunctions.py
...i/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
+1
-1
MM_eightLevel_2repumps_python_scripts.py
...muri/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
+9
-3
No files found.
analisis/plots/20230920_CPT_TemperatureSens_v2/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
View file @
10a38c15
...
...
@@ -18,6 +18,16 @@ from scipy.optimize import curve_fit
import
random
from
scipy.signal
import
savgol_filter
as
sf
from
scipy.stats
import
norm
def
prob_energia
(
E
,
T
):
kboltz
=
1.380649e-23
mcalcio
=
6.655e-23
*
1e-3
prob
=
np
.
exp
(
-
E
/
(
kboltz
*
T
))
#*E**2
return
prob
def
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
betag
,
betap
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
dephasing
=
False
,
boltzmann
=
False
):
"""
...
...
@@ -37,8 +47,9 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew
velvec
=
np
.
linspace
(
-
4
*
sigmaT
,
4
*
sigmaT
,
100
)
MBprobVec
=
norm
.
pdf
(
velvec
,
loc
=
0
,
scale
=
sigmaT
)
MBprobVec
=
MBprobVec
/
np
.
trapz
(
MBprobVec
,
velvec
)
for
i
in
range
(
len
(
velvec
)):
detVel
=
(
detpvec
-
kp
*
velvec
[
i
])
/
(
2
*
np
.
pi
*
1e6
)
detVel
=
detpvec
-
kp
*
velvec
[
i
]
/
(
2
*
np
.
pi
*
1e6
)
_
,
Fluorescence
=
CPTspectrum8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
-
kg
*
velvec
[
i
]
/
(
2
*
np
.
pi
*
1e6
),
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
0
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
circularityprobe
,
betag
,
betap
,
drivefreq
,
freqMin
=
freqMin
,
freqMax
=
freqMax
,
freqStep
=
freqStep
,
plot
=
False
,
detpvec
=
detVel
)
FluorescencesVel
.
append
(
Fluorescence
)
...
...
@@ -54,21 +65,29 @@ def PerformExperiment_8levels(sg, sp, gPS, gPD, DetDoppler, u, DopplerLaserLinew
else
:
drivefreq
=
2
*
np
.
pi
*
1e3
drivefreq
=
2
*
np
.
pi
*
0.6e6
FluorescencesVel
=
[]
sigmaT
=
np
.
sqrt
(
T
*
kboltz
/
m
)
velvec
=
np
.
linspace
(
-
4
*
sigmaT
,
4
*
sigmaT
,
100
)
MBprobVec
=
norm
.
pdf
(
velvec
,
loc
=
0
,
scale
=
sigmaT
)
Evec
=
np
.
linspace
(
0
,
8
*
kboltz
*
T
,
100
)
velvec
=
np
.
zeros
(
2
*
len
(
Evec
))
velvec
=
np
.
sqrt
(
2
*
Evec
/
m
)
MBprobVec
=
prob_energia
(
Evec
,
T
)
MBprobVec
=
MBprobVec
/
np
.
trapz
(
MBprobVec
,
Evec
)
betagVec
=
velvec
*
kg
/
drivefreq
betapVec
=
velvec
*
kp
/
drivefreq
for
i
in
range
(
len
(
betagVec
)):
betag
,
betap
=
betagVec
[
i
],
betapVec
[
i
]
Frequencies
,
Fluorescence
=
CPTspectrum8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
0
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
circularityprobe
,
betag
,
betap
,
drivefreq
,
freqMin
=
freqMin
,
freqMax
=
freqMax
,
freqStep
=
freqStep
,
plot
=
False
,
detpvec
=
None
)
Frequencies
,
Fluorescence
=
CPTspectrum8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
0
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
circularityprobe
,
betag
,
betap
,
drivefreq
,
freqMin
=
freqMin
,
freqMax
=
freqMax
,
freqStep
=
freqStep
,
plot
=
False
,
detpvec
=
detpvec
)
FluorescencesVel
.
append
(
Fluorescence
)
FluorescencesVel
=
np
.
array
(
FluorescencesVel
)
MBprobMat
=
np
.
tile
(
MBprobVec
,(
FluorescencesVel
.
shape
[
1
],
1
))
.
T
Fluorescence
=
np
.
trapz
(
FluorescencesVel
*
MBprobMat
,
vel
vec
,
axis
=
0
)
Fluorescence
=
np
.
trapz
(
FluorescencesVel
*
MBprobMat
,
E
vec
,
axis
=
0
)
ProbeDetuningVectorL
=
Frequencies
#print('Done, Total time: ', round((tfinal-tinicial), 2), "s")
...
...
@@ -106,15 +125,25 @@ def SmoothNoisyCPT(Fluo, window=11, poly=3):
def
fitCPT_8levels
(
Freq
,
Fluo
,
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
beta
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
dephasing
=
False
,
boltzmann
=
False
):
def
SpectrumForFit
(
Freq
,
sg
,
sp
,
T
,
DetDoppler
):
freq
,
spectra
=
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
beta
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
Freq
)
return
spectra
def
fitCPT_8levels
(
Freq
,
Fluo
,
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
betag
,
betar
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
dephasing
=
False
,
boltzmann
=
False
):
def
SpectrumForFit
(
Freq
,
sg
,
sp
,
T
,
DetDoppler
,
A
,
bgnd
,
f0
):
Freq
=
Freq
-
f0
freq
,
spectra
=
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
betag
,
betar
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
detpvec
=
Freq
,
dephasing
=
dephasing
,
boltzmann
=
boltzmann
)
return
spectra
*
A
+
bgnd
popt
,
pcov
=
curve_fit
(
SpectrumForFit
,
Freq
,
Fluo
,
p0
=
[
sg
,
sp
,
T
,
DetDoppler
],
bounds
=
([
0.01
,
0.01
,
0.00001
,
-
50e6
],[
1
,
20
,
1
,
30e6
]))
popt
,
pcov
=
curve_fit
(
SpectrumForFit
,
Freq
,
Fluo
,
p0
=
[
sg
,
sp
,
T
,
DetDoppler
,
20000
,
800
,
432
],
bounds
=
([
0.1
,
1
,
0.5e-3
,
-
30
,
10000
,
0
,
420
],[
0.8
,
10
,
10e-3
,
0
,
100000
,
1000
,
500
]))
fitted_spectra
=
SpectrumForFit
(
Freq
,
*
popt
)
return
Freq
,
fitted_spectra
,
popt
,
pcov
def
try_fitCPT_8levels
(
A
,
bgnd
,
f0
,
Freq
,
Fluo
,
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
betag
,
betar
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
dephasing
=
False
,
boltzmann
=
False
):
def
SpectrumForFit
(
Freq
,
sg
,
sp
,
T
,
DetDoppler
,
A
,
bgnd
,
f0
):
Freq
=
Freq
-
f0
freq
,
spectra
=
PerformExperiment_8levels
(
sg
,
sp
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
T
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
betag
,
betar
,
drivefreq
,
freqMin
,
freqMax
,
freqStep
,
circularityprobe
=
1
,
plot
=
False
,
detpvec
=
Freq
,
dephasing
=
dephasing
,
boltzmann
=
boltzmann
)
return
spectra
*
A
+
bgnd
return
SpectrumForFit
(
Freq
,
sg
,
sp
,
T
,
DetDoppler
,
A
,
bgnd
,
f0
)
\ No newline at end of file
analisis/plots/20230920_CPT_TemperatureSens_v2/Data/EITfit/MM_eightLevel_2repumps_CPTPlotter.py
View file @
10a38c15
This diff is collapsed.
Click to expand it.
analisis/plots/20230920_CPT_TemperatureSens_v2/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
View file @
10a38c15
...
...
@@ -250,7 +250,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3):
kboltzmann
=
1.38e-23
#J/K
gammaD
=
(
2
*
np
.
pi
)
*
np
.
sqrt
((
1
/
(
wlg
*
wlg
))
+
(
1
/
(
wlp
*
wlp
))
-
2
*
(
1
/
(
wlg
*
wlp
))
*
np
.
cos
(
alpha
))
*
np
.
sqrt
(
kboltzmann
*
T
/
(
2
*
mcalcio
))
gammaD
=
(
2
*
np
.
pi
)
*
np
.
sqrt
((
1
/
(
wlg
*
wlg
))
+
(
1
/
(
wlp
*
wlp
))
-
2
*
(
1
/
(
wlg
*
wlp
))
*
np
.
cos
(
alpha
))
*
np
.
sqrt
(
kboltzmann
*
T
/
(
mcalcio
))
return
gammaD
...
...
@@ -264,10 +264,16 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp
"""
kg
=
397e9
kp
=
866e9
fg
=
kg
**
2
/
(
kg
**
2
+
kp
**
2
)
fp
=
kp
**
2
/
(
kg
**
2
+
kp
**
2
)
db
=
dopplerBroadening
(
0.397e-6
,
0.866e-6
,
alpha
,
T
)
lwg
=
np
.
sqrt
(
lwg
**
2
+
(
db
/
2
)
**
2
)
/
2
lwp
=
np
.
sqrt
(
lwp
**
2
+
(
db
/
2
)
**
2
)
/
2
lwg
=
np
.
sqrt
(
lwg
**
2
+
(
fg
*
db
)
**
2
)
lwp
=
np
.
sqrt
(
lwp
**
2
+
(
fp
*
db
)
**
2
)
...
...
@@ -306,15 +312,18 @@ def FullL(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, lwp
M
=
CalculateSingleMmatrix
(
gPS
,
gPD
,
lwg
,
lwp
)
L0
=
np
.
array
(
np
.
matrix
(
Lfullpartial
)
+
M
)
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax
=
7
#print(nmax)
Ltemp
,
Omega
=
LtempCalculus
(
betag
,
betap
,
drivefreq
)
#print(factor)
L1
=
GetL1
(
Ltemp
,
L0
,
Omega
,
nmax
)
Lfull
=
L0
+
L1
#ESA CORRECCION ESTA EN L1
#HASTA ACA
if
betag
!=
0
and
betap
!=
0
:
#ESTA PARTE ES CUANDO AGREGAS MICROMOCION
nmax
=
2
*
int
(
betag
)
#print(nmax)
Ltemp
,
Omega
=
LtempCalculus
(
betag
,
betap
,
drivefreq
)
#print(factor)
L1
=
GetL1
(
Ltemp
,
L0
,
Omega
,
nmax
)
Lfull
=
L0
+
L1
#ESA CORRECCION ESTA EN L1
#HASTA ACA
else
:
Lfull
=
L0
#NORMALIZACION DE RHO
i
=
0
while
i
<
64
:
...
...
@@ -422,6 +431,9 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp
else
:
DetProbeVector
=
detpvec
*
1e6
*
2
*
np
.
pi
Detg
=
2
*
np
.
pi
*
Detg
*
1e6
#lwg, lwr, lwp = 2*np.pi*lwg*1e6, 2*np.pi*lwr*1e6, 2*np.pi*lwp*1e6
...
...
@@ -463,7 +475,7 @@ def CPTspectrum8levels(sg, sp, gPS, gPD, Detg, u, lwg, lwp, Temp, alpha, phidopp
plt
.
plot
(
DetProbeVectorMHz
,
[
100
*
f
for
f
in
Fluovector
],
label
=
str
(
titaprobe
)
+
'º, T: '
+
str
(
Temp
*
1e3
)
+
' mK'
)
plt
.
legend
()
return
DetProbeVectorMHz
,
Fluovector
return
DetProbeVectorMHz
,
np
.
array
(
Fluovector
)
def
CPTspectrum8levels_vel
(
velvect
,
titavec
,
phivec
,
probvel
,
sg
,
sp
,
gPS
,
gPD
,
Detg
,
u
,
lwg
,
lwp
,
Temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
Circularityprobe
,
beta
,
drivefreq
,
freqMin
=-
100
,
freqMax
=
100
,
freqStep
=
1e-1
,
plot
=
False
,
solvemode
=
1
):
...
...
@@ -613,7 +625,7 @@ def CPTspectrum8levels_vel(velvect,titavec,phivec,probvel,sg, sp, gPS, gPD, Detg
plt
.
plot
(
DetProbeVectorMHz
,
[
100
*
f
for
f
in
Fluovector
],
label
=
str
(
titaprobe
)
+
'º, T: '
+
str
(
Temp
*
1e3
)
+
' mK'
)
plt
.
legend
()
return
DetProbeVectorMHz
,
Fluovector
return
DetProbeVectorMHz
,
np
.
array
(
Fluovector
)
if
__name__
==
"__main__"
:
...
...
analisis/plots/20231218_CPT_muri/CPT_plotter_20231123.py
0 → 100644
View file @
10a38c15
This diff is collapsed.
Click to expand it.
analisis/plots/20231218_CPT_muri/CPT_plotter_20231218.py
0 → 100644
View file @
10a38c15
import
h5py
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
sys
import
re
import
ast
from
scipy.optimize
import
curve_fit
import
os
from
scipy
import
interpolate
"""
CPT con tres laseres pero lso dos IR son el mismo entonces las DD son mas finas
"""
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211223_CPT_DosLaseres_v07_ChristmasSpecial\Data
ALL_FILES
=
"""000016420-IR_Scan_withcal_optimized
"""
def
SeeKeys
(
files
):
for
i
,
fname
in
enumerate
(
files
.
split
()):
data
=
h5py
.
File
(
fname
+
'.h5'
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
print
(
fname
)
print
(
list
(
data
[
'datasets'
]
.
keys
()))
print
(
SeeKeys
(
ALL_FILES
))
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211101_CPT_DosLaseres_v03\Data
Counts
=
[]
Freqs
=
[]
AmpTisa
=
[]
UVCPTAmp
=
[]
No_measures
=
[]
for
i
,
fname
in
enumerate
(
ALL_FILES
.
split
()):
print
(
str
(
i
)
+
' - '
+
fname
)
#print(fname)
data
=
h5py
.
File
(
fname
+
'.h5'
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
# Aca hago algo repugnante para poder levantar los strings que dejamos
# que además tenian un error de tipeo al final. Esto no deberá ser necesario
# cuando se solucione el error este del guardado.
Freqs
.
append
(
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
]))
Counts
.
append
(
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
]))
#AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
#UVCPTAmp.append(np.array(data['datasets']['UV_CPT_amp']))
#No_measures.append(np.array(data['datasets']['no_measures']))
#%%
#Barriendo angulo del IR con tisa apagado
jvec
=
[
0
]
jselected
=
jvec
plt
.
figure
()
i
=
0
for
j
in
jvec
:
if
j
in
jselected
:
plt
.
errorbar
([
2
*
f
*
1e-6
for
f
in
Freqs
[
j
]],
Counts
[
j
],
yerr
=
np
.
sqrt
(
Counts
[
j
]),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
#plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label=f'Amp Tisa: {AmpTisa[i]}', mb arkersize=3)
i
=
i
+
1
plt
.
xlabel
(
'Frecuencia (MHz)'
)
plt
.
ylabel
(
'counts'
)
plt
.
grid
()
plt
.
legend
()
#%%
from
scipy.optimize
import
curve_fit
import
time
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
90
phiprobe
=
0
titaprobe
=
0.1
Temp
=
0.5e-3
sg
=
0.544
sp
=
4.5
sr
=
0
DetRepump
=
0
lw
=
0.1
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
,
lw
#ancho de linea de los laseres
u
=
32.5e6
#B = (u/(2*np.pi))/c
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
alpha
=
0
drivefreq
=
2
*
np
.
pi
*
22.135
*
1e6
noiseamplitude
=
0
selectedcurve
=
0
FreqsDR
=
Freqs
[
selectedcurve
]
CountsDR
=
Counts
[
selectedcurve
]
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
CircPr
=
1
alpha
=
0
def
FitEIT_MM_1ion
(
Freqs
,
offset
,
DetDoppler
,
DetRepump
,
SG
,
SP
,
SR
,
SCALE1
,
OFFSET
,
TEMP
,
U
,
plot
=
False
):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
# BETA1 = 0
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
# U = 32.5e6
freqs
=
[
2
*
f
*
1e-6
-
offset
for
f
in
Freqs
]
#Detunings, Fluorescence1 = PerformExperiment_8levels_MM(SG, SP, gPS, gPD, DetDoppler, u, DopplerLaserLinewidth, ProbeLaserLinewidth, TEMP, alpha, phidoppler, titadoppler, phiprobe, titaprobe, BETA1, drivefreq, min(freqs), max(freqs)+(freqs[1]-freqs[0]), freqs[1]-freqs[0], circularityprobe=CircPr, plot=False, solvemode=1, detpvec=None)
Detunings
,
Fluorescence1
=
GenerateNoisyCPT_fit
(
SG
,
SR
,
SP
,
gPS
,
gPD
,
DetDoppler
,
DetRepump
,
U
,
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
[
titaprobe
],
phirepump
,
titarepump
,
freqs
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
noiseamplitude
)
ScaledFluo1
=
np
.
array
([
f
*
SCALE1
+
OFFSET
for
f
in
Fluorescence1
])
if
plot
:
return
ScaledFluo1
,
Detunings
else
:
return
ScaledFluo1
#return ScaledFluo1
do_fit
=
True
if
do_fit
:
popt_1
,
pcov_1
=
curve_fit
(
FitEIT_MM_1ion
,
FreqsDR
,
CountsDR
,
p0
=
[
430
,
-
25
,
12
,
0.9
,
6.2
,
3
,
3e4
,
2e3
,
0.5e-3
,
32e6
],
bounds
=
((
0
,
-
100
,
-
20
,
0
,
0
,
0
,
0
,
0
,
0
,
20e6
),
(
1000
,
0
,
50
,
2
,
20
,
20
,
5e6
,
5e4
,
15e-3
,
40e6
)))
FittedEITpi_1_short
,
Detunings_1_short
=
FitEIT_MM_1ion
(
FreqsDR
,
*
popt_1
,
plot
=
True
)
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
FittedEITpi_1_long
,
Detunings_1_long
=
FitEIT_MM_1ion
(
freqslong
,
*
popt_1
,
plot
=
True
)
#%%
plt
.
figure
()
plt
.
errorbar
(
Detunings_1_short
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'red'
,
alpha
=
0.5
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
Detunings_1_long
,
FittedEITpi_1_long
,
color
=
'darkolivegreen'
,
linewidth
=
3
,
label
=
'med 1'
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
#plt.xlim(-20,0)
plt
.
legend
(
loc
=
'upper left'
,
fontsize
=
20
)
plt
.
grid
()
#%%
u
=
32.5e6
B
=
(
u
/
(
2
*
np
.
pi
))
/
c
correccion
=
8
#con 8 fitea bien
offsetxpi
=
440
+
1
+
correccion
DetDoppler
=
-
5.0
-
correccion
FreqsDRpi_3
=
[
2
*
f
*
1e-6
-
offsetxpi
+
14
for
f
in
Freqs_B
[
5
]]
CountsDRpi_3
=
Counts_B
[
5
]
freqslongpi_3
=
np
.
arange
(
min
(
FreqsDRpi_3
),
max
(
FreqsDRpi_3
)
+
FreqsDRpi_3
[
1
]
-
FreqsDRpi_3
[
0
],
0.1
*
(
FreqsDRpi_3
[
1
]
-
FreqsDRpi_3
[
0
]))
#[1.71811842e+04 3.34325038e-17]
def
FitEITpi
(
freqs
,
SG
,
SP
):
temp
=
2e-3
MeasuredFreq
,
MeasuredFluo
=
GenerateNoisyCPT_fit
(
SG
,
sr
,
SP
,
gPS
,
gPD
,
DetDoppler
,
DetRepump
,
u
,
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
,
temp
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
[
titaprobe
],
phirepump
,
titarepump
,
freqs
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
,
noiseamplitude
=
noiseamplitude
)
FinalFluo
=
[
f
*
6.554e4
+
1.863e3
for
f
in
MeasuredFluo
]
return
FinalFluo
popt_tisaoff
,
pcov_tisaoff
=
curve_fit
(
FitEITpi
,
FreqsDRpi_3
,
CountsDRpi_3
,
p0
=
[
0.5
,
4.5
],
bounds
=
((
0
,
0
),
(
2
,
10
)))
print
(
popt_tisaoff
)
Sat_3
=
popt_tisaoff
[
0
]
Det_3
=
popt_tisaoff
[
1
]
FittedEITpi_3
=
FitEITpi
(
freqslongpi_3
,
*
popt_tisaoff
)
plt
.
figure
()
plt
.
errorbar
(
FreqsDRpi_3
,
CountsDRpi_3
,
yerr
=
2
*
np
.
sqrt
(
CountsDRpi_3
),
fmt
=
'o'
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslongpi_3
,
FittedEITpi_3
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
FreqsCalibradas_B
=
FreqsDRpi_3
analisis/plots/20231218_CPT_muri/CPT_plotter_20231218_muri.py
View file @
10a38c15
...
...
@@ -14,7 +14,7 @@ Primero tengo mediciones de espectros cpt de un ion variando la tension dc_A
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220106_CPT_DosLaseres_v08_TISA_DR\Data
os
.
chdir
(
'/home/
nico/Documents/artiq_experiments/analisis/plots/20231123_CPTconmicromocion3/Data/
'
)
os
.
chdir
(
'/home/
muri/nubeDF/Documents/codigos/artiq_experiments/analisis/plots/20231218_CPT_muri/Data
'
)
CPT_FILES
=
"""000016262-IR_Scan_withcal_optimized
000016239-IR_Scan_withcal_optimized
...
...
@@ -111,7 +111,84 @@ plt.grid()
plt
.
legend
()
#%%
from
EITfit.MM_eightLevel_2repumps_AnalysisFunctions
import
PerformExperiment_8levels_MM
phidoppler
,
titadoppler
=
0
,
90
phirepump
,
titarepump
=
0
,
0
phiprobe
=
0
titaprobe
=
90
Temp
=
0.5e-3
sg
=
0.544
sp
=
4.5
sr
=
0
DetRepump
=
0
lw
=
0.1
DopplerLaserLinewidth
,
RepumpLaserLinewidth
,
ProbeLaserLinewidth
=
lw
,
lw
,
lw
#ancho de linea de los laseres
u
=
32.5e6
#B = (u/(2*np.pi))/c
correccion
=
13
offsetxpi
=
419
+
correccion
DetDoppler
=
-
11.5
-
correccion
gPS
,
gPD
,
=
2
*
np
.
pi
*
21.58e6
,
2
*
np
.
pi
*
1.35e6
alpha
=
0
drivefreq
=
2
*
np
.
pi
*
22.135
*
1e6
selectedcurve
=
4
FreqsDR
=
[
2
*
f
*
1e-6
-
offsetxpi
for
f
in
Freqs
[
0
]]
CountsDR
=
CountsSplit
[
0
][
selectedcurve
]
CountsDR
[
100
]
=
0.5
*
(
CountsDR
[
99
]
+
CountsDR
[
101
])
CountsDR
[
105
]
=
0.5
*
(
CountsDR
[
104
]
+
CountsDR
[
106
])
freqslong
=
np
.
arange
(
min
(
FreqsDR
),
max
(
FreqsDR
)
+
FreqsDR
[
1
]
-
FreqsDR
[
0
],
0.1
*
(
FreqsDR
[
1
]
-
FreqsDR
[
0
]))
CircPr
=
1
alpha
=
0
def
FitEIT_MM_single
(
freqs
,
SG
,
SP
,
SCALE1
,
OFFSET
,
BETA1
,
TEMP
):
#def FitEIT_MM(freqs, SG, SP, SCALE1, OFFSET, BETA1):
#BETA = 1.8
# SG = 0.6
# SP = 8.1
# TEMP = 0.2e-3
Detunings
,
Fluorescence1
=
PerformExperiment_8levels_MM
(
SG
,
SP
,
gPS
,
gPD
,
DetDoppler
,
u
,
DopplerLaserLinewidth
,
ProbeLaserLinewidth
,
TEMP
,
alpha
,
phidoppler
,
titadoppler
,
phiprobe
,
titaprobe
,
BETA1
,
drivefreq
,
min
(
freqs
),
max
(
freqs
)
+
(
freqs
[
1
]
-
freqs
[
0
]),
freqs
[
1
]
-
freqs
[
0
],
circularityprobe
=
CircPr
,
plot
=
False
,
solvemode
=
1
,
detpvec
=
None
)
ScaledFluo1
=
np
.
array
([
f
*
SCALE1
+
OFFSET
for
f
in
Fluorescence1
])
return
ScaledFluo1
#return ScaledFluo1
do_fit
=
True
if
do_fit
:
popt_1
,
pcov_1
=
curve_fit
(
FitEIT_MM_single
,
FreqsDR
,
CountsDR
,
p0
=
[
0.9
,
6.2
,
3e4
,
1.34e3
,
0
,
1e-3
],
bounds
=
((
0
,
0
,
0
,
0
,
0
,
0
),
(
2
,
20
,
7e4
,
5e4
,
0.000001
,
15e-3
)))
FittedEITpi_1
=
FitEIT_MM_single
(
freqslong
,
*
popt_1
)
beta1
=
popt_1
[
4
]
errorbeta1
=
np
.
sqrt
(
pcov_1
[
4
,
4
])
temp1
=
popt_1
[
5
]
errortemp1
=
np
.
sqrt
(
pcov_1
[
5
,
5
])
plt
.
figure
()
plt
.
errorbar
(
FreqsDR
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'darkgreen'
,
alpha
=
0.5
,
capsize
=
2
,
markersize
=
2
)
plt
.
plot
(
freqslong
,
FittedEITpi_1
,
color
=
'darkolivegreen'
,
linewidth
=
3
,
label
=
'med 1'
)
#plt.title(f'Sdop: {round(popt[0], 2)}, Spr: {round(popt[1], 2)}, T: {round(popt[2]*1e3, 2)} mK, detDop: {DetDoppler} MHz')
plt
.
xlabel
(
'Detuning (MHz)'
)
plt
.
ylabel
(
'Counts'
)
plt
.
legend
(
loc
=
'upper left'
,
fontsize
=
20
)
plt
.
grid
()
analisis/plots/20231218_CPT_muri/Data/EITfit/MM_eightLevel_2repumps_AnalysisFunctions.py
View file @
10a38c15
...
...
@@ -15,7 +15,7 @@ import numpy as np
import
time
import
matplotlib.pyplot
as
plt
from
scipy.signal
import
argrelextrema
#
from EITfit.MM_eightLevel_2repumps_python_scripts import CPTspectrum8levels_MM
from
EITfit.MM_eightLevel_2repumps_python_scripts
import
CPTspectrum8levels_MM
import
random
from
scipy.signal
import
savgol_filter
as
sf
...
...
analisis/plots/20231218_CPT_muri/Data/EITfit/MM_eightLevel_2repumps_python_scripts.py
View file @
10a38c15
...
...
@@ -233,7 +233,7 @@ def dopplerBroadening(wlg, wlp, alpha, T, mcalcio = 6.655e-23*1e-3):
kboltzmann
=
1.38e-23
#J/K
gammaD
=
(
2
*
np
.
pi
)
*
np
.
sqrt
((
1
/
(
wlg
*
wlg
))
+
(
1
/
(
wlp
*
wlp
))
-
2
*
(
1
/
(
wlg
*
wlp
))
*
np
.
cos
(
alpha
))
*
np
.
sqrt
(
kboltzmann
*
T
/
(
2
*
mcalcio
))
gammaD
=
(
2
*
np
.
pi
)
*
np
.
sqrt
((
1
/
(
wlg
*
wlg
))
+
(
1
/
(
wlp
*
wlp
))
-
2
*
(
1
/
(
wlg
*
wlp
))
*
np
.
cos
(
alpha
))
*
np
.
sqrt
(
kboltzmann
*
T
/
(
mcalcio
))
return
gammaD
...
...
@@ -249,8 +249,14 @@ def FullL_MM(rabG, rabP, gPS = 0, gPD = 0, Detg = 0, Detp = 0, u = 0, lwg = 0, l
db
=
dopplerBroadening
(
0.397e-6
,
0.866e-6
,
alpha
,
T
)
lwg
=
np
.
sqrt
(
lwg
**
2
+
db
**
2
)
lwp
=
np
.
sqrt
(
lwp
**
2
+
db
**
2
)
kg
=
1
/
397
kp
=
1
/
866
fg
=
kg
**
2
/
(
kg
**
2
+
kp
**
2
)
fp
=
kp
**
2
/
(
kg
**
2
+
kp
**
2
)
lwg
=
np
.
sqrt
(
lwg
**
2
+
(
fg
*
db
)
**
2
)
lwp
=
np
.
sqrt
(
lwp
**
2
+
(
fp
*
db
)
**
2
)
CC
=
EffectiveL
(
gPS
,
gPD
,
lwg
,
lwp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment