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
6c10c54b
Commit
6c10c54b
authored
Jul 06, 2021
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego archivo para hacer espectro de IR, va a barrer el IR y medir con count
parent
a5855919
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
165 additions
and
0 deletions
+165
-0
IR_spectrum.py
artiq_master/repository/Experiments/IR_spectrum.py
+165
-0
No files found.
artiq_master/repository/Experiments/IR_spectrum.py
0 → 100644
View file @
6c10c54b
from
artiq.experiment
import
*
from
pyLIAF.artiq.controllers
import
UrukulCh
#from artiq.coredevice.ad9910 import PHASE_MODE_ABSOLUTE
import
time
import
numpy
as
np
class
SingleChannelScan
(
EnvExperiment
):
"""IR frequency sweep"""
def
build
(
self
):
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"ccb"
)
self
.
pmt
=
self
.
get_device
(
"ttl0"
)
self
.
laserUV
=
UrukulCh
(
self
,
ch
=
2
,
freq
=
110.0
,
amp
=
0.3
,
name
=
"UV"
)
#corresponde a 0.7 Vpp
self
.
laserIR
=
UrukulCh
(
self
,
ch
=
1
,
freq
=
208.0
,
amp
=
0.35
,
name
=
"IR"
)
#corresponde a 0.8 Vpp
self
.
setattr_argument
(
"no_measures"
,
NumberValue
(
100
,
min
=
1
,
ndecimals
=
0
,
step
=
1
),
"Experiment params"
)
self
.
setattr_argument
(
f
"IR_cooling_freq"
,
NumberValue
(
208
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_cool"
,
NumberValue
(
10
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_trans"
,
NumberValue
(
3
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
f
"t_readout"
,
NumberValue
(
5
*
us
,
unit
=
'us'
,
scale
=
us
,
min
=
1
*
us
),
"Experiment params"
)
self
.
setattr_argument
(
"Comments"
,
StringValue
(
" "
),
"General comments"
)
self
.
setattr_argument
(
"IR_Freqs"
,
Scannable
(
default
=
CenterScan
(
208
*
MHz
,
20
*
MHz
,
0.1
*
MHz
),
unit
=
"MHz"
,
scale
=
MHz
,
global_min
=
1
*
MHz
,
global_max
=
400
*
MHz
)
)
@
rpc
def
create_datasets
(
self
):
for
i
in
range
(
len
(
self
.
IR_Freqs
.
sequence
)):
if
i
<
10
:
self
.
set_dataset
(
f
"counts_00{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
elif
i
<
100
:
self
.
set_dataset
(
f
"counts_0{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
else
:
self
.
set_dataset
(
f
"counts_{i}"
,
np
.
zeros
(
self
.
no_measures
,
dtype
=
int
),
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"IR_frequencies"
,
self
.
IR_Freqs
.
sequence
,
dtype
=
float
),
broadcast
=
True
,
archive
=
True
)
self
.
set_dataset
(
"t_enfriar_ion"
,
self
.
t_cool
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_transitory"
,
self
.
t_trans
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"t_readout"
,
self
.
t_readout
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"no_measures"
,
self
.
no_measures
,
broadcast
=
False
,
archive
=
True
)
self
.
set_dataset
(
"current_freq"
,
np
.
array
([
0.0
]),
broadcast
=
True
,
archive
=
False
)
self
.
set_dataset
(
"Comments"
,
self
.
Comments
)
self
.
laserIR
.
generate_dataset
()
self
.
laserUV
.
generate_dataset
()
@
rpc
def
create_applets
(
self
):
self
.
ccb
.
issue
(
"create_applet"
,
"cuentas"
,
"${python} -m pyLIAF.artiq.applets.histogram "
"counts "
"--update-delay 0.2"
)
self
.
ccb
.
issue
(
"create_applet"
,
"output_frecuency"
,
"${artiq_applet}big_number "
"current_freq"
)
@
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
):
for
freq
in
self
.
IR_Freqs
.
sequence
:
self
.
mutate_dataset
(
"current_freq"
,
np
.
array
([
freq
]),
broadcast
=
True
,
archive
=
False
)
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
self
.
core
.
seconds_to_mu
(
self
.
t_cool
)
)
self
.
laserIR
.
set_channel
(
freq
)
delay
(
self
.
t_trans
)
self
.
mutate_dataset
(
"counts"
,
runN
,
self
.
readout
())
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
10000
)
self
.
enfriar_ion
()
@
kernel
def
init_kernel
(
self
):
self
.
core
.
reset
()
self
.
pmt
.
input
()
self
.
pmt_state
.
output
()
self
.
laserIR
.
initialize_channel
()
self
.
laserUV
.
initialize_channel
()
# Quizas haya errores de tiempo.
self
.
laserIR
.
set_channel
()
self
.
laserUV
.
set_channel
()
self
.
core
.
wait_until_mu
(
now_mu
())
@
kernel
def
enfriar_ion
(
self
):
"""Preparo el ion prendiendo ambos laseres"""
self
.
laserIR
.
set_channel
(
self
.
IR_cooling_freq
)
#self.laserIR.on()
self
.
laserUV
.
on
()
#delay(self.t_cool)
@
kernel
def
readout
(
self
):
"""Registro de cuentas emitidas"""
here
=
self
.
pmt
.
gate_rising
(
self
.
t_readout
)
cuentas
=
self
.
pmt
.
count
(
here
)
delay
(
1
*
us
)
return
cuentas
"""
@kernel
def run_kernel(self):
delay(10*ms)
self.salida.set_amplitude(self.amp)
self.salida.set_phase_mode(PHASE_MODE_ABSOLUTE)
self.salida.set(self.freqs.sequence[0])
for freq in self.freqs.sequence:
self.salida.sw.pulse(6*ms)
self.salida.set(freq)
self.mutate_dataset("current_freq", 0, freq)
delay(4*s)
"""
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