***
Wartungsfenster jeden ersten Mittwoch vormittag im Monat
***
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
leolab_devices
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Quantuminfo
Experiment Control
labscript-suite
leolab_devices
Commits
59310fb7
Commit
59310fb7
authored
1 year ago
by
Schabbauer, Johannes
Browse files
Options
Downloads
Patches
Plain Diff
ADwin: Enabled keeping final AO values after shot
parent
8297ed4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ADwinProII/blacs_workers.py
+9
-9
9 additions, 9 deletions
ADwinProII/blacs_workers.py
with
9 additions
and
9 deletions
ADwinProII/blacs_workers.py
+
9
−
9
View file @
59310fb7
...
...
@@ -89,17 +89,17 @@ class ADwinProIIWorker(Worker):
def
get_final_values
(
self
,
f
):
group
=
f
[
f
"
devices/
{
self
.
device_name
}
"
]
final_values
=
{}
#
AO_channel_map = {}
AO_channel_map
=
{}
for
module_address
,
module
in
self
.
modules
.
items
():
module_props
=
self
.
module_props
[
module_address
]
if
module_props
.
get
(
"
num_AO
"
,
None
)
is
not
None
:
# Set all final AO values to zero
# This is done for two reasons: first in the current ADwin process all AO are set to 0 at the end,
# second if some channels are not defined in labscript (and not in the h5file), we still get a front panel value of 0.
final_values
.
update
({
f
"
{
module_address
}
/
{
i
+
1
}
"
:
0
for
i
in
range
(
module_props
[
"
num_AO
"
])})
#
final_values.update({f"{module_address}/{i+1}":0 for i in range(module_props["num_AO"])})
# For mapping (16) AO ADwin channels to format "module/channel", only needed if final lines in this function are uncommented
#
idx_AO8 = module_props["start_index"]
#
AO_channel_map.update({ i+idx_AO8 : f"{module_address}/{i}" for i in range(1,1+module_props["num_AO"])})
idx_AO8
=
module_props
[
"
start_index
"
]
AO_channel_map
.
update
({
i
+
idx_AO8
:
f
"
{
module_address
}
/
{
i
}
"
for
i
in
range
(
1
,
1
+
module_props
[
"
num_AO
"
])})
if
module_props
.
get
(
"
num_DO
"
,
None
)
is
not
None
:
# Confusing way to get list of 32 bools from uint32 number:
...
...
@@ -110,11 +110,11 @@ class ADwinProIIWorker(Worker):
final_values
.
update
({
f
"
{
module_address
}
/
{
i
}
"
:
bits
[
int
(
i
)
-
1
]
for
i
in
module_props
[
"
DO_ports
"
]})
# TODO: only get final AO values, if we don't set then zo zero at end of ADwin process
#
stop_time_quantized = np.round(self.stop_time * CLOCK_T12 / self.PROCESSDELAY)
#
AO_data = group["ANALOG_OUT/VALUES"]
#
final_indices = np.nonzero(AO_data["n_cycles"] == stop_time_quantized)[0]
#
for idx in final_indices:
#
final_values[AO_channel_map[AO_data["channel"][idx]]] = DAC(AO_data["value"][idx])
stop_time_quantized
=
np
.
round
(
self
.
stop_time
*
CLOCK_T12
/
self
.
PROCESSDELAY
)
AO_data
=
group
[
"
ANALOG_OUT/VALUES
"
]
final_indices
=
np
.
nonzero
(
AO_data
[
"
n_cycles
"
]
==
stop_time_quantized
)[
0
]
for
idx
in
final_indices
:
final_values
[
AO_channel_map
[
AO_data
[
"
channel
"
][
idx
]]]
=
DAC
(
AO_data
[
"
value
"
][
idx
])
return
final_values
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment