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
67edbc87
Commit
67edbc87
authored
Apr 07, 2025
by
Vlatko, Carolina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modificaciones en fluorecense correlations caro
parent
a02a40a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
475 additions
and
325 deletions
+475
-325
Fluorescence_correlation.py
artiq_master/repository/Tests/Fluorescence_correlation.py
+475
-325
No files found.
artiq_master/repository/Tests/Fluorescence_correlation.py
View file @
67edbc87
from
artiq.experiment
import
*
from
artiq.experiment
import
*
from
pyLIAF.artiq.controllers
import
UrukulCh
from
pyLIAF.artiq.controllers
import
UrukulCh
import
numpy
as
np
import
numpy
as
np
from
scipy.optimize
import
curve_fit
# TODO:
# TODO:
# [ ] Revisar los tiempos
# [ ] Revisar los tiempos
...
@@ -12,184 +13,242 @@ class FluorescenceCorrelation(EnvExperiment):
...
@@ -12,184 +13,242 @@ class FluorescenceCorrelation(EnvExperiment):
"""TEST - Fluorescence correlation"""
"""TEST - Fluorescence correlation"""
def
build
(
self
):
def
build
(
self
):
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"ccb"
)
self
.
setattr_device
(
"ccb"
)
# Para las applets
self
.
pmt
=
self
.
get_device
(
"ttl0"
)
self
.
pmt
=
self
.
get_device
(
"ttl0"
)
#self.pmt_state = self.get_device("ttl4")
#self.pmt_state = self.get_device("ttl4")
# qué urukul se usa de IR???
self
.
laserUV
=
UrukulCh
(
self
,
ch
=
2
,
freq
=
110.0
,
amp
=
0.3
,
name
=
"UV"
)
#corresponde a 0.7 Vpp
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
# ## Borrar -Caro
self
.
laserIR2shift
=
UrukulCh
(
self
,
ch
=
0
,
freq
=
270.0
,
amp
=
0.7
,
name
=
"IR2shift"
)
#corresponde a 0.8 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
# ## Fin borrar -Caro
# self.setattr_argument("bin", NumberValue(50e-9, unit='us'), "Binning params")
# 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"
)
# Los que yo dejaría -Caro
self
.
setattr_argument
(
f
"t_prepDS
"
,
self
.
setattr_argument
(
"N_repetitions
"
,
NumberValue
(
10
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
NumberValue
(
10
0
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
"Experiment params"
)
"Experiment params"
)
self
.
setattr_argument
(
f
"t_
cool
"
,
self
.
setattr_argument
(
f
"t_
med
"
,
NumberValue
(
1000
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
u
s
),
NumberValue
(
2
*
s
,
unit
=
's'
,
scale
=
s
,
min
=
0.001
*
s
),
"Experiment params"
)
"Experiment params"
)
self
.
setattr_argument
(
f
"
t_readout
"
,
self
.
setattr_argument
(
f
"
f_rf
"
,
NumberValue
(
10
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
NumberValue
(
7262776.1
*
Hz
,
unit
=
'Hz'
,
scale
=
Hz
),
"
Experiment
params"
)
"
PostProcess
params"
)
self
.
setattr_argument
(
f
"t_wait
"
,
self
.
setattr_argument
(
"n_bins
"
,
NumberValue
(
5
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
NumberValue
(
5
0
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
"Experiment
params"
)
"PostProcess
params"
)
self
.
setattr_argument
(
f
"UV_
preparation_freq
"
,
self
.
setattr_argument
(
f
"UV_
measurement_amp
"
,
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
NumberValue
(
0.05
,
min
=
0.0
,
max
=
0.3
),
"Laser params"
)
"Laser params"
)
self
.
setattr_argument
(
f
"UV_
preparation
_amp"
,
self
.
setattr_argument
(
f
"UV_
final
_amp"
,
NumberValue
(
0.
3
,
min
=
0.0
,
max
=
0.3
),
NumberValue
(
0.
1
,
min
=
0.0
,
max
=
0.3
),
"Laser params"
)
"Laser params"
)
self
.
setattr_argument
(
f
"IR1_preparation_freq"
,
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
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"
,
self
.
tau_rf
=
1
/
self
.
f_rf
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Laser params"
)
self
.
setattr_argument
(
f
"IR2_preparation_amp"
,
## Hasta acá ##
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
"
,
# self.setattr_argument("no_measures
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
# NumberValue(1000, min=1, ndecimals=0, step=1
),
"Laser
params"
)
# "Experiment
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
"
,
# self.setattr_argument(f"t_prepDS
",
NumberValue
(
0.19
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(10*us, unit='us', scale=us, min=1*us
),
"Laser
params"
)
# "Experiment
params")
self
.
setattr_argument
(
f
"IR2_measurement_freq
"
,
# self.setattr_argument(f"t_cool
",
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(1000*us, unit='us', scale=us, min=1*us
),
"Laser
params"
)
# "Experiment
params")
self
.
setattr_argument
(
f
"IR2_measurement_amp
"
,
# self.setattr_argument(f"t_readout
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(10*us, unit='us', scale=us, min=1*us
),
"Laser
params"
)
# "Experiment
params")
self
.
setattr_argument
(
f
"UV_cooling_freq
"
,
# self.setattr_argument(f"t_wait
",
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(5*us, unit='us', scale=us, min=1*us
),
"Cooling
params"
)
# "Experiment
params")
self
.
setattr_argument
(
f
"UV_cooling_amp
"
,
# self.setattr_argument(f"UV_preparation_freq
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
# NumberValue(115*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR1_cooling_freq
"
,
# self.setattr_argument(f"UV_preparation_amp
",
NumberValue
(
225
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(0.3, min=0.0, max=0.3
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR1_cooling_amp
"
,
# self.setattr_argument(f"IR1_preparation_freq
",
NumberValue
(
0.25
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(229*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR2_cooling_freq
"
,
# self.setattr_argument(f"IR1_preparation_amp
",
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(0.19, min=0.0, max=0.35
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR2_cooling_amp
"
,
# self.setattr_argument(f"IR2_preparation_freq
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(85*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"UV_final_freq
"
,
# self.setattr_argument(f"IR2_preparation_amp
",
NumberValue
(
115
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(0.3, min=0.0, max=0.35
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"UV_final_amp
"
,
# self.setattr_argument(f"UV_measurement_freq
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.3
),
# NumberValue(115*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR1_final_freq
"
,
# self.setattr_argument(f"UV_measurement_amp
",
NumberValue
(
225
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(0.3, min=0.0, max=0.3
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR1_final_amp
"
,
# self.setattr_argument(f"IR1_measurement_freq
",
NumberValue
(
0.25
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(229*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR2_final_freq
"
,
# self.setattr_argument(f"IR1_measurement_amp
",
NumberValue
(
85
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
# NumberValue(0.19, min=0.0, max=0.35
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
f
"IR2_final_amp
"
,
# self.setattr_argument(f"IR2_measurement_freq
",
NumberValue
(
0.3
,
min
=
0.0
,
max
=
0.35
),
# NumberValue(85*MHz, unit='MHz', scale=MHz, min=1*MHz, max=400*MHz
),
"Cooling
params"
)
# "Laser
params")
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
# 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
@
rpc
def
create_datasets
(
self
):
def
create_datasets
(
self
):
self
.
set_dataset
(
"counts"
,
[],
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
)
## Datos
self
.
set_dataset
(
"time_stamps"
,
[],
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"tiem_stamps_corrected"
,
[],
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"counts"
,
[],
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"counts_err"
,
[],
broadcast
=
True
,
archive
=
True
)
# Parámetros
self
.
set_dataset
(
"f_rf"
,
self
.
f_rf
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_med"
,
self
.
t_med
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"n_bins"
,
self
.
bins
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"UV_measurement_amp"
,
self
.
UV_measurement_amp
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"Comments"
,
self
.
Comments
)
## Hasta acá
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("counts", [], broadcast=True, archive=True)
self
.
set_dataset
(
"UV_preparation_amp"
,
self
.
UV_preparation_amp
,
broadcast
=
False
,
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_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("IR1_preparation_freq", self.IR1_preparation
_freq, broadcast=False, archive=True)
self
.
set_dataset
(
"IR2_cooling_amp"
,
self
.
IR2_cooling
_amp
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR1_preparation_amp", self.IR1_preparation
_amp, broadcast=False, archive=True)
self
.
set_dataset
(
"UV_cooling_freq"
,
self
.
UV_cooling
_freq
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR2_preparation_freq", self.IR2_preparation
_freq, broadcast=False, archive=True)
self
.
set_dataset
(
"UV_cooling_amp"
,
self
.
UV_cooling
_amp
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR2_preparation_amp", self.IR2_preparation
_amp, broadcast=False, archive=True)
self
.
set_dataset
(
"IR1_measurement_freq"
,
self
.
IR1_measurement
_freq
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("UV_preparation_freq", self.UV_preparation
_freq, broadcast=False, archive=True)
self
.
set_dataset
(
"IR1_measurement_amp"
,
self
.
IR1_measurement
_amp
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("UV_preparation_amp", self.UV_preparation
_amp, broadcast=False, archive=True)
self
.
set_dataset
(
"IR2_measurement_freq"
,
self
.
IR2_measurement
_freq
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR1_cooling_freq", self.IR1_cooling
_freq, broadcast=False, archive=True)
self
.
set_dataset
(
"IR2_measurement_amp"
,
self
.
IR2_measurement
_amp
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR1_cooling_amp", self.IR1_cooling
_amp, broadcast=False, archive=True)
self
.
set_dataset
(
"UV_measurement_freq"
,
self
.
UV_measurement
_freq
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR2_cooling_freq", self.IR2_cooling
_freq, broadcast=False, archive=True)
self
.
set_dataset
(
"UV_measurement_amp"
,
self
.
UV_measurement
_amp
,
broadcast
=
False
,
archive
=
True
)
# self.set_dataset("IR2_cooling_amp", self.IR2_cooling
_amp, broadcast=False, archive=True)
self
.
laserIR1
.
generate_dataset
()
# self.set_dataset("UV_cooling_freq", self.UV_cooling_freq, broadcast=False, archive=True)
self
.
laserIR2
.
generate_dataset
()
# self.set_dataset("UV_cooling_amp", self.UV_cooling_amp, broadcast=False, archive=True)
self
.
laserUV
.
generate_dataset
()
# 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_UV",self.frec_UV, broadcast=False,archive=True)
#self.set_dataset("frec_IR",self.frec_IR, 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.
# 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
# o bien guardando todos aca, o armando un metodo apropiado en su controlador
self
.
set_dataset
(
"Comments"
,
self
.
Comments
)
#
self.set_dataset("Comments", self.Comments)
#self.set_dataset("binvector", np.arange(0, self.t_readout, self.bin*1e-6), broadcast=True, archive=False)
#self.set_dataset("binvector", np.arange(0, self.t_readout, self.bin*1e-6), broadcast=True, archive=False)
...
@@ -198,41 +257,46 @@ class FluorescenceCorrelation(EnvExperiment):
...
@@ -198,41 +257,46 @@ class FluorescenceCorrelation(EnvExperiment):
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
"${python} -m pyLIAF.artiq.applets.histogram "
"${python} -m pyLIAF.artiq.applets.histogram "
"counts "
"counts "
"--update-delay 0.2"
)
"--update-delay 0.2"
)
# Cambiar applet y parámetros -Caro
@
kernel
def
run
(
self
):
self
.
create_datasets
()
self
.
create_applets
()
self
.
init_kernel
()
delay
(
1
*
ms
)
self
.
enfriar_ion
()
@
kernel
for
runN
in
range
(
self
.
no_measures
):
def
medicion_y_lectura
(
self
):
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
)
)
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
self
.
core
.
seconds_to_mu
(
100
*
us
)
)
self
.
prep_DS
()
self
.
pmt
.
gate_rising
(
self
.
t_med
)
t_end
=
self
.
medicion_y_lectura
()
self
.
save_counts
(
now_mu
())
self
.
save_counts
(
t_end
)
#self.mutate_dataset("counts", runN, counts)
@
kernel
def
run_kernel
(
self
):
self
.
core
.
reset
()
self
.
pmt
.
input
()
self
.
laserUV
.
set_channel
()
#self.cleanup()
self
.
core
.
break_realtime
()
self
.
core
.
break_realtime
()
self
.
enfriar_ion
()
self
.
laserUV
.
set_frequency
(
110
*
MHz
,
self
.
UV_measurement_amp
)
self
.
core
.
break_realtime
()
self
.
core
.
break_realtime
()
self
.
laserIR1
.
select_profile
(
3
)
self
.
core
.
wait_until_mu
(
now_mu
())
self
.
laserIR2
.
select_profile
(
3
)
self
.
laserUV
.
select_profile
(
3
)
self
.
laserIR2shift
.
select_profile
(
3
)
self
.
laserIR1
.
on
()
# self.enfriar_ion() ## Borrar -Caro
self
.
laserIR2
.
on
()
# self.core.break_realtime() ## Borrar -Caro
self
.
laserUV
.
on
()
self
.
laserIR2shift
.
on
()
# self.laserIR1.select_profile(3) ## Borrar -Caro
# self.laserIR2.select_profile(3) ## Borrar -Caro
# self.laserUV.select_profile(3) ## Esto sí, pero no sé qué es select profile. Hay que poner UV_measurement_amp -Caro
# self.laserIR2shift.select_profile(3) ## Borrar -Caro
# self.laserIR1.on() ## Borrar -Caro
# self.laserIR2.on() ## Borrar -Caro
# self.laserUV.on()
# self.laserIR2shift.on() ## Borrar -Caro
...
@@ -241,194 +305,280 @@ class FluorescenceCorrelation(EnvExperiment):
...
@@ -241,194 +305,280 @@ class FluorescenceCorrelation(EnvExperiment):
count
=
self
.
pmt
.
timestamp_mu
(
t_end
)
count
=
self
.
pmt
.
timestamp_mu
(
t_end
)
t0
=
t_end
-
self
.
core
.
seconds_to_mu
(
self
.
t_readout
)
t0
=
t_end
-
self
.
core
.
seconds_to_mu
(
self
.
t_readout
)
while
count
>
0
:
while
count
>
0
:
self
.
append_to_dataset
(
"
count
s"
,
self
.
core
.
mu_to_seconds
(
count
-
t0
)
)
self
.
append_to_dataset
(
"
time_stamp
s"
,
self
.
core
.
mu_to_seconds
(
count
-
t0
)
)
count
=
self
.
pmt
.
timestamp_mu
(
t_end
)
count
=
self
.
pmt
.
timestamp_mu
(
t_end
)
@
kernel
# @kernel
def
init_kernel
(
self
):
# def init_kernel(self):
self
.
core
.
reset
()
# self.core.reset()
self
.
pmt
.
input
()
# self.pmt.input()
#self.pmt_state.output()
# #self.pmt_state.output()
#self.laserIR.initialize_channel()
# #self.laserIR.initialize_channel()
#self.laserUV.initialize_channel()
# #self.laserUV.initialize_channel()
# Quizas haya errores de tiempo.
# # Quizas haya errores de tiempo.
#self.pmt_state.off()
# #self.pmt_state.off()
#self.laserIR.set_channel()
# #self.laserIR.set_channel()
#self.laserUV.set_channel()
# #self.laserUV.set_channel()
#self.core.wait_until_mu(now_mu())
# #self.core.wait_until_mu(now_mu())
delay
(
1
*
ms
)
self
.
laserIR1
.
set_channel
()
delay
(
1
*
ms
)
# ## Caro:
self
.
laserIR2
.
set_channel
()
# # configurar pmt y amp del UV
delay
(
1
*
ms
)
# ##
self
.
laserIR2shift
.
set_channel
()
delay
(
1
*
ms
)
# delay(1*ms)
self
.
laserUV
.
set_channel
()
# self.laserIR1.set_channel()
self
.
core
.
wait_until_mu
(
now_mu
())
# 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())
# ## Borrar -Caro
# @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)
## Borrar -Caro
# @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)
# ## Borrar -antes ver que sirve -Caro
# @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()
# self.pmt.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()
# ## Borrar -Caro
# @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()
# ## Borrar -Caro
# @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()
@
kernel
def
stop_kernel
(
self
):
self
.
core
.
break_realtime
()
self
.
core
.
break_realtime
()
self
.
laserUV
.
set_frequency
(
self
.
UV_measurement_freq
,
self
.
UV_measurement_amp
,
profile
=
0
)
self
.
laserUV
.
set_frequency
(
110
*
MHz
,
self
.
UV_final_amp
)
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
()
self
.
core
.
break_realtime
()
delay
(
1
*
ms
)
@
rpc
self
.
laserIR1
.
set_channel
(
profile
=
1
)
def
bin_time_arrivals
(
self
,
arrival_times
,
tau
):
delay
(
1
*
ms
)
"""
self
.
laserIR2
.
set_channel
(
profile
=
1
)
Binea los tiempos de llegada de los fotones según el periodo tau.
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
()
Parameters:
arrival_times (numpy array): Vector con los tiempos de llegada de los fotones.
tau (float): Periodo de bineado.
delay
(
1
*
ms
)
Returns:
self
.
laserIR1
.
set_channel
(
profile
=
2
)
numpy array: Vector con los tiempos bienados.
delay
(
1
*
ms
)
"""
self
.
laserIR2
.
set_channel
(
profile
=
2
)
return
arrival_times
-
tau
*
(
arrival_times
//
tau
)
delay
(
1
*
ms
)
self
.
laserIR2shift
.
set_channel
(
profile
=
2
)
delay
(
1
*
ms
)
self
.
laserUV
.
set_channel
(
profile
=
2
)
self
.
core
.
break_realtime
()
@
rpc
self
.
laserUV
.
set_frequency
(
self
.
UV_preparation_freq
,
self
.
UV_preparation_amp
,
profile
=
2
)
def
sinusoidal
(
self
,
x
,
A
,
B
,
C
,
D
):
self
.
core
.
break_realtime
()
return
A
*
np
.
sin
(
B
*
x
+
C
)
+
D
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
()
@
rpc
def
do_postprocess_and_fit
(
self
):
self
.
time_stamps
=
self
.
get_dataset
(
"time_stamps"
)
tiemposarreglados
=
self
.
bin_time_arrivals
(
self
.
time_stamps
,
self
.
tau_rf
)
b
=
self
.
tau_rf
/
self
.
n_bins
bins
=
np
.
arange
(
0
,
self
.
tau_rf
,
b
)
hist
,
bin_edges
=
np
.
histogram
(
tiemposarreglados
,
bins
=
bins
)
delay
(
1
*
ms
)
x_extended
=
np
.
concatenate
([
bin_edges
[:
-
1
]
+
i
*
self
.
tau_rf
for
i
in
range
(
3
)])
self
.
laserIR1
.
set_channel
(
profile
=
3
)
y_extended
=
np
.
tile
(
hist
,
3
)
delay
(
1
*
ms
)
x_extended_dense
=
np
.
arange
(
np
.
min
(
x_extended
),
np
.
max
(
x_extended
),
0.1
*
(
x_extended
[
1
]
-
x_extended
[
0
]))
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
()
params
,
_
=
curve_fit
(
self
.
sinusoidal
,
x_extended
,
y_extended
,
p0
=
[
max
(
y_extended
),
2
*
np
.
pi
/
self
.
tau_rf
,
0
,
np
.
mean
(
y_extended
)])
self
.
laserUV
.
set_frequency
(
self
.
UV_final_freq
,
self
.
UV_final_amp
,
profile
=
3
)
# amps.append(np.abs(params[0]))
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
()
return
x_extended
,
y_extended
,
params
@
rpc
def
run
(
self
):
"Ejecución. Preparamos los dispositivos y llamamos al kernel."
self
.
create_datasets
()
self
.
create_applets
()
delay
(
1
*
ms
)
self
.
run_kernel
()
self
.
core
.
wait_until_mu
(
now_mu
())
try
:
for
runN
in
range
(
self
.
N_repetitions
):
self
.
medicion_y_lectura
()
x
,
y
,
params
=
self
.
do_postprocess_and_fit
()
@
kernel
# Guardar datasets histograma
def
enfriar_ion
(
self
):
# Guardar fit params
"""Preparo el ion prendiendo ambos laseres"""
time
.
sleep
(
0.05
)
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
while
self
.
scheduler
.
check_pause
():
def
prep_DS
(
self
):
print
(
"PAUSED EXPERIMENT"
)
"""Preparo el estado oscuro prendiendo los 3 laseres con las frecuencias correctas"""
self
.
stop_kernel
()
self
.
core
.
break_realtime
()
self
.
core
.
comm
.
close
()
self
.
laserIR1
.
select_profile
(
2
)
self
.
scheduler
.
pause
()
self
.
laserIR2
.
select_profile
(
2
)
# TODO: reset freqs/amps
self
.
laserUV
.
select_profile
(
2
)
print
(
"RESUMED EXPERIMENT"
)
self
.
laserIR2shift
.
select_profile
(
2
)
self
.
laserUV
.
on
()
self
.
laserIR1
.
on
()
self
.
laserIR2
.
on
()
self
.
laserIR2shift
.
on
()
delay
(
self
.
t_prepDS
)
@
kernel
except
TerminationRequested
:
def
medicion_y_lectura
(
self
):
self
.
stop_kernel
()
"""Registro cuentas emitidas con el laser UV prendido"""
print
(
"STOPPED EXPERIMENT"
)
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()
self
.
pmt
.
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
()
self
.
stop_kernel
()
\ No newline at end of file
@
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()
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