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
2fed3ca3
Commit
2fed3ca3
authored
Jun 19, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego carpeta de calibraciones
parent
599a38c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
0 deletions
+99
-0
IR_blinking.py
artiq_master/repository/Calibrations/IR_blinking.py
+99
-0
No files found.
artiq_master/repository/Calibrations/IR_blinking.py
0 → 100644
View file @
2fed3ca3
from
urukul_drivers
import
UrukulCh
import
numpy
as
np
from
artiq.experiment
import
*
class
PMTCalibration
(
EnvExperiment
):
"""Blinking script plotting for pmt calibration """
def
build
(
self
):
self
.
setattr_device
(
"ccb"
)
self
.
setattr_device
(
"scheduler"
)
self
.
setattr_device
(
"core"
)
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
(
f
"t_readout"
,
NumberValue
(
100
*
ms
,
unit
=
'ms'
,
scale
=
ms
,
min
=
1
*
ms
),
"PMT Calibration"
)
@
rpc
def
create_datasets
(
self
):
self
.
set_dataset
(
"pmt_counts_on"
,
np
.
zeros
(
1
,
dtype
=
int
),
broadcast
=
True
,
archive
=
False
)
self
.
set_dataset
(
"pmt_counts_off"
,
np
.
zeros
(
1
,
dtype
=
int
),
broadcast
=
True
,
archive
=
False
)
@
rpc
def
create_applets
(
self
):
self
.
ccb
.
issue
(
"create_applet"
,
"calibration_pmt_blinking"
,
"${artiq_applet}realtime "
"200 "
"pmt_counts_on "
"--y2 pmt_counts_off"
)
@
kernel
def
init_kernel
(
self
):
self
.
core
.
reset
()
self
.
laserIR
.
initialize_channel
()
self
.
laserUV
.
initialize_channel
()
self
.
pmt
.
input
()
delay
(
10
*
us
)
self
.
laserIR
.
set_channel
()
self
.
laserUV
.
set_channel
()
self
.
core
.
wait_until_mu
(
now_mu
())
delay
(
1
*
ms
)
self
.
laserIR
.
on
()
self
.
laserUV
.
on
()
def
run
(
self
):
self
.
create_datasets
()
self
.
create_applets
()
self
.
init_kernel
()
try
:
while
True
:
self
.
measure_counts
()
while
self
.
scheduler
.
check_pause
():
print
(
"PAUSED BLINKING"
)
self
.
core
.
comm
.
close
()
self
.
scheduler
.
pause
()
# TODO: reset freqs/amps
print
(
"RESUMED BLINKING"
)
except
TerminationRequested
:
self
.
cleanup
()
print
(
"STOPPED BLINKING"
)
@
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
measure_counts
(
self
):
self
.
core
.
break_realtime
()
self
.
laserUV
.
on
()
self
.
laserIR
.
off
()
self
.
mutate_dataset
(
"pmt_counts_off"
,
0
,
self
.
readout
())
at_mu
(
self
.
core
.
get_rtio_counter_mu
()
+
10000
)
self
.
laserIR
.
on
()
self
.
mutate_dataset
(
"pmt_counts_on"
,
0
,
self
.
readout
())
@
kernel
def
cleanup
(
self
):
self
.
core
.
break_realtime
()
self
.
laserIR
.
off
()
self
.
laserUV
.
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