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
7c9853d0
Commit
7c9853d0
authored
Mar 13, 2025
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pruebas para comp microm
parent
e8465927
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
744 additions
and
1 deletion
+744
-1
last_rid.pyon
artiq_master/last_rid.pyon
+1
-1
Transitorios_osci.py
...alibrations/Micromotion compensation/Transitorios_osci.py
+290
-0
mmcompensation.py
...y/Calibrations/Micromotion compensation/mmcompensation.py
+453
-0
000020221-MicromotionCompensation.h5
...esults/2025-03-13/16/000020221-MicromotionCompensation.h5
+0
-0
000020222-MicromotionCompensation.h5
...esults/2025-03-13/16/000020222-MicromotionCompensation.h5
+0
-0
000020223-MicromotionCompensation.h5
...esults/2025-03-13/16/000020223-MicromotionCompensation.h5
+0
-0
000020227-MicromotionCompensation.h5
...esults/2025-03-13/16/000020227-MicromotionCompensation.h5
+0
-0
000020229-MicromotionCompensation.h5
...esults/2025-03-13/16/000020229-MicromotionCompensation.h5
+0
-0
000020230-MicromotionCompensation.h5
...esults/2025-03-13/16/000020230-MicromotionCompensation.h5
+0
-0
000020231-MicromotionCompensation.h5
...esults/2025-03-13/16/000020231-MicromotionCompensation.h5
+0
-0
No files found.
artiq_master/last_rid.pyon
View file @
7c9853d0
202
17
202
31
artiq_master/repository/Calibrations/Micromotion compensation/Transitorios_osci.py
0 → 100644
View file @
7c9853d0
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
#os.chdir('/home/nico/Documents/artiq_experiments/analisis/plots/20221006_transitoriosv2')
os
.
chdir
(
'/home/nico/Documents/artiq_experiments/analisis/plots/20241210_posibleosc/Data'
)
def
expo
(
T
,
tau
,
N0
,
C
):
global
T0
return
N0
*
np
.
exp
(
-
(
T
-
T0
)
/
tau
)
+
C
def
pow_from_amp
(
amp
):
"""Paso de amplitud urukul a potencia medida por Nico"""
# Forma altamente ineficiente de hacer esto, pero me salio asi
amplitudes_UV
=
np
.
flip
(
np
.
array
([
0.08
,
0.10
,
0.12
,
0.14
,
0.16
,
0.18
,
0.20
,
0.22
,
0.24
,
0.26
,
0.28
,
0.30
]))
assert
amp
in
amplitudes_UV
potencias_UV
=
np
.
flip
(
np
.
array
([
4
,
10
,
19
,
32
,
49
,
71
,
96
,
125
,
155
,
183
,
208
,
229
]))
return
potencias_UV
[
np
.
where
(
amplitudes_UV
==
amp
)][
0
]
def
SP_Bkgr_builder
(
amp_in
,
amp_fin
,
derivadainicio
,
derivadafin
,
longbins
):
CalibCurve
=
[]
j
=
0
while
j
<
longbins
:
if
j
<=
derivadainicio
:
CalibCurve
.
append
(
amp_in
)
elif
j
>=
derivadainicio
and
j
<=
derivadafin
:
pendiente
=
(
amp_fin
-
amp_in
)
/
(
derivadafin
-
derivadainicio
)
CalibCurve
.
append
(
amp_in
+
pendiente
*
(
j
-
derivadainicio
))
else
:
CalibCurve
.
append
(
amp_fin
)
j
=
j
+
1
return
CalibCurve
"""
plt.plot(amplitudes_UV, potencias_UV, 'ko-', lw=0.2)
plt.xlabel("Amplitud Urukul")
plt.ylabel("Potencia /uW")
plt.grid()
"""
#%%
import
scipy.fftpack
BINW
=
1e-2
T0
=
-
0.4e-6
files
=
[
19613
]
#el 19613 es el que muestra el pico en 48.5 Hz
SP_Heigths
=
[]
SP_Bins
=
[]
for
i
,
fname
in
enumerate
(
files
):
#print(i)
#print(fname)
data
=
h5py
.
File
(
'Data/0000'
+
str
(
fname
)
+
'-CRB.h5'
,
'r'
)
counts
=
np
.
array
(
data
[
'datasets'
][
'counts'
])
bines
=
np
.
arange
(
counts
.
min
(),
counts
.
max
()
+
BINW
,
BINW
)
heigs
,
binsf
=
np
.
histogram
(
counts
,
bines
[
bines
>
T0
])
SP_Heigths
.
append
(
heigs
)
SP_Bins
.
append
(
binsf
)
from
scipy.optimize
import
curve_fit
refe
=
len
(
SP_Bins
[
0
])
prop
=
1
RefBins
=
[
t
for
t
in
SP_Bins
[
0
][:
int
(
prop
*
refe
)]]
# plt.figure()
# plt.plot(RefBins[:-1], SP_Heigths[0][:int(prop*refe)],'-o')
x
=
RefBins
[:
-
1
]
y
=
SP_Heigths
[
0
][:
int
(
prop
*
refe
)]
cc
=
np
.
ones
(
len
(
counts
))
fluo
=
np
.
cumsum
(
cc
)
-
np
.
polyval
(
np
.
polyfit
(
counts
,
np
.
cumsum
(
cc
),
1
),
counts
)
plt
.
figure
()
plt
.
plot
(
counts
,
fluo
)
plt
.
xlabel
(
'Tiempo (s)'
)
plt
.
ylabel
(
'Cumsum photons'
)
y
=
np
.
array
([
f
for
f
in
fluo
])
dt
=
np
.
mean
(
np
.
diff
(
np
.
array
(
counts
)))
print
(
dt
)
plt
.
figure
()
# plt.plot(x, y, label='Señal original')
plt
.
magnitude_spectrum
(
y
*
np
.
hanning
(
len
(
y
)),
Fs
=
1
/
dt
)
plt
.
xlabel
(
'Frecuencia (Hz)'
)
plt
.
ylabel
(
'Amplitud'
)
# plt.xlim(-10,200)
plt
.
grid
(
True
)
# plt.legend()
#%%
"""
Esto binea fotones asumienod que la cantidad de fotones que llegan en un intervalo tau
esta modulada por una funcion periodica. Entonces a los tiempos de llegada entre
0 y tau no les hace nada, a los tiempos entre tau y 2tau les resta tau,
a los tiempos entre 2tau y 3tau les resta tau, y asi. Y despues
binea y ajusta con una sinusoidal y devuelve la frecuencia del ajuste.
Asi anda barbaro para ver la oscilacion a casi 50 Hz
"""
def
bin_time_arrivals
(
arrival_times
,
tau
):
"""
Binea los tiempos de llegada de los fotones según el periodo tau.
Parameters:
arrival_times (numpy array): Vector con los tiempos de llegada de los fotones.
tau (float): Periodo de bineado.
Returns:
numpy array: Vector con los tiempos bienados.
"""
return
arrival_times
-
tau
*
(
arrival_times
//
tau
)
taurf
=
1
/
(
22.135e6
)
taurf
=
1
/
49.9
tiemposarreglados
=
bin_time_arrivals
(
counts
,
taurf
)
b
=
taurf
/
100
# Ancho de bineo
bins
=
np
.
arange
(
0
,
taurf
,
b
)
hist
,
bin_edges
=
np
.
histogram
(
tiemposarreglados
,
bins
=
bins
)
colors
=
[
'b'
,
'g'
,
'r'
]
# Colores para cada repetición
x_extended
=
np
.
concatenate
([
bin_edges
[:
-
1
]
+
i
*
taurf
for
i
in
range
(
3
)])
y_extended
=
np
.
tile
(
hist
,
3
)
def
sinusoidal
(
x
,
A
,
B
,
C
,
D
):
return
A
*
np
.
sin
(
B
*
x
+
C
)
+
D
x_extended_dense
=
np
.
arange
(
np
.
min
(
x_extended
),
np
.
max
(
x_extended
),
0.1
*
(
x_extended
[
1
]
-
x_extended
[
0
]))
params
,
_
=
curve_fit
(
sinusoidal
,
x_extended
,
y_extended
,
p0
=
[
max
(
y_extended
),
2
*
np
.
pi
/
taurf
,
0
,
np
.
mean
(
y_extended
)])
# Graficar los datos y el ajuste
plt
.
figure
(
figsize
=
(
8
,
4
))
plt
.
plot
(
x_extended
,
y_extended
,
marker
=
'o'
,
linestyle
=
'-'
,
label
=
"Datos"
,
color
=
'gray'
)
plt
.
plot
(
x_extended_dense
,
sinusoidal
(
x_extended_dense
,
*
params
),
linestyle
=
'--'
,
label
=
"Ajuste sinusoidal"
,
color
=
'red'
)
for
i
in
range
(
3
):
plt
.
plot
(
bin_edges
[:
-
1
]
+
i
*
taurf
,
hist
,
marker
=
'o'
,
linestyle
=
'-'
,
color
=
colors
[
i
])
plt
.
xlabel
(
"Tiempo bineado (repetido 3 veces)"
)
plt
.
ylabel
(
"Frecuencia"
)
plt
.
title
(
"Distribución de tiempos bineados con ajuste sinusoidal"
)
plt
.
legend
()
plt
.
show
()
print
(
f
'Frecuencia del ajuste: {round(params[1]/(2*np.pi),2)} Hz'
)
#%%
"""
Esto deberia hacerse asi para ver la oscilacion a la RF (micromocion)
"""
BINW
=
1e-2
T0
=
-
0.4e-6
files
=
[
19607
]
#el 19613 es el que muestra el pico en 48.5 Hz
SP_Heigths
=
[]
SP_Bins
=
[]
for
i
,
fname
in
enumerate
(
files
):
#print(i)
#print(fname)
data
=
h5py
.
File
(
'Data/0000'
+
str
(
fname
)
+
'-CRB.h5'
,
'r'
)
counts
=
np
.
array
(
data
[
'datasets'
][
'counts'
])
bines
=
np
.
arange
(
counts
.
min
(),
counts
.
max
()
+
BINW
,
BINW
)
heigs
,
binsf
=
np
.
histogram
(
counts
,
bines
[
bines
>
T0
])
SP_Heigths
.
append
(
heigs
)
SP_Bins
.
append
(
binsf
)
def
bin_time_arrivals
(
arrival_times
,
tau
):
"""
Binea los tiempos de llegada de los fotones según el periodo tau.
Parameters:
arrival_times (numpy array): Vector con los tiempos de llegada de los fotones.
tau (float): Periodo de bineado.
Returns:
numpy array: Vector con los tiempos bienados.
"""
return
arrival_times
-
tau
*
(
arrival_times
//
tau
)
freqrf
=
22.135e6
taurf
=
1
/
freqrf
tiemposarreglados
=
bin_time_arrivals
(
counts
,
taurf
)
b
=
taurf
/
50
# Ancho de bineo
bins
=
np
.
arange
(
0
,
taurf
,
b
)
hist
,
bin_edges
=
np
.
histogram
(
tiemposarreglados
,
bins
=
bins
)
colors
=
[
'b'
,
'g'
,
'r'
]
# Colores para cada repetición
x_extended
=
np
.
concatenate
([
bin_edges
[:
-
1
]
+
i
*
taurf
for
i
in
range
(
3
)])
y_extended
=
np
.
tile
(
hist
,
3
)
def
sinusoidal
(
x
,
A
,
C
,
D
):
return
A
*
np
.
sin
(
2
*
np
.
pi
*
freqrf
*
x
+
C
)
+
D
x_extended_dense
=
np
.
arange
(
np
.
min
(
x_extended
),
np
.
max
(
x_extended
),
0.1
*
(
x_extended
[
1
]
-
x_extended
[
0
]))
params
,
_
=
curve_fit
(
sinusoidal
,
x_extended
,
y_extended
,
p0
=
[
max
(
y_extended
),
0
,
np
.
mean
(
y_extended
)])
# Graficar los datos y el ajuste
plt
.
figure
(
figsize
=
(
8
,
4
))
# plt.plot(x_extended, y_extended, marker='o', linestyle='-', label="Datos", color='gray')
plt
.
plot
(
x_extended_dense
,
sinusoidal
(
x_extended_dense
,
*
params
),
linestyle
=
'--'
,
label
=
"Ajuste sinusoidal"
,
color
=
'black'
,
linewidth
=
3
,
zorder
=
2
)
for
i
in
range
(
3
):
plt
.
plot
(
bin_edges
[:
-
1
]
+
i
*
taurf
,
hist
,
marker
=
'o'
,
linestyle
=
'-'
,
color
=
colors
[
i
],
markersize
=
3
,
zorder
=
1
)
plt
.
xlabel
(
"Tiempo bineado (repetido 3 veces)"
)
plt
.
ylabel
(
"Frecuencia"
)
plt
.
title
(
"Distribución de tiempos bineados con ajuste sinusoidal"
)
plt
.
ylim
(
0
,
np
.
max
(
hist
)
*
1.2
)
plt
.
legend
()
plt
.
show
()
print
(
f
'Amplitud normalizada: {np.abs(round(100*params[0]/params[2],3))}
%
'
)
#%%
# Parámetros
n
=
len
(
x
)
# Número de muestras
dt
=
x
[
1
]
-
x
[
0
]
# Paso temporal
# Transformada de Fourier
fft_y
=
np
.
fft
.
fft
(
y
)
frequencies
=
np
.
fft
.
fftfreq
(
n
,
dt
)
# Frecuencias asociadas
# Solo nos quedamos con la mitad positiva (frecuencias reales)
positive_frequencies
=
frequencies
[:
n
//
2
]
positive_fft
=
np
.
abs
(
fft_y
[:
n
//
2
])
# Graficar la señal original y su espectro de frecuencias
plt
.
figure
()
# plt.plot(x, y, label='Señal original')
plt
.
magnitude_spectrum
((
y
-
y
.
mean
())
*
np
.
hanning
(
len
(
y
)),
Fs
=
1
/
dt
)
plt
.
title
(
'Señal en el Dominio del Tiempo'
)
plt
.
xlabel
(
'Tiempo (s)'
)
plt
.
ylabel
(
'Amplitud'
)
plt
.
grid
(
True
)
plt
.
legend
()
# Espectro de frecuencias
plt
.
figure
()
plt
.
plot
(
positive_frequencies
[
1
:],
positive_fft
[
1
:],
'-o'
,
label
=
'Espectro de frecuencias'
)
plt
.
title
(
'Transformada de Fourier'
)
plt
.
xlabel
(
'Frecuencia (Hz)'
)
plt
.
ylabel
(
'Amplitud'
)
plt
.
grid
(
True
)
# plt.xlim(0,160)
#plt.axvline(50)
# plt.ylim(-10,300)
plt
.
legend
()
plt
.
tight_layout
()
plt
.
show
()
artiq_master/repository/Calibrations/Micromotion compensation/mmcompensation.py
0 → 100644
View file @
7c9853d0
from
artiq.experiment
import
*
from
pyLIAF.artiq.controllers
import
UrukulCh
import
numpy
as
np
# TODO:
# [ ] Revisar los tiempos
# [ ] Ver por que da overflow intermitentemente en las corrids
# [ ] Ver como esta guardando los resultados y guardar lo que falta
# [ ] Cambiarle los parametros a los laseres cuando arranca el exp
class
MicromotionCompensation
(
EnvExperiment
):
"""Micromotion compensation code measuring correlation fluorescence vs rf"""
def
build
(
self
):
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"ccb"
)
self
.
pmt
=
self
.
get_device
(
"ttl0"
)
self
.
rfsignal
=
self
.
get_device
(
"ttl3"
)
self
.
laserUV
=
UrukulCh
(
self
,
ch
=
2
,
freq
=
110.0
,
amp
=
0.3
,
name
=
"UV"
)
#corresponde a 0.7 Vpp
self
.
laserIR1
=
UrukulCh
(
self
,
ch
=
1
,
freq
=
208.0
,
amp
=
0.35
,
name
=
"IR1"
)
#corresponde a 0.8 Vpp
self
.
laserIR2
=
UrukulCh
(
self
,
ch
=
3
,
freq
=
80.0
,
amp
=
0.2
,
name
=
"IR2"
)
#corresponde a 0.8 Vpp
self
.
laserIR2shift
=
UrukulCh
(
self
,
ch
=
0
,
freq
=
270.0
,
amp
=
0.7
,
name
=
"IR2shift"
)
#corresponde a 0.8 Vpp
# self.setattr_argument("bin", NumberValue(50e-9, unit='us'), "Binning params")
self
.
setattr_argument
(
"no_measures"
,
NumberValue
(
1000
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_prepDS"
,
NumberValue
(
10
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_cool"
,
NumberValue
(
1000
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_readout"
,
NumberValue
(
10
*
ms
,
unit
=
'ms'
,
scale
=
ms
,
min
=
0.001
*
ms
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_wait"
,
NumberValue
(
5
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
f
"UV_preparation_freq"
,
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"UV_preparation_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR1_preparation_freq"
,
NumberValue
(
229
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR1_preparation_amp"
,
NumberValue
(
0.19
,
min
=
0.0
,
max
=
0.35
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR2_preparation_freq"
,
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR2_preparation_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
"Laser params"
)
self
.
setattr_argument
(
f
"UV_measurement_freq"
,
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"UV_measurement_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR1_measurement_freq"
,
NumberValue
(
229
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR1_measurement_amp"
,
NumberValue
(
0.19
,
min
=
0.0
,
max
=
0.35
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR2_measurement_freq"
,
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR2_measurement_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
"Laser params"
)
self
.
setattr_argument
(
f
"UV_cooling_freq"
,
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"UV_cooling_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR1_cooling_freq"
,
NumberValue
(
225
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR1_cooling_amp"
,
NumberValue
(
0.25
,
min
=
0.0
,
max
=
0.35
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR2_cooling_freq"
,
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR2_cooling_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
"Cooling params"
)
self
.
setattr_argument
(
f
"UV_final_freq"
,
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"UV_final_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR1_final_freq"
,
NumberValue
(
225
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR1_final_amp"
,
NumberValue
(
0.25
,
min
=
0.0
,
max
=
0.35
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR2_final_freq"
,
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Cooling params"
)
self
.
setattr_argument
(
f
"IR2_final_amp"
,
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
"Cooling params"
)
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
@
rpc
def
create_datasets
(
self
):
self
.
set_dataset
(
"counts"
,
[],
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"countsrf"
,
[],
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"t_readout"
,
self
.
t_readout
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_prepDS"
,
self
.
t_prepDS
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_enfriar_ion"
,
self
.
t_cool
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_wait"
,
self
.
t_wait
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"no_measures"
,
self
.
no_measures
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_preparation_freq"
,
self
.
IR1_preparation_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_preparation_amp"
,
self
.
IR1_preparation_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_preparation_freq"
,
self
.
IR2_preparation_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_preparation_amp"
,
self
.
IR2_preparation_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_preparation_freq"
,
self
.
UV_preparation_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_preparation_amp"
,
self
.
UV_preparation_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_cooling_freq"
,
self
.
IR1_cooling_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_cooling_amp"
,
self
.
IR1_cooling_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_cooling_freq"
,
self
.
IR2_cooling_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_cooling_amp"
,
self
.
IR2_cooling_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_cooling_freq"
,
self
.
UV_cooling_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_cooling_amp"
,
self
.
UV_cooling_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_measurement_freq"
,
self
.
IR1_measurement_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR1_measurement_amp"
,
self
.
IR1_measurement_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_measurement_freq"
,
self
.
IR2_measurement_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"IR2_measurement_amp"
,
self
.
IR2_measurement_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_measurement_freq"
,
self
.
UV_measurement_freq
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_measurement_amp"
,
self
.
UV_measurement_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
laserIR1
.
generate_dataset
()
self
.
laserIR2
.
generate_dataset
()
self
.
laserUV
.
generate_dataset
()
#self.set_dataset("frec_UV",self.frec_UV, broadcast=False,archive=True)
#self.set_dataset("frec_IR",self.frec_IR, broadcast=False,archive=True)
# TODO: Agregar forma de guardar los datos de los canales del Urukul.
# o bien guardando todos aca, o armando un metodo apropiado en su controlador
self
.
set_dataset
(
"Comments"
,
self
.
Comments
)
#self.set_dataset("binvector", np.arange(0, self.t_readout, self.bin*1e-6), broadcast=True, archive=False)
@
rpc
def
create_applets
(
self
):
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
"${python} -m pyLIAF.artiq.applets.histogram "
"counts "
"--update-delay 0.2"
)
@
kernel
def
run
(
self
):
self
.
create_datasets
()
self
.
create_applets
()
self
.
init_kernel
()
delay
(
1
*
ms
)
self
.
enfriar_ion
()
for
runN
in
range
(
self
.
no_measures
):
if
runN
%
50
==
0
:
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
self
.
core
.
seconds_to_mu
(
self
.
t_cool
)
)
else
:
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
self
.
core
.
seconds_to_mu
(
100
*
us
)
)
self
.
prep_DS
()
t_end
=
self
.
medicion_y_lectura
()
self
.
save_counts
(
t_end
)
#self.mutate_dataset("counts", runN, counts)
#self.cleanup()
self
.
core
.
break_realtime
()
self
.
enfriar_ion
()
self
.
core
.
break_realtime
()
self
.
laserIR1
.
select_profile
(
3
)
self
.
laserIR2
.
select_profile
(
3
)
self
.
laserUV
.
select_profile
(
3
)
self
.
laserIR2shift
.
select_profile
(
3
)
self
.
laserIR1
.
on
()
self
.
laserIR2
.
on
()
self
.
laserUV
.
on
()
self
.
laserIR2shift
.
on
()
#self.core.break_realtime()
#delay(1*ms)
#self.laserUV.set_frequency(self.UV_final_freq, self.UV_final_amp, profile=0)
#self.core.break_realtime()
#delay(1*ms)
#self.laserIR1.set_frequency(self.IR1_final_freq, self.IR1_final_amp, profile=0)
#self.core.break_realtime()
#delay(1*ms)
#self.laserIR2.set_frequency(self.IR2_final_freq, self.IR2_final_amp, profile=0)
@
kernel
def
init_kernel
(
self
):
self
.
core
.
reset
()
self
.
pmt
.
input
()
self
.
rfsignal
.
input
()
#self.pmt_state.output()
#self.laserIR.initialize_channel()
#self.laserUV.initialize_channel()
# Quizas haya errores de tiempo.
#self.pmt_state.off()
#self.laserIR.set_channel()
#self.laserUV.set_channel()
#self.core.wait_until_mu(now_mu())
delay
(
1
*
ms
)
self
.
laserIR1
.
set_channel
()
delay
(
1
*
ms
)
self
.
laserIR2
.
set_channel
()
delay
(
1
*
ms
)
self
.
laserIR2shift
.
set_channel
()
delay
(
1
*
ms
)
self
.
laserUV
.
set_channel
()
self
.
core
.
wait_until_mu
(
now_mu
())
self
.
core
.
break_realtime
()
self
.
laserUV
.
set_frequency
(
self
.
UV_measurement_freq
,
self
.
UV_measurement_amp
,
profile
=
0
)
self
.
core
.
break_realtime
()
self
.
laserIR1
.
set_frequency
(
self
.
IR1_measurement_freq
,
self
.
IR1_measurement_amp
,
profile
=
0
)
self
.
core
.
break_realtime
()
self
.
laserIR2
.
set_frequency
(
self
.
IR2_measurement_freq
,
self
.
IR2_measurement_amp
,
profile
=
0
)
self
.
core
.
break_realtime
()
self
.
laserIR2shift
.
set_frequency
(
270
*
MHz
,
0.7
,
profile
=
0
)
self
.
core
.
break_realtime
()
delay
(
1
*
ms
)
self
.
laserIR1
.
set_channel
(
profile
=
1
)
delay
(
1
*
ms
)
self
.
laserIR2
.
set_channel
(
profile
=
1
)
delay
(
1
*
ms
)
self
.
laserIR2shift
.
set_channel
(
profile
=
1
)
delay
(
1
*
ms
)
self
.
laserUV
.
set_channel
(
profile
=
1
)
self
.
core
.
break_realtime
()
self
.
laserUV
.
set_frequency
(
self
.
UV_cooling_freq
,
self
.
UV_cooling_amp
,
profile
=
1
)
self
.
core
.
break_realtime
()
self
.
laserIR1
.
set_frequency
(
self
.
IR1_cooling_freq
,
self
.
IR1_cooling_amp
,
profile
=
1
)
self
.
core
.
break_realtime
()
self
.
laserIR2
.
set_frequency
(
self
.
IR2_cooling_freq
,
self
.
IR2_cooling_amp
,
profile
=
1
)
self
.
core
.
break_realtime
()
self
.
laserIR2shift
.
set_frequency
(
270
*
MHz
,
0.7
,
profile
=
1
)
self
.
core
.
break_realtime
()
delay
(
1
*
ms
)
self
.
laserIR1
.
set_channel
(
profile
=
2
)
delay
(
1
*
ms
)
self
.
laserIR2
.
set_channel
(
profile
=
2
)
delay
(
1
*
ms
)
self
.
laserIR2shift
.
set_channel
(
profile
=
2
)
delay
(
1
*
ms
)
self
.
laserUV
.
set_channel
(
profile
=
2
)
self
.
core
.
break_realtime
()
self
.
laserUV
.
set_frequency
(
self
.
UV_preparation_freq
,
self
.
UV_preparation_amp
,
profile
=
2
)
self
.
core
.
break_realtime
()
self
.
laserIR1
.
set_frequency
(
self
.
IR1_preparation_freq
,
self
.
IR1_preparation_amp
,
profile
=
2
)
self
.
core
.
break_realtime
()
self
.
laserIR2
.
set_frequency
(
self
.
IR2_preparation_freq
,
self
.
IR2_preparation_amp
,
profile
=
2
)
self
.
core
.
break_realtime
()
self
.
laserIR2shift
.
set_frequency
(
270
*
MHz
,
0.7
,
profile
=
2
)
self
.
core
.
break_realtime
()
delay
(
1
*
ms
)
self
.
laserIR1
.
set_channel
(
profile
=
3
)
delay
(
1
*
ms
)
self
.
laserIR2
.
set_channel
(
profile
=
3
)
delay
(
1
*
ms
)
self
.
laserIR2shift
.
set_channel
(
profile
=
3
)
delay
(
1
*
ms
)
self
.
laserUV
.
set_channel
(
profile
=
3
)
self
.
core
.
break_realtime
()
self
.
laserUV
.
set_frequency
(
self
.
UV_final_freq
,
self
.
UV_final_amp
,
profile
=
3
)
self
.
core
.
break_realtime
()
self
.
laserIR1
.
set_frequency
(
self
.
IR1_final_freq
,
self
.
IR1_final_amp
,
profile
=
3
)
self
.
core
.
break_realtime
()
self
.
laserIR2
.
set_frequency
(
self
.
IR2_final_freq
,
self
.
IR2_final_amp
,
profile
=
3
)
self
.
core
.
break_realtime
()
self
.
laserIR2shift
.
set_frequency
(
270
*
MHz
,
0.7
,
profile
=
3
)
self
.
core
.
break_realtime
()
self
.
core
.
wait_until_mu
(
now_mu
())
@
kernel
def
enfriar_ion
(
self
):
"""Preparo el ion prendiendo ambos laseres"""
self
.
laserUV
.
select_profile
(
1
)
self
.
laserIR1
.
select_profile
(
1
)
self
.
laserIR2
.
select_profile
(
1
)
self
.
laserIR2shift
.
select_profile
(
1
)
self
.
laserIR1
.
on
()
self
.
laserIR2
.
on
()
self
.
laserUV
.
on
()
self
.
laserIR2shift
.
on
()
#delay(self.t_cool)
@
kernel
def
prep_DS
(
self
):
"""Preparo el estado oscuro prendiendo los 3 laseres con las frecuencias correctas"""
self
.
core
.
break_realtime
()
self
.
laserIR1
.
select_profile
(
2
)
self
.
laserIR2
.
select_profile
(
2
)
self
.
laserUV
.
select_profile
(
2
)
self
.
laserIR2shift
.
select_profile
(
2
)
self
.
laserUV
.
on
()
self
.
laserIR1
.
on
()
self
.
laserIR2
.
on
()
self
.
laserIR2shift
.
on
()
delay
(
self
.
t_prepDS
)
@
kernel
def
medicion_y_lectura
(
self
):
"""Registro cuentas emitidas con el laser UV prendido"""
self
.
laserUV
.
off
()
self
.
laserIR1
.
off
()
self
.
laserIR2
.
off
()
self
.
laserIR2shift
.
off
()
#self.pmt.gate_rising(self.t_readout)
self
.
laserIR1
.
select_profile
(
0
)
self
.
laserIR2
.
select_profile
(
0
)
self
.
laserUV
.
select_profile
(
0
)
self
.
laserIR2shift
.
select_profile
(
0
)
self
.
laserUV
.
on
()
self
.
laserIR1
.
on
()
self
.
laserIR2
.
on
()
self
.
laserIR2shift
.
on
()
#delay(self.t_wait)
# Prendo y apago la TTL para ver en el osc.
#self.pmt_state.on()
with
parallel
:
#self.pmt.gate_rising(self.t_readout)
self
.
rfsignal
.
gate_rising
(
self
.
t_readout
)
#with parallel:
#self.pmt_state.off()
self
.
enfriar_ion
()
#self.pmt_state.pulse(self.t_readout)
#cuentas = self.pmt.count(here)
#delay(1*us)
#self.enfriar_ion()
return
now_mu
()
@
kernel
def
save_counts
(
self
,
t_end
):
#count = self.pmt.timestamp_mu(t_end)
#t0 = t_end - self.core.seconds_to_mu(self.t_readout)
#while count > 0:
# self.append_to_dataset("counts", self.core.mu_to_seconds(count - t0) )
# count = self.pmt.timestamp_mu(t_end)
countrf
=
self
.
rfsignal
.
timestamp_mu
(
t_end
)
t0
=
t_end
-
self
.
core
.
seconds_to_mu
(
self
.
t_readout
)
while
countrf
>
0
:
self
.
append_to_dataset
(
"countsrf"
,
self
.
core
.
mu_to_seconds
(
countrf
-
t0
)
)
countrf
=
self
.
pmt
.
timestamp_mu
(
t_end
)
@
kernel
def
readout
(
self
):
"""NO SE USA ESTA FUNCION - Registro cuentas emitidas con el laser IR prendido"""
self
.
laserUV
.
off
()
delay
(
1
*
us
)
self
.
laserIR1
.
on
()
# Prendo y apago la TTL para ver en el osc.
#self.pmt_state.on()
#self.pmt.gate_rising(self.t_readout)
#with parallel:
#self.pmt_state.off()
self
.
laserUV
.
on
()
self
.
laserIR1
.
off
()
#self.pmt_state.pulse(self.t_readout)
#cuentas = self.pmt.count(here)
#delay(1*us)
self
.
enfriar_ion
()
return
now_mu
()
@
kernel
def
cleanup
(
self
):
"""NO SE USA ESTA FUNCION"""
self
.
core
.
break_realtime
()
self
.
laserIR1
.
off
()
self
.
laserIR2
.
off
()
self
.
laserUV
.
off
()
#self.pmt_state.off()
artiq_master/results/2025-03-13/16/000020221-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020222-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020223-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020227-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020229-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020230-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
artiq_master/results/2025-03-13/16/000020231-MicromotionCompensation.h5
0 → 100644
View file @
7c9853d0
File added
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