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
b59f48a1
Commit
b59f48a1
authored
May 22, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego amplitud por canal y attn global
parent
a989f9a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
urukul_outputs.py
artiq_master/repository/urukul_outputs.py
+23
-15
No files found.
artiq_master/repository/urukul_outputs.py
View file @
b59f48a1
...
...
@@ -9,29 +9,41 @@ class Set_All_Urukul_Freqs(EnvExperiment):
# sets core device drivers as attributes
self
.
setattr_device
(
"core"
)
# global attenuation
self
.
setattr_argument
(
"attenuation"
,
NumberValue
(
0
*
dB
,
unit
=
'dB'
,
scale
=
dB
,
min
=
0
*
dB
,
max
=
31
*
dB
),
)
for
ch
in
range
(
4
):
# sets urukul0, channel 0-3 device drivers as attributes
self
.
setattr_device
(
f
"urukul0_ch{ch}"
)
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self
.
setattr_argument
(
f
"state_ch{ch}"
,
BooleanValue
(
ch
==
0
),
f
"canal_{ch}"
)
# each channel's frequency
self
.
setattr_argument
(
f
"freq_ch{ch}"
,
self
.
setattr_argument
(
f
"freq_ch{ch}"
,
NumberValue
(
200.0
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
f
"canal_{ch}"
)
# each channel's amplitude
self
.
setattr_argument
(
f
"amp_ch{ch}"
,
NumberValue
(
1.
,
min
=
0.
,
max
=
1.
),
f
"canal_{ch}"
)
self
.
all_channels
=
[
self
.
urukul0_ch0
,
self
.
urukul0_ch1
,
self
.
urukul0_ch2
,
self
.
urukul0_ch3
]
self
.
states
=
[
self
.
state_ch0
,
self
.
state_ch1
,
self
.
state_ch2
,
self
.
state_ch3
]
self
.
all_amps
=
[
self
.
amp_ch0
,
self
.
amp_ch1
,
self
.
amp_ch2
,
self
.
amp_ch3
]
self
.
all_freqs
=
[
self
.
freq_ch0
,
self
.
freq_ch1
,
self
.
freq_ch2
,
self
.
freq_ch3
]
self
.
states
=
[
self
.
state_ch0
,
self
.
state_ch1
,
self
.
state_ch2
,
self
.
state_ch3
]
self
.
all_channels
=
[
self
.
urukul0_ch0
,
self
.
urukul0_ch1
,
self
.
urukul0_ch2
,
self
.
urukul0_ch3
]
self
.
use_amps
=
[]
self
.
use_freqs
=
[]
self
.
use_channels
=
[]
for
state
,
ch_n
,
freq_n
in
zip
(
self
.
states
,
self
.
all_channels
,
self
.
all_freqs
):
for
state
,
ch_n
,
freq_n
,
amp_n
in
zip
(
self
.
states
,
self
.
all_channels
,
self
.
all_freqs
,
self
.
all_amps
):
if
state
:
self
.
use_channels
.
append
(
ch_n
)
self
.
use_freqs
.
append
(
freq_n
)
self
.
use_amps
.
append
(
amp_n
)
@
kernel
...
...
@@ -42,19 +54,15 @@ class Set_All_Urukul_Freqs(EnvExperiment):
channel
.
cpld
.
init
()
channel
.
init
()
# defines global amplitude, for all channels
amp
=
1.0
# defines attenuation variable from 0 (no attenuation) to max val (check) -31,5dB
attenuation
=
3.0
*
dB
delay
(
10
*
ms
)
# attenuation and frecuency to all channels
for
i
in
range
(
len
(
self
.
use_channels
)):
#zip(self.use_channels, self.use_freqs):
self
.
use_channels
[
i
]
.
set_att
(
attenuation
)
# writes frequency and amplitude variables to urukul channel thus outputting function
self
.
use_channels
[
i
]
.
set
(
self
.
use_freqs
[
i
],
amplitude
=
amp
)
# writes global attenuation and specific
# frequency and amplitude variables to each
# urukul channel outputting function
self
.
use_channels
[
i
]
.
set_att
(
self
.
attenuation
)
self
.
use_channels
[
i
]
.
set_amplitude
(
self
.
use_amps
[
i
])
self
.
use_channels
[
i
]
.
set
(
self
.
use_freqs
[
i
])
# turn on every selected channel
for
i
in
range
(
4
):
...
...
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